/* ============================================================
   CAR DUTY CHECKER — STYLESHEET
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f5f0;
  --surface:   #ffffff;
  --surface-2: #f9f9f7;
  --border:    #e5e5e0;
  --text:      #1a1a18;
  --text-2:    #555550;
  --text-3:    #888882;
  --accent:    #1d6fd8;
  --accent-bg: #eaf0fb;
  --accent-t:  #1a5fba;
  --success:   #0f6e56;
  --success-bg:#e1f5ee;
  --warning:   #854f0b;
  --warning-bg:#faeeda;
  --danger:    #a32d2d;
  --danger-bg: #fcebeb;
  --radius:    8px;
  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.06);
  --font:      system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- NAV ---- */
.site-nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 900px; margin: 0 auto; padding: 0 1.25rem; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; color: var(--text); font-size: 15px; }
.nav-logo-icon { font-size: 20px; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-link { color: var(--text-2); text-decoration: none; font-size: 14px; }
.nav-link:hover { color: var(--text); }
.nav-wallet { text-decoration: none; font-size: 13px; }

/* ---- LAYOUT ---- */
.page { max-width: 900px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.page-narrow { max-width: 520px; }
.page-title { font-size: 22px; font-weight: 600; margin-bottom: 1.5rem; }

/* ---- CARDS ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 1rem; }

/* ---- GRID ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---- FORMS ---- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field input, .field select, .field textarea {
  height: 38px; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 10px; font-size: 14px; font-family: var(--font);
  background: var(--surface); color: var(--text);
  transition: border-color .15s;
}
.field textarea { height: auto; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,111,216,.12);
}
.field .help { font-size: 11px; color: var(--text-3); }
.field .err  { font-size: 12px; color: var(--danger); margin-top: 2px; }

/* ---- BUTTONS ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: background .15s, box-shadow .15s; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-t); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- BADGES ---- */
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 20px; }
.badge-blue    { background: var(--accent-bg); color: var(--accent-t); }
.badge-green   { background: var(--success-bg); color: var(--success); }
.badge-amber   { background: var(--warning-bg); color: var(--warning); }
.badge-red     { background: var(--danger-bg); color: var(--danger); }
.badge-muted   { background: var(--bg); color: var(--text-3); border: 1px solid var(--border); }

/* ---- ALERTS ---- */
.alert { border-radius: var(--radius); padding: .75rem 1rem; font-size: 14px; margin-bottom: 1rem; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info    { background: var(--accent-bg);  color: var(--accent-t); }

/* ---- METRIC CARDS ---- */
.metric { background: var(--surface-2); border-radius: var(--radius); padding: .85rem 1rem; }
.metric-label { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.metric-val   { font-size: 20px; font-weight: 600; }

/* ---- BREAKDOWN TABLE ---- */
.breakdown { width: 100%; border-collapse: collapse; font-size: 14px; }
.breakdown th { text-align: left; padding: 6px 0; font-size: 12px; color: var(--text-3); font-weight: 500; border-bottom: 1px solid var(--border); }
.breakdown td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.breakdown td:last-child { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.breakdown tr:last-child td { border-bottom: none; }
.breakdown .total-row td { font-weight: 700; padding-top: 12px; }

/* ---- TOTAL BLOCK ---- */
.total-block { background: var(--accent-bg); border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.total-label  { font-size: 13px; color: var(--accent-t); }
.total-amount { font-size: 26px; font-weight: 700; color: var(--accent); }

/* ---- STEP INDICATOR ---- */
.steps { display: flex; gap: 6px; margin-bottom: 1.25rem; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.step-dot.active { background: var(--accent); width: 22px; border-radius: 4px; }
.step-dot.done   { background: var(--success); }

/* ---- TABS ---- */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab  { padding: 10px 16px; font-size: 14px; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { background: var(--surface-2); padding: 8px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--bg); }

/* ---- PILL SELECTOR ---- */
.pill-group { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: .75rem; }
.pill { padding: 5px 13px; border-radius: 20px; font-size: 13px; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--text-2); }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.selected { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-t); font-weight: 500; }

/* ---- DIVIDER ---- */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }

/* ---- AUTH PAGES ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-box { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 1.5rem; font-size: 20px; font-weight: 700; }

/* ---- FOOTER ---- */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; }
.footer-inner { max-width: 900px; margin: 0 auto; padding: 1rem 1.25rem; font-size: 12px; color: var(--text-3); }

/* ---- LOADING BAR ---- */
.loading-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin: .5rem 0; }
.loading-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0; transition: width .35s ease; }

/* ---- CONFIDENCE ---- */
.conf-high { color: var(--success); }
.conf-med  { color: var(--warning); }
.conf-low  { color: var(--danger); }

/* ---- EMPTY STATE ---- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-3); }
.empty-icon { font-size: 36px; margin-bottom: .5rem; }

/* ---- SPACING UTILS ---- */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.text-muted { color: var(--text-3); font-size: 13px; }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 600; }
.w-full { width: 100%; }
