/* ================================================================
   TRUCK-LOG — 3D Glass / Shiny / Light Edition
   ================================================================ */

/* ── Theme defaults (overridden by theme.js <style> tag) ─────── */
:root {
  --accent:       #0891b2;
  --accent-dark:  #0e7490;
  --accent-light: #67e8f9;
  --ar: 8; --ag: 145; --ab: 178;
  --bg-base:      rgb(4,10,18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button, a, [onclick] { touch-action: manipulation; }
html, body { height: 100%; background: var(--bg-base); }

/* Prevent iOS from zooming on input focus (requires font-size >= 16px) */
input, textarea, select { font-size: 16px !important; }


/* ── Ambient background orbs — static, no filter:blur ────────── */
.ambient-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.orb { position: absolute; border-radius: 50%; }
.orb-1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(var(--ar),var(--ag),var(--ab),0.14) 0%, rgba(var(--ar),var(--ag),var(--ab),0.04) 50%, transparent 72%);
  top: -200px; left: -160px;
}
.orb-2 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(var(--ar),var(--ag),var(--ab),0.10) 0%, rgba(var(--ar),var(--ag),var(--ab),0.03) 50%, transparent 72%);
  bottom: 40px; right: -100px;
}
.orb-3 {
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(var(--ar),var(--ag),var(--ab),0.07) 0%, transparent 70%);
  top: 40%; left: 20%;
}

.pb-safe { padding-bottom: max(env(safe-area-inset-bottom,0px), 8px); }

@keyframes authSlideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-animate { animation: authSlideUp 0.32s ease-out both; }

/* ── Inputs ───────────────────────────────────────────────────── */
input, textarea, select {
  background-color: rgba(7,19,33,0.8) !important;
  color: #e0f2fe !important;
  border-color: rgba(var(--ar),var(--ag),var(--ab),0.3) !important;
  -webkit-appearance: none; appearance: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
input::placeholder, textarea::placeholder { color: rgba(71,85,105,0.9); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-light) !important;
  box-shadow: 0 0 0 3px rgba(var(--ar),var(--ag),var(--ab),0.12), 0 1px 0 rgba(255,255,255,0.04) inset !important;
}
input:-webkit-autofill, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px rgba(7,19,33,0.95) inset !important;
  -webkit-text-fill-color: #e0f2fe !important;
}
select option { background-color: rgb(7,19,33); color: #e0f2fe; }
::-webkit-scrollbar { width: 0; background: transparent; }

/* ── Form input ────────────────────────────────────────────────── */
.form-input {
  width: 100%;
  background: rgba(7,19,33,0.8);
  color: #e0f2fe;
  border: 1px solid rgba(var(--ar),var(--ag),var(--ab),0.28);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
}
.form-input:focus { border-color: var(--accent-light); outline: none; }

/* ── 3D Glass Card ────────────────────────────────────────────── */
.glass-card {
  background: linear-gradient(
    145deg,
    rgba(255,255,255,0.07) 0%,
    rgba(255,255,255,0.03) 50%,
    rgba(var(--ar),var(--ag),var(--ab),0.04) 100%
  );
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.12) inset,
    0 -1px 0 rgba(0,0,0,0.18) inset,
    0 16px 32px rgba(0,0,0,0.35),
    0 4px 12px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}
/* Shiny top-edge highlight */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  border-radius: 1px;
  pointer-events: none;
}
/* Gloss overlay — light from top-left */
.glass-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    150deg,
    rgba(255,255,255,0.055) 0%,
    rgba(255,255,255,0.01) 40%,
    transparent 60%
  );
  pointer-events: none;
}

/* ── Navigation — pinned bottom bar ──────────────────────────── */
.rl-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 0;
  border-radius: 20px 20px 0 0;
  padding: 6px 4px max(env(safe-area-inset-bottom, 12px), 12px);
  position: relative;

  /* layered glass background */
  background: linear-gradient(
    165deg,
    rgba(12,30,54,0.97) 0%,
    rgba(6,15,30,0.99) 60%,
    rgba(4,10,18,1) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  /* multi-layer box-shadow */
  box-shadow:
    0 1px 0 rgba(255,255,255,0.10) inset,
    0 -1px 0 rgba(0,0,0,0.35) inset,
    0 0 0 1px rgba(255,255,255,0.07),
    0 0 32px rgba(var(--ar),var(--ag),var(--ab),0.18),
    0 0 8px  rgba(var(--ar),var(--ag),var(--ab),0.10),
    0 20px 60px rgba(0,0,0,0.7),
    0 8px 24px rgba(0,0,0,0.5);

  border: 1px solid rgba(255,255,255,0.08);
}

/* Accent glow arc on top edge */
.rl-nav::before {
  content: '';
  position: absolute;
  top: -1px; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--ar),var(--ag),var(--ab),0.85), rgba(var(--ar),var(--ag),var(--ab),0.6), rgba(var(--ar),var(--ag),var(--ab),0.85), transparent);
  border-radius: 1px;
  pointer-events: none;
}

/* Inner top specular highlight */
.rl-nav::after {
  content: '';
  position: absolute;
  top: 0; left: 18%; right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  border-radius: 1px;
  pointer-events: none;
}

.nav-btn {
  transition: color 0.18s, filter 0.18s, transform 0.15s;
  min-width: 52px;
  position: relative;
  border-radius: 16px;
  padding: 8px 10px 6px;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
.nav-btn:active { transform: scale(0.92); }

/* Glow + background pill on active nav button */
.nav-btn.text-orange-600 {
  filter: drop-shadow(0 0 10px rgba(var(--ar),var(--ag),var(--ab),0.9));
  background: rgba(var(--ar),var(--ag),var(--ab),0.12);
}

/* Glowing dot indicator below active icon */
.nav-btn.text-orange-600::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 8px rgba(var(--ar),var(--ag),var(--ab),1),
    0 0 14px rgba(var(--ar),var(--ag),var(--ab),0.6),
    0 0 24px rgba(var(--ar),var(--ag),var(--ab),0.3);
}

/* ── Dashboard header ─────────────────────────────────────────── */
.dash-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(var(--ar),var(--ag),var(--ab),0.08) 0%, transparent 100%);
  position: relative;
}
.dash-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--ar),var(--ag),var(--ab),0.3), transparent);
}

/* ── Hero revenue card ────────────────────────────────────────── */
.dash-hero-card {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 35%, var(--accent-dark) 65%, #1e3a5f 100%);
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12),
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 -1px 0 rgba(0,0,0,0.3) inset,
    0 20px 60px rgba(var(--ar),var(--ag),var(--ab),0.3),
    0 8px 20px rgba(0,0,0,0.4);
}
/* Static diagonal highlight — no animation */
.dash-hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.10) 0%,
    transparent 50%
  );
  pointer-events: none;
  border-radius: inherit;
}
/* Top specular highlight edge */
.dash-hero-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.5) 30%, rgba(255,255,255,0.5) 70%, transparent 95%);
}

/* ── Trip row in dashboard ────────────────────────────────────── */
.trip-row-dash {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.trip-row-dash:last-child { border-bottom: none; }
.trip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Settings header ──────────────────────────────────────────── */
.settings-header {
  padding: 12px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(var(--ar),var(--ag),var(--ab),0.08) 0%, transparent 100%);
  position: relative;
}
.settings-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--ar),var(--ag),var(--ab),0.3), transparent);
}
.settings-back-btn { color: rgba(148,163,184,0.8); padding: 4px; }

/* ── Save FAB ─────────────────────────────────────────────────── */
.save-fab {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  padding: 7px 18px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(var(--ar),var(--ag),var(--ab),0.4), 0 1px 0 rgba(255,255,255,0.2) inset;
}

/* ── Section labels ───────────────────────────────────────────── */
.settings-section-label {
  font-size: 0.6rem; font-weight: 900;
  letter-spacing: 2.5px; text-transform: uppercase;
  margin-bottom: 14px;
  position: relative;
}

/* ── Settings field ───────────────────────────────────────────── */
.settings-field { margin-bottom: 12px; }
.settings-label {
  display: block; font-size: 0.75rem; font-weight: 600;
  color: rgba(148,163,184,0.85); margin-bottom: 5px;
}
.settings-hint {
  font-size: 0.7rem; color: rgba(71,85,105,0.9);
  margin-top: 4px; line-height: 1.4;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff; font-weight: 700;
  padding: 0.625rem 1.25rem;
  border-radius: 12px; width: 100%; font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(var(--ar),var(--ag),var(--ab),0.35), 0 1px 0 rgba(255,255,255,0.15) inset;
}
.btn-ghost {
  color: rgba(148,163,184,0.8); font-weight: 600;
  padding: 0.625rem 1.25rem; width: 100%; font-size: 0.875rem;
}

.settings-action-btn {
  display: block;
  background: rgba(var(--ar),var(--ag),var(--ab),0.12);
  color: var(--accent-light);
  border: 1px solid rgba(var(--ar),var(--ag),var(--ab),0.25);
  font-weight: 700; padding: 11px 16px;
  border-radius: 12px; font-size: 0.84rem; text-align: center;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset;
  transition: background 0.15s, box-shadow 0.15s;
}
.settings-action-btn:active { background: rgba(var(--ar),var(--ag),var(--ab),0.22); }

.settings-ghost-btn {
  display: block;
  background: rgba(255,255,255,0.04);
  color: rgba(148,163,184,0.8);
  border: 1px solid rgba(255,255,255,0.07);
  font-weight: 600; padding: 11px 16px;
  border-radius: 12px; font-size: 0.84rem; text-align: center;
}
.settings-signout-btn {
  display: block;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(148,163,184,0.6);
  font-weight: 700; padding: 13px 16px;
  border-radius: 14px; font-size: 0.875rem;
}

/* ── Save button ──────────────────────────────────────────────── */
.save-btn-full {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 50%, var(--accent-dark) 100%);
  color: #fff; font-weight: 800;
  padding: 15px; border-radius: 16px;
  font-size: 0.95rem; letter-spacing: 0.5px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12),
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 8px 24px rgba(var(--ar),var(--ag),var(--ab),0.35);
  margin-top: 8px;
}

/* ── Toggle switch ────────────────────────────────────────────── */
.toggle-row {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; position: relative;
}
.toggle-label { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.toggle-checkbox { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 46px; height: 27px; flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; position: relative;
  transition: background 0.25s, box-shadow 0.25s;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset;
}
.toggle-track::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: linear-gradient(135deg, #e0f2fe, rgba(255,255,255,0.8));
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.toggle-checkbox:checked + .toggle-track {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  box-shadow: 0 0 10px rgba(var(--ar),var(--ag),var(--ab),0.5), 0 1px 0 rgba(255,255,255,0.1) inset;
}
.toggle-checkbox:checked + .toggle-track::after { transform: translateX(19px); }

/* ── Cost summary grid ────────────────────────────────────────── */
.cost-summary-grid {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px; padding: 12px;
  display: flex; gap: 0; margin-top: 4px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
.cost-summary-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding: 0 4px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.cost-summary-item:last-child { border-right: none; }
.cost-summary-label { font-size: 0.6rem; color: rgba(100,116,139,0.8); text-align: center; }
.cost-summary-val { font-size: 0.85rem; font-weight: 800; text-align: center; }

/* ── DVIR states ──────────────────────────────────────────────── */
.dvir-ok     { background: rgba(21,128,61,0.15); border-color: rgba(21,128,61,0.4); }
.dvir-defect { background: rgba(var(--ar),var(--ag),var(--ab),0.15); border-color: rgba(var(--ar),var(--ag),var(--ab),0.4); }
.dvir-blank  { background: rgba(15,23,42,0.6);   border-color: rgba(51,65,85,0.4); }

/* ── Detention timer pulse ────────────────────────────────────── */
@keyframes pulse-cyan {
  0%,100% { opacity: 1; text-shadow: 0 0 0 transparent; }
  50%     { opacity: 0.65; text-shadow: 0 0 12px rgba(var(--ar),var(--ag),var(--ab),0.6); }
}
.timer-active { animation: pulse-cyan 2s ease-in-out infinite; }

/* ── Receipt ──────────────────────────────────────────────────── */
.receipt-cap-label {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  background: rgba(7,19,33,0.7); border: 1.5px dashed rgba(51,65,85,0.7);
  border-radius: 12px; padding: 0.75rem; cursor: pointer;
  color: rgba(100,116,139,0.9); font-size: 0.875rem;
  transition: border-color 0.15s, color 0.15s;
}
.receipt-cap-label:active { border-color: var(--accent-light); color: var(--accent-light); }
.receipt-preview { width: 100%; border-radius: 10px; border: 1px solid rgba(51,65,85,0.5); display: block; max-height: 200px; object-fit: contain; background: rgb(7,19,33); }
.receipt-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; cursor: pointer; border: 1px solid rgba(51,65,85,0.5); flex-shrink: 0; }
.scan-state { font-size: 0.7rem; text-align: center; color: var(--accent-light); padding: 0.25rem 0; margin-top: 4px; }

/* ── DVIR section dividers ────────────────────────────────────── */
.dvir-section-header {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(100,116,139,0.8); font-weight: 800; padding: 0.75rem 0 0.25rem;
  border-top: 1px solid rgba(15,23,42,0.8); margin-top: 0.5rem;
}
.dvir-section-header.first { border-top: none; padding-top: 0; margin-top: 0; }

/* ── Tax screen ───────────────────────────────────────────────── */
.tax-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.875rem;
}
.tax-bar-wrap { background: rgba(15,23,42,0.8); border-radius: 9999px; height: 5px; overflow: hidden; }
.tax-bar { background: linear-gradient(90deg, var(--accent), var(--accent-light)); height: 5px; border-radius: 9999px; transition: width 0.5s ease; box-shadow: 0 0 8px rgba(var(--ar),var(--ag),var(--ab),0.5); }

/* ── Filter pills ─────────────────────────────────────────────── */
.filter-pill {
  font-size: 0.72rem; font-weight: 700; padding: 0.28rem 0.85rem;
  border-radius: 9999px; border: 1px solid rgba(51,65,85,0.5);
  color: rgba(148,163,184,0.8); background: transparent; white-space: nowrap;
  transition: all 0.15s;
}
.filter-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent; color: #fff;
  box-shadow: 0 0 12px rgba(var(--ar),var(--ag),var(--ab),0.4);
}

/* ── Location button ──────────────────────────────────────────── */
.loc-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; color: var(--accent-light); padding: 3px 7px;
  border: 1px solid rgba(var(--ar),var(--ag),var(--ab),0.35); border-radius: 0.4rem;
  white-space: nowrap; font-weight: 700;
}
.loc-btn:disabled { opacity: 0.5; }

/* ── Active nav icon color follows accent ─────────────────────── */
.nav-btn.text-orange-600 { color: var(--accent-light) !important; }

/* ── Theme color swatches ─────────────────────────────────────── */
.color-swatch {
  width: 34px; height: 34px; border-radius: 50%;
  flex-shrink: 0; transition: transform 0.15s, outline-offset 0.15s;
}
.color-swatch:active { transform: scale(0.88); }
.color-swatch.selected {
  outline: 3px solid rgba(255,255,255,0.6);
  outline-offset: 2px;
}

.bg-swatch {
  padding: 5px 12px; border-radius: 16px;
  font-size: 0.72rem; font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.bg-swatch.selected {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.3) !important;
  color: #fff !important;
}
