/* ============================================
   Pomoc Drogowa Pyrek — Premium Design System
   Brand: Yellow #F5C518 + Dark #0b0f1a
   ============================================ */

:root {
  --brand: #F5C518;
  --brand-hover: #e0b400;
  --brand-light: rgba(245, 197, 24, 0.10);
  --brand-glow: rgba(245, 197, 24, 0.25);
  --brand-dark: #1a1a2e;

  --bg-0: #060912;
  --bg-1: #0c1021;
  --bg-2: #111827;
  --bg-3: #1a2235;
  --bg-4: #233044;
  --bg-input: #0d1220;

  --border-1: rgba(255,255,255,0.06);
  --border-2: rgba(255,255,255,0.10);
  --border-3: rgba(255,255,255,0.15);

  --text-0: #f8fafc;
  --text-1: #e2e8f0;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --text-4: #475569;

  --green: #22c55e; --green-bg: rgba(34,197,94,0.10); --green-border: rgba(34,197,94,0.20);
  --blue: #3b82f6; --blue-bg: rgba(59,130,246,0.10); --blue-border: rgba(59,130,246,0.20);
  --amber: #f59e0b; --amber-bg: rgba(245,158,11,0.10); --amber-border: rgba(245,158,11,0.20);
  --red: #ef4444; --red-bg: rgba(239,68,68,0.10); --red-border: rgba(239,68,68,0.20);
  --purple: #a855f7; --purple-bg: rgba(168,85,247,0.10);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px var(--brand-glow);

  --r-xs: 6px; --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 9999px;
  --t-fast: 120ms ease; --t-normal: 200ms ease; --t-smooth: 350ms cubic-bezier(0.4,0,0.2,1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-0); color: var(--text-1);
  line-height: 1.5; min-height: 100vh;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
#app { min-height: 100vh; }
a { color: var(--brand); text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; background: none; color: inherit; }
input, select, textarea {
  font-family: inherit; font-size: 0.93rem; color: var(--text-0);
  background: var(--bg-input); border: 1px solid var(--border-2);
  border-radius: var(--r-md); padding: 10px 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
input::placeholder { color: var(--text-4); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
textarea { resize: vertical; min-height: 72px; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-3); border-radius: var(--r-full); }

/* ── Lucide icon sizing ── */
.lucide { width: 18px; height: 18px; stroke-width: 1.8; flex-shrink: 0; }
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }
.icon-xxl { width: 40px; height: 40px; stroke-width: 1.5; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 0 0 var(--brand-glow); } 50% { box-shadow: 0 0 0 14px transparent; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.fade-in { animation: fadeIn 250ms ease; }
.slide-up { animation: slideUp 350ms var(--t-smooth); }

/* ── Toast Notifications ── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 10000; display: flex; flex-direction: column; gap: 6px; }
.toast {
  background: var(--bg-3); border: 1px solid var(--border-2); border-radius: var(--r-md);
  padding: 12px 18px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  min-width: 280px; animation: slideDown 250ms ease; font-size: 0.85rem; font-weight: 500;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.success .toast-icon { color: var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.error .toast-icon { color: var(--red); }
.toast.info { border-left: 3px solid var(--brand); }
.toast.info .toast-icon { color: var(--brand); }
.toast .toast-icon { display: flex; }
.toast.exit { animation: fadeIn 150ms ease reverse forwards; }

/* ── Login ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #060912 0%, #0c1021 40%, #111827 100%);
  padding: 20px; position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute; top: -30%; right: -20%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(245,197,24,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.login-page::after {
  content: ''; position: absolute; bottom: -20%; left: -10%; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.03) 0%, transparent 70%);
  pointer-events: none;
}
.login-card {
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); padding: 44px 36px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg); position: relative; z-index: 1; animation: slideUp 450ms ease;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-img { height: 48px; margin-bottom: 12px; border-radius: var(--r-sm); }
.login-logo-placeholder {
  width: 56px; height: 56px; margin: 0 auto 12px; background: var(--brand);
  border-radius: var(--r-md); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow);
}
.login-logo-placeholder i { color: #000; }
.login-logo h1 { font-size: 1.2rem; font-weight: 800; color: var(--brand); letter-spacing: -0.5px; }
.login-logo p { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 5px; }
.login-field label { font-size: 0.75rem; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.login-field input { padding: 11px 14px; }
.login-btn {
  width: 100%; padding: 12px; margin-top: 4px;
  background: var(--brand); color: #000; font-size: 0.93rem; font-weight: 700;
  border-radius: var(--r-md); transition: all var(--t-fast); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-btn:hover { background: var(--brand-hover); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.login-error {
  background: var(--red-bg); border: 1px solid var(--red-border);
  color: #fca5a5; padding: 8px 12px; border-radius: var(--r-sm); font-size: 0.8rem; font-weight: 500; text-align: center;
}
.login-demo { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-1); text-align: center; }
.login-demo-title { font-size: 0.65rem; color: var(--text-4); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.login-demo-accounts { display: flex; flex-direction: column; gap: 5px; }
.login-demo-btn {
  padding: 7px 10px; background: var(--bg-4); border: 1px solid var(--border-1);
  border-radius: var(--r-sm); font-size: 0.72rem; color: var(--text-2);
  transition: all var(--t-fast); display: flex; align-items: center; justify-content: space-between;
}
.login-demo-btn:hover { border-color: var(--brand); color: var(--brand); }
.login-demo-btn .rb { padding: 2px 8px; border-radius: var(--r-full); font-size: 0.6rem; font-weight: 700; }
.login-demo-btn .rb.d { background: var(--brand-light); color: var(--brand); }
.login-demo-btn .rb.k { background: var(--green-bg); color: var(--green); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r-md); font-size: 0.82rem;
  font-weight: 600; transition: all var(--t-fast); white-space: nowrap;
}
.btn-brand { background: var(--brand); color: #000; }
.btn-brand:hover { background: var(--brand-hover); box-shadow: var(--shadow-glow); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-4); color: var(--text-0); }
.btn-outline { border: 1px solid var(--border-2); color: var(--text-1); }
.btn-outline:hover { border-color: var(--border-3); background: var(--bg-4); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.btn-danger:hover { background: rgba(239,68,68,0.18); }
.btn-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-xs { padding: 4px 8px; font-size: 0.7rem; }
.btn-icon-only { padding: 7px; }

/* ── Status Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 0.68rem; font-weight: 600; border: 1px solid;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.free { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.badge.en_route,.badge.accepted { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.badge.on_site { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }
.badge.towing,.badge.loading { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.badge.dropped_off { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.badge.returning { background: var(--purple-bg); color: var(--purple); border-color: rgba(168,85,247,0.20); }
.badge.completed { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.badge.cancelled { background: rgba(100,116,139,0.1); color: var(--text-3); border-color: rgba(100,116,139,0.2); }
.badge.empty_run { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: rgba(245,158,11,0.3); }
.badge.pending { background: var(--brand-light); color: var(--brand); border-color: rgba(245,197,24,0.2); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.60); backdrop-filter: blur(6px);
  z-index: 5000; display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; animation: fadeIn 150ms ease; overflow-y: auto;
}
.modal {
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); width: 100%; max-width: 580px;
  box-shadow: var(--shadow-lg); animation: slideUp 250ms ease;
}
.modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border-1);
  display: flex; gap: 8px; justify-content: flex-end;
}
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); color: var(--text-3); transition: all var(--t-fast);
}
.modal-close:hover { background: var(--bg-4); color: var(--text-0); }

/* ── Form ── */
.form-section { margin-bottom: 20px; }
.form-section-title {
  font-size: 0.72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center; gap: 6px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-label { font-size: 0.75rem; font-weight: 600; color: var(--text-2); }
.form-req { color: var(--red); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

/* ── Spinner ── */
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }

/* ── Map ── */
.leaflet-tile-pane { filter: brightness(0.72) contrast(1.1) saturate(0.75); }
.leaflet-control-zoom a { background: var(--bg-3) !important; color: var(--text-1) !important; border-color: var(--border-2) !important; font-weight: 700 !important; }
.leaflet-control-zoom a:hover { background: var(--bg-4) !important; }
.leaflet-control-attribution { background: rgba(6,9,18,0.85) !important; color: var(--text-4) !important; font-size: 9px !important; }
.leaflet-popup-content-wrapper { background: var(--bg-3) !important; color: var(--text-0) !important; border-radius: var(--r-md) !important; border: 1px solid var(--border-2) !important; box-shadow: var(--shadow-md) !important; }
.leaflet-popup-tip { background: var(--bg-3) !important; }
.leaflet-popup-close-button { color: var(--text-3) !important; }

.truck-marker {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2.5px solid white; box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  font-size: 15px; font-weight: 700;
}
.order-marker-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2.5px solid var(--brand); background: rgba(245,197,24,0.35);
  box-shadow: 0 0 0 4px rgba(245,197,24,0.12);
  animation: pulseGlow 2.5s ease-in-out infinite;
}
.base-marker {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); border: 3px solid #fff;
  box-shadow: 0 0 0 5px rgba(245,197,24,0.18), 0 3px 12px rgba(0,0,0,0.5);
}
.base-marker svg { stroke: #000; }

/* ── Utilities ── */
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }
.text-xs { font-size: 0.72rem; }
.text-sm { font-size: 0.82rem; }
.text-brand { color: var(--brand); }
.text-muted { color: var(--text-3); }
.text-red { color: var(--red); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }

/* ═══════════ Google Places Autocomplete — Dark Theme ═══════════ */
.pac-container {
  background: #1a1f2e !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
  font-family: 'Inter', sans-serif !important;
  z-index: 10000 !important;
  margin-top: 4px !important;
}
.pac-container .pac-item {
  padding: 8px 14px !important;
  border-top: 1px solid rgba(255,255,255,0.05) !important;
  color: #e2e8f0 !important;
  font-size: 0.82rem !important;
  cursor: pointer !important;
  line-height: 1.4 !important;
}
.pac-container .pac-item:first-child { border-top: none !important; }
.pac-container .pac-item:hover,
.pac-container .pac-item.pac-item-selected {
  background: rgba(245,197,24,0.08) !important;
}
.pac-container .pac-item-query {
  color: #f1f5f9 !important;
  font-weight: 600 !important;
}
.pac-container .pac-icon { display: none !important; }
.pac-container .pac-matched { color: var(--brand) !important; font-weight: 700 !important; }
.pac-container::after { display: none !important; } /* Hide Google branding */

/* ═══════════ Google Maps InfoWindow — Dark Theme ═══════════ */
.gm-style .gm-style-iw-c {
  background: #1a1f2e !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 12px !important;
  padding: 8px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
}
.gm-style .gm-style-iw-d { overflow: auto !important; color: #e2e8f0 !important; }
.gm-style .gm-style-iw-tc::after { background: #1a1f2e !important; }
.gm-style .gm-ui-hover-effect {
  top: 2px !important; right: 2px !important;
  filter: invert(1) !important;
}
