/* ============================================================
   calculator.css — Import Tax Calculator (Light theme)
   Design: Deep Navy + Amber + clean whites
   ============================================================ */

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --navy:       #1e3a5f;
  --navy-dim:   #152d4a;
  --amber:      #f59e0b;
  --amber-dim:  #d97706;
  --emerald:    #10b981;
  --rose:       #ef4444;
  --sky:        #0ea5e9;
  --bg:         #f8fafc;
  --bg-card:    #ffffff;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --text-muted: #64748b;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 4px 20px rgba(0,0,0,.1);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.15);
  --radius:     12px;
  --radius-sm:  8px;
  --font:       'Inter', system-ui, sans-serif;
  --transition: .18s ease;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); }
input, select { font-family: var(--font); }

/* ── Header ──────────────────────────────────────────────── */
.c-header {
  background: var(--navy);
  color: #fff;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.c-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.c-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
}
.c-logo em { color: var(--amber); font-style: normal; }
.c-nav { display: flex; gap: .5rem; }
.c-nav-link {
  font-size: .82rem;
  color: rgba(255,255,255,.7);
  padding: .35rem .75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.c-nav-link:hover { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.c-nav-link.active { color: var(--amber); background: rgba(245,158,11,.15); }

/* ── Disclaimer ──────────────────────────────────────────── */
.c-disclaimer {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: .78rem;
  padding: .5rem 1.5rem;
  text-align: center;
  line-height: 1.6;
}
.c-disclaimer strong { color: #78350f; }
.c-disclaimer a { color: var(--sky); }

/* ── Hero / Step 1 ───────────────────────────────────────── */
.c-hero {
  max-width: 760px;
  margin: 3rem auto 2rem;
  padding: 0 1.5rem;
  text-align: center;
}
.c-hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.03em;
  margin-bottom: .5rem;
}
.c-hero-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Search box */
.c-search-box {
  position: relative;
  margin-bottom: 2rem;
}
.c-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
}
.c-search-input {
  width: 100%;
  padding: 1rem 3rem 1rem 3rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.c-search-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(30,58,95,.1);
}
.c-search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Category chips */
.c-cats-label {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.c-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 2rem;
}
.c-cat {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: .45rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.c-cat:hover, .c-cat.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

/* Search results */
.c-results {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1rem;
}
.c-result-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.c-result-card:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow);
}
.c-result-emoji { font-size: 1.8rem; }
.c-result-info { flex: 1; min-width: 0; }
.c-result-name { font-weight: 600; font-size: .95rem; color: var(--text); }
.c-result-hs { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }
.c-result-rates { margin-top: .35rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.c-rate-pill {
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 4px;
  border: 1px solid;
}
.c-rate-pill--cd   { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.c-rate-pill--pal  { color: #7c3aed; border-color: #c4b5fd; background: #f5f3ff; }
.c-rate-pill--vat  { color: #0369a1; border-color: #93c5fd; background: #eff6ff; }
.c-rate-pill--cess { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.c-rate-pill--free { color: #059669; border-color: #6ee7b7; background: #ecfdf5; }
.c-select-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .5rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition);
}
.c-select-btn:hover { background: var(--navy-dim); }
.c-no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: .9rem;
}

/* ── Step panels ─────────────────────────────────────────── */
.c-step-panel { padding: 0 1.5rem 3rem; }
.c-step-wrap {
  max-width: 700px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.c-back-btn {
  align-self: flex-start;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .4rem .9rem;
  font-size: .85rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.c-back-btn:hover { border-color: var(--navy); color: var(--navy); }

/* Selected product banner */
.c-selected-product {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 600;
}
.c-selected-product em { color: var(--amber); font-style: normal; font-size: .8rem; font-weight: 400; }

/* Step title */
.c-step-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}

/* CIF form */
.c-cif-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) { .c-cif-grid { grid-template-columns: 1fr; } }

.c-field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.c-field span:first-child { color: var(--text); font-weight: 600; }
.c-input-row {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.c-input {
  flex: 1;
  padding: .6rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--transition);
}
.c-input:focus { outline: none; border-color: var(--navy); }
.c-select {
  padding: .6rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  background: var(--bg-card);
  color: var(--text);
}
.c-select:focus { outline: none; border-color: var(--navy); }
.c-currency-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 44px;
}
.c-refresh-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .7rem;
  font-size: .9rem;
  transition: var(--transition);
}
.c-refresh-btn:hover { border-color: var(--navy); }
.c-fx-note { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }

/* CIF preview strip */
.c-cif-preview {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.c-cif-preview-item { display: flex; flex-direction: column; gap: .1rem; }
.c-cif-preview-item span { font-size: .72rem; color: var(--text-muted); }
.c-cif-preview-item strong { font-size: 1.1rem; font-weight: 700; color: var(--navy); }

/* Calculate button */
.c-calc-btn {
  background: var(--amber);
  color: #78350f;
  border: none;
  border-radius: 50px;
  padding: .9rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition);
  align-self: flex-start;
}
.c-calc-btn:hover:not(:disabled) { background: var(--amber-dim); transform: translateY(-1px); }
.c-calc-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Results ─────────────────────────────────────────────── */
.c-total-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #2d5a8e 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.c-total-label {
  font-size: .72rem;
  letter-spacing: .1em;
  font-weight: 700;
  opacity: .7;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.c-total-amount {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: #fff;
}
.c-total-usd {
  font-size: 1rem;
  opacity: .65;
  margin-top: .25rem;
}
.c-total-sub {
  margin-top: .75rem;
  font-size: .85rem;
  opacity: .8;
}
.c-tax-pct {
  display: inline-block;
  background: var(--amber);
  color: #78350f;
  font-weight: 700;
  font-size: .75rem;
  padding: .1rem .5rem;
  border-radius: 20px;
  margin-left: .4rem;
}

/* Bar chart */
.c-bar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.c-bar-title {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
}
.c-bar-chart {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.c-bar-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .82rem;
}
.c-bar-name { width: 130px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.c-bar-track { flex: 1; background: #f1f5f9; border-radius: 4px; height: 22px; overflow: hidden; }
.c-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: .4rem;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  min-width: 4px;
}
.c-bar-val { font-weight: 600; color: var(--text); min-width: 100px; text-align: right; }

/* Legend */
.c-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}
.c-legend-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  color: var(--text-muted);
}
.c-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Stats grid */
.c-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.c-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.c-stat-label { font-size: .72rem; color: var(--text-muted); margin-bottom: .25rem; }
.c-stat-val { font-size: 1.2rem; font-weight: 700; }
.c-stat-val--green { color: var(--emerald); }
.c-stat-val--red   { color: var(--rose); }
.c-stat-val--navy  { color: var(--navy); }
.c-stat-val--amber { color: var(--amber-dim); }

/* Detailed table */
.c-details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.c-details summary {
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  font-size: .9rem;
  user-select: none;
}
.c-tax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  margin-top: 1rem;
}
.c-tax-table th {
  text-align: left;
  padding: .5rem .75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.c-tax-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
}
.c-tax-table tr:last-child td { border-bottom: none; font-weight: 700; }
.c-tax-table .row-total td { font-weight: 800; color: var(--navy); background: #f8fafc; }
.c-tax-table .row-zero td  { color: var(--text-muted); }
.c-table-note { font-size: .75rem; color: var(--text-muted); margin-top: .75rem; }

/* Trust section */
.c-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) { .c-trust { grid-template-columns: 1fr; } }
.c-trust-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: .83rem;
}
.c-trust-title { font-weight: 700; margin-bottom: .6rem; color: var(--navy); }
.c-trust-col ul { padding-left: 1.1rem; color: var(--text-muted); line-height: 1.8; }

/* Actions */
.c-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.c-action-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .55rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
}
.c-action-btn:hover { border-color: var(--navy); color: var(--navy); }
.c-action-btn--primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #78350f;
  font-weight: 700;
}
.c-action-btn--primary:hover { background: var(--amber-dim); border-color: var(--amber-dim); color: #78350f; }

/* Comparison */
.c-compare-title { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.c-compare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.c-compare-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.c-compare-card h4 { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.c-compare-card .total { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.c-compare-card .diff { font-size: .8rem; color: var(--rose); margin-top: .2rem; }
.c-compare-card .diff.better { color: var(--emerald); }
.c-compare-row { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.c-compare-row:last-child { border-bottom: none; }
.c-compare-row span:first-child { color: var(--text-muted); }

/* Sticky footer */
.c-sticky-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--navy);
  color: #fff;
  padding: .75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.c-sticky-total { font-size: .9rem; }
.c-sticky-total strong { font-size: 1.1rem; color: var(--amber); }
.c-sticky-actions { display: flex; gap: .5rem; }
.c-sticky-actions button {
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: var(--radius-sm);
  padding: .4rem .7rem;
  color: #fff;
  font-size: 1rem;
}

/* Footer */
.c-footer {
  margin-top: auto;
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 60px;
}
@media (min-width: 768px) { .c-footer { margin-bottom: 0; } }

/* Print */
@media print {
  .c-header, .c-disclaimer, .c-back-btn, .c-actions, .c-sticky-footer,
  .c-nav, .c-cats, .c-search-box, #step1, #step2, #compareSection { display: none !important; }
  .c-step-panel { padding: 0; }
  .c-step-wrap { margin: 0; }
}
