/* ══════════════════════════════════════════════════════════════════
   v2-calculator.css — VTC calculator page
   Visual system aligned with homepage + demo (dark hero / dark form /
   light info cards / dark CTA).
   Requires: v2-base.css, v2-components.css
   ══════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════
   1. HERO
   ════════════════════════════════════ */
.calc-hero {
  background: var(--bg);
  text-align: center;
  padding: 96px 5% 64px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.calc-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--v2-hero-gradient);
  pointer-events: none;
  z-index: -1;
}
.calc-hero .v2-section-label { justify-content: center; }
.calc-hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.07;
  max-width: 820px;
  margin: 0 auto 18px;
  text-wrap: balance;
}
.calc-hero h1 em {
  font-style: normal;
  background: linear-gradient(92deg, var(--accent) 0%, var(--accent2) 55%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.calc-hero p {
  font-size: 17px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ════════════════════════════════════
   2. CALCULATOR (dark form + result)
   ════════════════════════════════════ */
.calc-try {
  background: var(--bg);
  padding: 40px 5% 112px;
}
.calc-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  max-width: 1120px;
  margin: 0 auto;
  /* Cards take their natural heights. Equal-height cards via stretch
     leaves a dead gap above the submit button; instead we tighten the
     result card below so the two sides end up visually close without
     any forced stretch. */
  align-items: start;
}

.calc-card,
.calc-result {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.calc-card-head,
.calc-result-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.calc-card-head h3,
.calc-result-head h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.calc-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Form fields ── */
.calc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.calc-field { display: flex; flex-direction: column; gap: 6px; }
.calc-field.full { grid-column: 1 / -1; }
.calc-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.calc-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: border-color var(--dur), background var(--dur), box-shadow var(--dur);
  color-scheme: dark;
}
.calc-input::placeholder { color: var(--muted-2); }
.calc-input:hover  { border-color: rgba(255,255,255,0.18); }
.calc-input:focus  {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

/* ── Select with custom chevron (background shorthand is atomic;
      prevents Safari's 'lost no-repeat' quirk that caused tiling). ── */
.calc-select {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 40px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>")
    no-repeat right 14px center / 14px 14px,
    var(--bg);
}
.calc-select:focus {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>")
    no-repeat right 14px center / 14px 14px,
    var(--bg);
}
/* ── Custom dark-themed select ──
   The native <select> popup renders in the OS's own chrome (light gray
   on macOS, oversized font) and ignores most CSS on the <option>
   element. We replace it with a custom listbox that we can fully style
   while keeping a visually-hidden native <select id="calcSlot"> for
   v2-calculator.js to read. */
.select-root {
  position: relative;
}
.select-native {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.select-btn {
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  line-height: 1;
  -webkit-user-select: none;
  user-select: none;
}
.select-btn-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-btn[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.select-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  padding: 4px;
  margin: 0;
  list-style: none;
  z-index: 40;
  max-height: 280px;
  overflow-y: auto;
}
.select-list li {
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--dur), color var(--dur);
}
.select-list li:hover,
.select-list li[data-active="true"] {
  background: rgba(245,158,11,0.12);
  color: var(--accent2);
}
.select-list li[aria-selected="true"] {
  background: rgba(245,158,11,0.14);
  color: var(--accent);
}
.select-list li[aria-selected="true"]:hover,
.select-list li[aria-selected="true"][data-active="true"] {
  background: rgba(245,158,11,0.2);
}

/* ── Submit button row ── */
.calc-actions { margin-top: 22px; display: flex; }
.calc-actions .btn-hero { width: 100%; }

/* ════════════════════════════════════
   RESULT CARD
   ════════════════════════════════════ */
.calc-result-rows {
  display: flex;
  flex-direction: column;
}
.calc-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.calc-result-row:last-child { border-bottom: none; }
.calc-result-row span   { color: var(--muted); }
.calc-result-row strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.calc-result-total {
  margin-top: 14px;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(245,158,11,0.12) 0%, rgba(245,158,11,0.06) 100%);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(245,158,11,0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.calc-result-total span:first-child {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.calc-result-total #cr-total-val {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════
   3. FARE-INFO CARDS (light)
   ════════════════════════════════════ */
.calc-info {
  background: var(--bg-light);
  color: var(--text-light);
  padding: var(--v2-section-padding);
}
.calc-info .v2-section-title { color: var(--text-light); }
.calc-info .v2-section-desc  { color: var(--muted-light); }
.calc-info .v2-center { margin-bottom: 48px; }

.calc-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
}
.calc-info-card {
  background: #ffffff;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--dur), box-shadow var(--dur), border-color var(--dur);
}
.calc-info-card:hover {
  transform: translateY(-2px);
  border-color: #dcdde3;
  box-shadow: var(--shadow-md);
}
.calc-info-card h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-light);
}
.calc-info-card p {
  font-size: 14px;
  color: var(--muted-light);
  line-height: 1.6;
}

/* Light icon tile override — neutral amber on white */
.ico-tile-light {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.28);
  color: var(--accent);
}

/* ════════════════════════════════════
   PROFIT CALCULATOR (multi-section)
   Reuses .calc-card, .calc-form-grid, .calc-input from above.
   ════════════════════════════════════ */

/* Two-column layout — input stack + sticky result panel */
.calc-grid-profit {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: start;
}
.calc-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Section number badge (sits in the .calc-card-head row) */
.calc-section-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-tint);
  color: var(--accent2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-tint-2);
}

/* Currency / suffix wrapper around an .calc-input */
.calc-input-wrap {
  position: relative;
  display: block;
}
.calc-input-wrap::before,
.calc-input-wrap::after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.calc-input-wrap[data-prefix]::before {
  content: attr(data-prefix);
  left: 14px;
}
.calc-input-wrap[data-suffix]::after {
  content: attr(data-suffix);
  right: 14px;
}
.calc-input.has-prefix { padding-left: 32px; }
.calc-input.has-suffix { padding-right: 36px; }

/* Optional label */
.calc-label-optional {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-2);
  margin-left: 4px;
  letter-spacing: 0;
}

/* Inline summary row inside an input card */
.calc-summary-row {
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}
.calc-summary-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.calc-summary-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.calc-summary-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.calc-summary-value-neg { color: #f87171; }

/* Daily / Monthly toggle (segmented control) */
.calc-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  margin-bottom: 16px;
}
.calc-toggle-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--dur), background var(--dur);
}
.calc-toggle-btn:hover { color: var(--text); }
.calc-toggle-btn.is-active {
  background: var(--accent);
  color: #0b0b0f;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

/* Business-type buttons */
.calc-biz-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.calc-biz-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color var(--dur), background var(--dur), color var(--dur);
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
}
.calc-biz-btn:hover { border-color: rgba(255, 255, 255, 0.22); }
.calc-biz-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-tint);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.calc-biz-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.calc-biz-btn.is-active .calc-biz-name { color: var(--accent2); }
.calc-biz-rate {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.calc-biz-btn.is-active .calc-biz-rate { color: var(--accent); }

/* ── Result panel ── */
.calc-result-sticky {
  position: sticky;
  top: 24px;
}
.calc-result-hero {
  margin-top: 4px;
  padding: 22px 22px 20px;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(245, 158, 11, 0.18) 0%, transparent 70%),
    linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}
.calc-result-hero-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.calc-result-hero-value {
  font-size: clamp(32px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.calc-result-hero-sub {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* 2x2 stat tiles */
.calc-result-tile-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.calc-result-tile {
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.calc-result-tile-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.calc-result-tile-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* Detail rows below tiles */
.calc-result-rows + .calc-result-rows,
.calc-result-tile-grid + .calc-result-rows {
  margin-top: 18px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.calc-result-row .is-neg { color: #f87171; }

/* Result CTA */
.calc-result-cta {
  margin-top: 18px;
}
.calc-result-cta .btn-hero {
  width: 100%;
  justify-content: center;
}

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */
@media (max-width: 1024px) {
  .calc-grid          { grid-template-columns: 1fr; gap: 18px; }
  .calc-grid-profit   { grid-template-columns: 1fr; }
  .calc-result-sticky { position: static; }
  .calc-info-grid     { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .calc-hero          { padding: 64px 5% 32px; }
  .calc-try           { padding: 20px 5% 64px; }
  .calc-card,
  .calc-result        { padding: 20px; }
  .calc-card-head,
  .calc-result-head   { gap: 10px; margin-bottom: 16px; padding-bottom: 14px; }
  .calc-card-head h3,
  .calc-result-head h3 { font-size: 16px; }
  .calc-form-grid     { grid-template-columns: 1fr; gap: 14px; }
  .calc-info-grid     { grid-template-columns: 1fr; }
  .calc-stack         { gap: 14px; }
  .calc-summary-row   { grid-template-columns: 1fr; gap: 10px; padding: 12px 14px; }
  .calc-biz-row       { grid-template-columns: 1fr; gap: 8px; }
  .calc-biz-btn       { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 14px; }
  .calc-result-tile-grid { gap: 8px; }
  .calc-result-tile   { padding: 12px; }
  .calc-result-tile-value,
  .calc-summary-value { font-size: 17px; }
  .calc-result-hero   { padding: 18px; }
  .calc-result-total  { padding: 16px 18px; }
  .calc-result-total #cr-total-val { font-size: 24px; }
}
