/* =========================================================
   RapidRecover UK — Glassmorphism theme
   ========================================================= */
:root {
  --bg-1: #070b1f;
  --bg-2: #141b4d;
  --accent: #ffb020;          /* recovery amber */
  --accent-2: #ff6b3d;
  --cyan: #38d6ff;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.13);
  --glass-border: rgba(255, 255, 255, 0.18);
  --text: #eef1ff;
  --muted: rgba(238, 241, 255, 0.68);
  --radius: 22px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html, body { min-height: 100%; }
html { background: var(--bg-1); }
body {
  font-family: var(--bs-body-font-family);
  color: var(--text);
  background: transparent;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(1200px 700px at 10% -10%, #2b1f6b 0%, transparent 60%),
              radial-gradient(900px 600px at 110% 10%, #0f4a6b 0%, transparent 55%),
              linear-gradient(160deg, var(--bg-1), var(--bg-2));
}

/* Floating blurred orbs behind the glass */
.bg-orbs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 22s ease-in-out infinite; }
.bg-orbs span:nth-child(1) { width: 420px; height: 420px; background: #ff9f1c; top: 8%; left: -120px; opacity: .28; }
.bg-orbs span:nth-child(2) { width: 520px; height: 520px; background: #4d5bff; bottom: -160px; right: -120px; animation-delay: -7s; }
.bg-orbs span:nth-child(3) { width: 300px; height: 300px; background: #12c2e9; top: 45%; left: 45%; opacity: .25; animation-delay: -14s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-30px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .bg-orbs span { animation: none; } }

/* ---------- Glass primitives ---------- */
.glass, .glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.glass-card { padding: 1.5rem; }
@media (min-width: 992px) { .glass-card { padding: 2rem; } }
.glass-card.tight { padding: 1.1rem; }

.glass-nav {
  background: rgba(10, 14, 40, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.glass-nav .nav-link { color: var(--muted); border-radius: 12px; padding: .5rem .85rem !important; }
.glass-nav .nav-link:hover, .glass-nav .nav-link.active { color: #fff; background: rgba(255,255,255,.08); }
.brand-mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1030; font-size: 1.1rem;
  box-shadow: 0 6px 18px -6px rgba(255,140,40,.7);
}
.user-chip { font-size: .85rem; padding: .35rem .75rem; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--glass-border); white-space: nowrap; }

.text-muted-2 { color: var(--muted) !important; }
.text-accent { color: var(--accent) !important; }
.fw-800 { font-weight: 800; }
h1, h2, h3, .h1, .h2, .h3 { letter-spacing: -0.02em; }
.display-hero { font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.gradient-text { background: linear-gradient(90deg, #fff, var(--accent) 60%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Buttons ---------- */
.btn { border-radius: 14px; font-weight: 600; }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1b1030; border: 0;
  box-shadow: 0 10px 24px -10px rgba(255,120,40,.8);
}
.btn-accent:hover, .btn-accent:focus { color: #1b1030; filter: brightness(1.07); transform: translateY(-1px); }
.btn-glass { background: rgba(255,255,255,.1); color: #fff; border: 1px solid var(--glass-border); backdrop-filter: blur(10px); }
.btn-glass:hover { background: rgba(255,255,255,.18); color: #fff; }
.btn-xl { padding: 1rem 1.25rem; font-size: 1.15rem; border-radius: 18px; }
.btn-demo { text-align: left; }
.btn-demo small { display: block; font-weight: 400; opacity: .7; font-size: .75rem; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  background-color: rgba(255,255,255,.07); border: 1px solid var(--glass-border); color: #fff; border-radius: 14px; padding: .7rem .95rem;
}
.form-control:focus, .form-select:focus { background-color: rgba(255,255,255,.12); color: #fff; border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(255,176,32,.2); }
.form-control::placeholder { color: rgba(255,255,255,.4); }
.form-select option { background: #151a3d; color: #fff; }
.form-label { font-weight: 600; font-size: .9rem; color: var(--muted); }
.input-group-text { background: rgba(255,255,255,.07); border-color: var(--glass-border); color: var(--muted); border-radius: 14px; }
.invalid-feedback { display: block; }
.reg-plate {
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif; text-transform: uppercase; letter-spacing: .08em; font-weight: 900;
  background: #f6d33c !important; color: #111 !important; border: 2px solid #111 !important; text-align: center;
}
.reg-plate::placeholder { color: rgba(0,0,0,.35) !important; }
.plate { display: inline-block; font-family: 'Arial Black', sans-serif; font-weight: 900; letter-spacing: .06em; background: #f6d33c; color: #111; border-radius: 6px; padding: .1rem .5rem; font-size: .85rem; border: 1px solid #111; }
.plate.white { background: #fff; }

/* ---------- Alerts / toasts ---------- */
.alert-glass { backdrop-filter: blur(12px); border-radius: 16px; border: 1px solid var(--glass-border); }
.alert-glass.alert-success { background: rgba(32,201,151,.18); color: #c8ffe9; }
.alert-glass.alert-danger  { background: rgba(255,82,82,.18); color: #ffd6d6; }
.alert-glass.alert-warning { background: rgba(255,176,32,.18); color: #ffe9bd; }
.alert-glass.alert-info    { background: rgba(56,214,255,.15); color: #d4f6ff; }
.toast { background: rgba(20,24,60,.85); backdrop-filter: blur(14px); color: #fff; border: 1px solid var(--glass-border); border-radius: 14px; }

/* ---------- Status badges ---------- */
.status-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pending   { background: rgba(255,176,32,.16); color: #ffc65c; border-color: rgba(255,176,32,.35); }
.status-pending::before { animation: pulse 1.4s infinite; }
.status-accepted  { background: rgba(56,214,255,.14); color: #7fe3ff; border-color: rgba(56,214,255,.35); }
.status-en-route  { background: rgba(120,110,255,.18); color: #b7b0ff; border-color: rgba(120,110,255,.4); }
.status-on-scene  { background: rgba(255,107,61,.18); color: #ffa585; border-color: rgba(255,107,61,.4); }
.status-completed { background: rgba(32,201,151,.16); color: #6ff0c6; border-color: rgba(32,201,151,.35); }
.status-cancelled { background: rgba(255,255,255,.08); color: #b9bdd6; border-color: rgba(255,255,255,.18); }
.status-pending-approval { background: rgba(255,176,32,.16); color: #ffc65c; border-color: rgba(255,176,32,.35); }
.status-approved  { background: rgba(32,201,151,.16); color: #6ff0c6; border-color: rgba(32,201,151,.35); }
.status-rejected  { background: rgba(255,82,82,.16); color: #ff9c9c; border-color: rgba(255,82,82,.35); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- Tables ---------- */
.table-glass { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: rgba(255,255,255,.08); --bs-table-hover-bg: rgba(255,255,255,.04); margin: 0; }
.table-glass th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; white-space: nowrap; }
.table-glass td { vertical-align: middle; }

/* ---------- Stats ---------- */
.stat { padding: 1.1rem 1.25rem; }
.stat .num { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; background: rgba(255,255,255,.08); }

/* ---------- Maps ---------- */
.map { height: 380px; border-radius: 18px; overflow: hidden; border: 1px solid var(--glass-border); z-index: 0; }
.map.tall { height: 460px; }
.map.short { height: 240px; }
.leaflet-container { background: #1c2347; font-family: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: rgba(20,24,60,.95); color: #fff; }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-control-attribution { background: rgba(10,14,40,.7) !important; color: #aab !important; }
.leaflet-control-attribution a { color: #ccd !important; }
.pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 6px 14px rgba(0,0,0,.45); }
.pin i { transform: rotate(45deg); color: #fff; font-size: 15px; }
.pin.pickup { background: #ff5b3d; } .pin.dropoff { background: #20c997; } .pin.driver { background: #4d5bff; border-radius: 50%; }
.pin.driver::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid #4d5bff; animation: ring 1.8s infinite; }
@keyframes ring { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.geo-results { position: absolute; z-index: 1050; left: 0; right: 0; top: 100%; margin-top: .3rem; max-height: 260px; overflow: auto; background: rgba(18,22,55,.97); border: 1px solid var(--glass-border); border-radius: 14px; }
.geo-results button { display: block; width: 100%; text-align: left; background: none; border: 0; color: #fff; padding: .6rem .9rem; font-size: .9rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.geo-results button:hover { background: rgba(255,255,255,.08); }
.map-hint { position: absolute; z-index: 500; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(10,14,40,.85); padding: .4rem .9rem; border-radius: 999px; font-size: .82rem; pointer-events: none; white-space: nowrap; }

/* ---------- Login ---------- */
.auth-wrap { max-width: 980px; margin: 0 auto; }
.auth-side { background: linear-gradient(150deg, rgba(255,176,32,.18), rgba(77,91,255,.18)); }

/* ---------- Timeline ---------- */
.steps { display: flex; justify-content: space-between; position: relative; margin: 1.5rem 0 .5rem; }
.steps::before { content: ''; position: absolute; top: 19px; left: 6%; right: 6%; height: 3px; background: rgba(255,255,255,.12); border-radius: 3px; }
.steps .bar { position: absolute; top: 19px; left: 6%; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; transition: width .6s ease; }
.step { position: relative; z-index: 1; text-align: center; flex: 1; }
.step .dot { width: 40px; height: 40px; margin: 0 auto .4rem; border-radius: 50%; display: grid; place-items: center; background: #1a2050; border: 2px solid rgba(255,255,255,.2); color: var(--muted); transition: all .3s; }
.step.done .dot { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #1b1030; }
.step.current .dot { box-shadow: 0 0 0 6px rgba(255,176,32,.2); }
.step .lbl { font-size: .75rem; color: var(--muted); font-weight: 600; }
.step.done .lbl { color: #fff; }

.token-display { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 800; letter-spacing: .08em; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.token-input { font-family: ui-monospace, Menlo, monospace; font-size: 1.4rem; text-transform: uppercase; letter-spacing: .1em; text-align: center; }

/* ---------- Driver job cards ---------- */
.job-card { border-radius: 18px; padding: 1.1rem; background: rgba(255,255,255,.06); border: 1px solid var(--glass-border); transition: transform .2s, border-color .2s; }
.job-card:hover { border-color: rgba(255,176,32,.45); }
.job-card.new { animation: glow 1.5s ease 2; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(255,176,32,.35); } }
.job-card .route-line { border-left: 2px dashed rgba(255,255,255,.25); margin-left: 7px; padding-left: 1rem; }
.kv { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #20c997; box-shadow: 0 0 0 0 rgba(32,201,151,.6); animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgba(32,201,151,0); } 100% { box-shadow: 0 0 0 0 rgba(32,201,151,0); } }

.nav-pills.glass-tabs .nav-link { color: var(--muted); border-radius: 12px; font-weight: 600; }
.nav-pills.glass-tabs .nav-link.active { background: rgba(255,255,255,.14); color: #fff; }

.doc-thumb { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .6rem; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid var(--glass-border); color: #fff; text-decoration: none; font-size: .8rem; }
.doc-thumb:hover { background: rgba(255,255,255,.15); color: #fff; }

.feature-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; background: linear-gradient(135deg, rgba(255,176,32,.25), rgba(255,107,61,.25)); color: var(--accent); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty i { font-size: 2.4rem; display: block; margin-bottom: .5rem; opacity: .6; }

/* Mobile tweaks — driver portal is used on phones */
@media (max-width: 575.98px) {
  main.container { padding-left: 14px; padding-right: 14px; }
  .glass-card { padding: 1.1rem; border-radius: 18px; }
  .map { height: 300px; }
  .step .lbl { font-size: .65rem; }
  .step .dot { width: 34px; height: 34px; }
  .steps::before, .steps .bar { top: 16px; }
}

/* ---------- Public jobs board ---------- */
.board-wrap.is-locked { min-height: 460px; }
.board-wrap.is-locked #board { filter: blur(7px) saturate(.8); opacity: .75; pointer-events: none; user-select: none; }
.board-overlay { position: absolute; inset: 0; z-index: 5; display: flex; justify-content: center; align-items: flex-start; padding: 2.5rem 1rem; }
.board-overlay .glass-card { background: rgba(14, 18, 48, .72); }
.ph { display: block; height: 10px; border-radius: 6px; background: rgba(255,255,255,.18); margin: .55rem 0; }
[hidden] { display: none !important; }
@media (max-width: 575.98px) {
  .stat { padding: .85rem .9rem; }
  .stat .num { font-size: 1.6rem; }
  .stat .lbl { font-size: .66rem; letter-spacing: .03em; }
  .board-overlay { padding: 1.25rem .25rem; }
}
