/* TollCheck — style.css
   Brand: forest green (logo-friendly). “No toll” uses teal + dashed borders — not hue alone
   (helps common red–green colour-vision limitations; always pair with $0.00 / labels in UI). */

:root {
  --bg-page: #f4f7f5;
  --bg-card: #ffffff;
  --text-primary: #1a1f1c;
  --text-secondary: #4a524e;
  --text-tertiary: #6b7570;
  --border: #d9e0db;
  /* Brand / actions */
  --accent: #157049;
  --accent-hover: #0f5132;
  --accent-soft: #e4f2ec;
  --accent-border: #7eb89a;
  --border-focus: #1a8f62;
  /* $0 / no-toll emphasis: teal (different hue from brand green for colour-vision diversity) */
  --no-toll: #0f766e;
  --no-toll-soft: #e6f7f5;
  --no-toll-border: #5eead4;
  --warning: #b45309;
  --error: #b91c1c;
  --shadow: rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* HEADER */
.header {
  margin-bottom: 24px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.header-support {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.header-support:hover {
  text-decoration: underline;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  line-height: 1;
  min-width: 0;
}

.site-logo {
  display: block;
  flex-shrink: 0;
  height: 52px;
  width: 52px;
  object-fit: contain;
}

.site-wordmark {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  white-space: nowrap;
}

.site-wordmark-toll {
  color: #0d2818;
}

.site-wordmark-check {
  color: var(--accent);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* FORM */
.form-section {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px var(--shadow);
}

input[type="text"],
select {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #f8f9fb;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--border-focus);
  background: var(--bg-card);
}

.section-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  margin-top: 4px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.45;
  margin-bottom: 12px;
  margin-top: 0;
}

.form-hint strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.vehicle-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: -4px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.corridor-banner {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  letter-spacing: 0.02em;
}

.debug-warnings {
  font-size: 11px;
  color: #8a5a00;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.primary-btn {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: -0.2px;
}

.primary-btn:hover  { background: var(--accent-hover); }
.primary-btn:active { transform: scale(0.98); }

/* ROUTE CARDS */
#results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.route-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 16px;
  border-left: 5px solid var(--border);
  box-shadow: 0 1px 4px var(--shadow);
  transition: box-shadow 0.15s;
}

.route-card:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

/* Card accent colours */
.route-card.fastest    { border-left-color: var(--accent); }
.route-card.noTolls    { border-left-color: var(--no-toll); border-left-style: dashed; }
.route-card.cheapest   { border-left-color: #2563ab; }
.route-card.bestValue  { border-left-color: var(--warning); }
.route-card.fullToll   { border-left-color: #6d28d9; }
.route-card.alternative{ border-left-color: #64748b; }

/* Card content */
.route-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.fastest    .route-title { color: var(--accent); }
.noTolls    .route-title { color: var(--no-toll); }
.cheapest   .route-title { color: #2563ab; }
.bestValue  .route-title { color: var(--warning); }
.fullToll   .route-title { color: #7c3aed; }

.route-path {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.route-primary {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.toll-line {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.route-delta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.value-line {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* START BUTTON */
.start-btn {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: none;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  transition: opacity 0.15s, transform 0.1s;
}

.start-btn:hover  { opacity: 0.88; }
.start-btn:active { transform: scale(0.98); }

.start-btn.fastest    { background: var(--accent); }
.start-btn.noTolls    { background: var(--no-toll); }
.start-btn.cheapest   { background: #2563ab; }
.start-btn.bestValue  { background: var(--warning); }
.start-btn.fullToll   { background: #6d28d9; }
.start-btn.alternative{ background: #64748b; }

/* AD BOX */
.ad-box {
  background: #e8eaef;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  margin-bottom: 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FOOTER */
.footer-note {
  text-align: center;
  font-size: 11px;
  color: #c7c7cc;
  margin-top: 24px;
  line-height: 1.5;
}

.footer-note a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.footer-note a:hover {
  text-decoration: underline;
}

/* V2 RESULTS */
.results-intro {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 0 2px;
}

.baseline-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}

/* $0 reference: teal tint + dashed side (not only “another green”) */
.baseline-box--zero {
  background: var(--no-toll-soft);
  border: 1px solid var(--no-toll-border);
  border-left: 4px dashed var(--no-toll);
}

.baseline-box--zero .baseline-label {
  color: var(--no-toll);
}

.baseline-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  margin-bottom: 6px;
}

.baseline-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.35;
}

.baseline-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.baseline-stats {
  font-size: 16px;
  margin-bottom: 8px;
}

.baseline-path {
  font-size: 14px;
  margin-bottom: 6px;
}

.options-heading {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.options-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border-radius: 14px;
  padding: 14px;
  border: 2px solid var(--border);
  cursor: pointer;
  box-shadow: 0 1px 3px var(--shadow);
}

.option-row:has(.option-input:checked) {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(21, 112, 73, 0.2);
}

.option-row--zero {
  border-left: 4px dashed var(--no-toll);
  background: linear-gradient(90deg, var(--no-toll-soft) 0%, var(--bg-card) 12px);
}

.option-baseline {
  background: #fafafa;
}

.option-input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.option-body {
  flex: 1;
  min-width: 0;
}

.option-summary {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 6px;
}

.option-meta {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.option-extra {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.option-extra.dpm {
  font-weight: 600;
  color: var(--warning);
}

.toll-line.small {
  font-size: 11px;
  margin-top: 8px;
}

.results-actions {
  margin-top: 20px;
}

.maps-btn {
  margin-top: 0;
}

.maps-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.45;
  margin-top: 12px;
  margin-bottom: 0;
}

.results-actions .ad-box {
  margin-top: 14px;
  margin-bottom: 0;
}

.baseline-maps-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.baseline-maps-link:hover {
  text-decoration: underline;
}

.option-note {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 6px;
  line-height: 1.35;
}

.panel {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
}

.panel.loading-state p {
  margin: 0;
  font-size: 15px;
}

.panel.error-state {
  color: var(--error);
  border: 1px solid #f5c4c0;
}

.panel.cap-state {
  text-align: left;
  color: var(--text-primary);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  max-width: 100%;
}

.cap-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--accent);
}

.cap-lede,
.cap-stats,
.cap-hint {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.cap-stats {
  font-size: 15px;
  color: var(--text-primary);
}

.cap-hint {
  margin-bottom: 0;
  font-size: 13px;
}

.cap-hint code {
  font-size: 12px;
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.empty-state {
  padding: 28px 16px;
}

/* RESPONSIVE */
@media (min-width: 520px) {
  .container {
    padding: 40px 24px 60px;
  }
  h1 { font-size: 34px; }
}
