/* =========================================================================
   FVST Express — Driver app mockup stylesheet
   Static, presentation-only. Shared across every page in /mockup-driver.
   Mobile-width surface. Reuses the admin mockup's color system (/mockup)
   for cross-app visual consistency — see queue item on this.
   ========================================================================= */

:root {
  --color-bg: #10131a;
  --color-surface: #1a1e28;
  --color-surface-alt: #212633;
  --color-border: #2b3140;
  --color-border-strong: #3a4152;
  --color-text: #e8eaf0;
  --color-text-muted: #9aa3b5;
  --color-text-faint: #6d7688;

  --color-accent: #5b8bf5;
  --color-accent-hover: #7ba0f7;
  --color-accent-soft: #1e2c4d;

  --color-success: #3ec97a;
  --color-success-soft: #16301f;
  --color-warning: #e0a63e;
  --color-warning-soft: #3a2c11;
  --color-danger: #f0685c;
  --color-danger-soft: #3d1f1c;
  --color-neutral-soft: #262c3a;
  --color-purple: #b299f5;
  --color-purple-soft: #2a2545;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --phone-width: 390px;
  --topbar-height: 52px;
  --bottomnav-height: 58px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: #05060a;
  color: var(--color-text);
  font-size: 14.5px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 4px; font-weight: 600; }
h1 { font-size: 1.2rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }
p { margin: 0 0 8px; color: var(--color-text-muted); }

/* =========================================================================
   Phone frame — centers a fixed mobile-width surface in the browser
   ========================================================================= */

.phone-frame-wrap {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 12px;
  background:
    radial-gradient(circle at 20% 10%, #171b26 0%, #05060a 55%);
}

.phone-frame {
  width: var(--phone-width);
  max-width: 100%;
  min-height: 780px;
  background: var(--color-bg);
  border-radius: 32px;
  border: 6px solid #000;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px calc(var(--bottomnav-height) + 20px);
}

/* =========================================================================
   Top bar
   ========================================================================= */

.driver-topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.topbar-icon-btn {
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 18px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.topbar-icon-btn:hover { background: var(--color-surface-alt); }

.topbar-title { font-size: 1.02rem; font-weight: 700; margin: 0; }

.online-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}
.online-toggle .switch {
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: var(--color-border-strong);
  position: relative;
  transition: background 0.15s;
}
.online-toggle .switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}
.online-toggle.is-online .switch { background: var(--color-success); }
.online-toggle.is-online .switch::after { left: 17px; }
.online-toggle.is-online .online-toggle-label::before { content: "Online"; }
.online-toggle:not(.is-online) .online-toggle-label::before { content: "Offline"; }

/* =========================================================================
   Segmented control (Today / All / Unassigned)
   ========================================================================= */

.segmented {
  display: flex;
  gap: 4px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 3px;
  margin: 12px 14px 4px;
}
.segmented button {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.segmented button.active {
  background: var(--color-accent);
  color: #fff;
}

.view-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 0;
}
.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 3px;
}
.view-toggle button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.view-toggle button.active { background: var(--color-accent); color: #fff; }

/* =========================================================================
   Task list / task cards
   ========================================================================= */

.task-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.task-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
}
.task-card:hover { border-color: var(--color-border-strong); }

.task-dir-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: #fff;
}
.task-dir-icon.pickup { background: var(--color-accent); }
.task-dir-icon.dropoff { background: var(--color-purple); }
.task-dir-icon.urgent { background: var(--color-warning); }

.task-card-body { flex: 1; min-width: 0; }
.task-card-addr { font-weight: 700; font-size: 13.5px; }
.task-card-order { font-size: 11px; color: var(--color-text-faint); font-family: ui-monospace, monospace; }
.task-card-sub { font-size: 12px; color: var(--color-text-muted); margin-top: 1px; }
.task-card-time { font-size: 11.5px; color: var(--color-text-faint); margin-top: 3px; }
.task-card-chevron { color: var(--color-text-faint); font-size: 16px; margin-top: 4px; }

.task-card-consolidated {
  display: inline-block;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 1px 6px;
  border-radius: 999px;
}

/* =========================================================================
   Map placeholder
   ========================================================================= */

.driver-map-placeholder {
  position: relative;
  margin-top: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background:
    linear-gradient(135deg, #1c2130 0%, #14171f 100%);
  height: 460px;
  overflow: hidden;
}
.driver-map-caption {
  position: absolute;
  bottom: 10px; left: 10px; right: 10px;
  text-align: center;
  font-size: 11.5px;
  color: var(--color-text-faint);
  background: rgba(10,12,18,0.7);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.map-pin-driver {
  position: absolute;
  display: block;
  width: 14px; height: 14px;
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -100%) rotate(-45deg);
  border: 2px solid #0a0c12;
  cursor: pointer;
}
.map-pin-driver.pickup { background: var(--color-accent); }
.map-pin-driver.dropoff { background: var(--color-purple); }
.map-pin-driver.unassigned { background: var(--color-text-faint); cursor: default; }

/* =========================================================================
   Bottom tab nav
   ========================================================================= */

.bottom-nav {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--bottomnav-height);
  display: flex;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-faint);
  font-size: 10.5px;
  font-weight: 600;
}
.bottom-nav a .nav-icon { font-size: 18px; }
.bottom-nav a.active { color: var(--color-accent); }

/* =========================================================================
   Task detail — header, info cards, status stepper
   ========================================================================= */

.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}
.detail-header .back-btn {
  background: none; border: none; color: var(--color-text);
  font-size: 20px; cursor: pointer; padding: 4px;
}
.detail-header-title { flex: 1; min-width: 0; }
.detail-header-title h1 { font-size: 1.05rem; margin: 0; }
.detail-header-order { font-size: 11px; color: var(--color-text-faint); font-family: ui-monospace, monospace; }

.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 10px;
}
.info-card h3 { margin-bottom: 8px; }
.info-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 4px 0; }
.info-row .info-label { color: var(--color-text-faint); }
.info-row .info-value { text-align: right; color: var(--color-text); }

.status-stepper { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  padding-bottom: 18px;
}
.step:last-child { padding-bottom: 0; }
.step-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  border: 2px solid var(--color-border-strong);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  z-index: 1;
}
.step.done .step-dot { background: var(--color-success); border-color: var(--color-success); color: #06210f; }
.step.current .step-dot { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 9px; top: 20px; bottom: 0;
  width: 2px;
  background: var(--color-border-strong);
}
.step.done:not(:last-child)::before { background: var(--color-success); }
.step-label { font-size: 12.5px; font-weight: 600; padding-top: 1px; }
.step-meta { font-size: 11px; color: var(--color-text-faint); }

.action-row { display: flex; gap: 8px; margin-top: 12px; }
.action-row .btn { flex: 1; }

/* =========================================================================
   Buttons / badges (subset of admin system, reused verbatim)
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface-alt);
  color: var(--color-text);
  cursor: pointer;
}
.btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary { background: var(--color-surface-alt); }
.btn-secondary:hover { background: var(--color-neutral-soft); }
.btn-danger { background: var(--color-danger-soft); border-color: var(--color-danger); color: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 11.5px; }

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge-accent { background: var(--color-accent-soft); color: var(--color-accent-hover); }
.badge-success { background: var(--color-success-soft); color: var(--color-success); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-neutral { background: var(--color-neutral-soft); color: var(--color-text-muted); }

.text-faint { color: var(--color-text-faint); }
.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }

/* =========================================================================
   Forms (photo capture, failure reason, etc.)
   ========================================================================= */

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); margin-bottom: 4px; }
.form-group select, .form-group textarea, .form-group input[type="text"] {
  width: 100%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font);
}
.form-group textarea { min-height: 70px; resize: vertical; }
.form-help { font-size: 11px; color: var(--color-text-faint); margin: 4px 0 0; }

.toggle-group { display: flex; gap: 6px; }
.toggle-group button {
  flex: 1;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.toggle-group button.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

.photo-upload-row { display: flex; gap: 8px; margin-bottom: 10px; }
.photo-upload-row .btn { flex: 1; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
  border: 1px dashed var(--color-border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--color-text-faint);
  position: relative;
}
.photo-thumb.filled { border-style: solid; background: var(--color-neutral-soft); }
.photo-thumb .remove-photo {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,0.6);
  border: none; color: #fff; border-radius: 50%;
  width: 18px; height: 18px; font-size: 11px; line-height: 1;
  cursor: pointer;
}

.offline-note {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--color-warning);
  background: var(--color-warning-soft);
  padding: 6px 8px; border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.alert {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12px;
  margin: 10px 0;
  border: 1px solid transparent;
}
.alert-info { background: var(--color-accent-soft); color: var(--color-accent-hover); border-color: var(--color-accent); }
.alert-warning { background: var(--color-warning-soft); color: var(--color-warning); border-color: var(--color-warning); }
.alert-danger { background: var(--color-danger-soft); color: var(--color-danger); border-color: var(--color-danger); }
.alert-success { background: var(--color-success-soft); color: var(--color-success); border-color: var(--color-success); }

/* =========================================================================
   Login
   ========================================================================= */

.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--color-accent); color: #fff; font-weight: 800; font-size: 18px;
  margin-bottom: 10px;
}

/* =========================================================================
   Stat row (profile / working hours)
   ========================================================================= */

.stat-row { display: flex; gap: 8px; margin-top: 10px; }
.stat-box {
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}
.stat-box .stat-value { font-size: 1.3rem; font-weight: 700; }
.stat-box .stat-label { font-size: 10.5px; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }

.placeholder-block {
  margin-top: 60px;
  text-align: center;
  color: var(--color-text-faint);
  font-size: 12.5px;
}
.placeholder-block .placeholder-icon { font-size: 34px; margin-bottom: 10px; display: block; }
