/* roi.css — /roi layout only. Colors via tokens. No base.css duplication. */

.roi-page { padding-top: var(--nav-height, 72px); }

.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--dv-orange); z-index: 1000; transition: width 100ms linear;
}

/* ── S1: Hero ── */
.roi-hero {
  padding: var(--space-10) 0 var(--space-6);
  border-bottom: 1px solid var(--border-light);
}
.roi-hero .eyebrow { color: var(--dv-orange); }
.roi-hero h1 { margin: var(--space-2) 0 var(--space-3); max-width: 600px; }
.roi-hero__sub { font-size: var(--text-lg); color: var(--text-secondary); max-width: 640px; line-height: 1.65; margin-bottom: var(--space-2); }
.roi-hero__disclaimer { font-size: var(--text-xs); color: var(--text-muted); max-width: 640px; line-height: 1.5; }

/* ── S2: Calculator ── */
.roi-calc { padding: var(--space-2) 0 var(--space-10); }

/* ── Sticky bar: tabs + privacy ── */
.roi-sticky-bar {
  position: sticky;
  top: var(--nav-height, 72px);
  z-index: 100;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-3) 0;
  margin-bottom: var(--space-6);
}
.roi-sticky-bar__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-2);
}

/* Tab strip — centered */
.roi-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
}
.roi-tab-btn {
  padding: var(--space-2) var(--space-6);
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600;
  background: var(--bg-surface); color: var(--text-secondary);
  border: none; cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
  text-align: center; line-height: 1.4; white-space: nowrap;
}
.roi-tab-btn:first-child { border-right: 1px solid var(--border); }
.roi-tab-btn.active {
  background: var(--dv-orange); color: var(--text-hero-color);
}
.roi-tab-btn:not(.active):hover {
  background: var(--bg-card); color: var(--text-primary);
}

/* Privacy note in sticky bar */
.roi-privacy {
  display: flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); color: var(--text-muted);
}
.roi-privacy svg { width: 12px; height: 12px; flex-shrink: 0; color: var(--dv-teal); }

/* ── Seed row: region + subscribers ── */
.roi-seed-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}
.roi-select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-card); color: var(--text-primary);
  font-family: var(--font-body); font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--transition-base);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.roi-select:focus { outline: none; border-color: var(--dv-orange); }

/* Auto-fill note */
.roi-autofill-note {
  display: none;
  font-size: var(--text-xs);
  color: var(--dv-teal);
  background: var(--dv-teal-dim);
  border: 1px solid var(--dv-teal-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}
.roi-autofill-note.active { display: block; }

/* Tab panels */
.roi-panel { display: none; }
.roi-panel.active { display: block; }

/* Calculator layout: inputs left, results right */
.roi-calc__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-6); align-items: start;
}

/* ── Input section ── */
.roi-inputs {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.roi-inputs__label {
  font-size: var(--text-xs); font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: var(--space-4); display: block;
}
.roi-field { margin-bottom: var(--space-3); }
.roi-field label {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-sm); font-weight: 600;
  color: var(--text-primary); margin-bottom: 6px;
}
.roi-field input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-card); color: var(--text-primary);
  font-family: var(--font-body); font-size: var(--text-sm);
  transition: border-color var(--transition-base);
  box-sizing: border-box;
}
.roi-field input:focus { outline: none; border-color: var(--dv-orange); }
.roi-field input::placeholder { color: var(--text-muted); font-size: var(--text-xs); }

/* Seed input — slightly larger, prominent */
.roi-seed-input {
  border-color: var(--dv-orange-border) !important;
  background: var(--dv-orange-dim) !important;
}
.roi-seed-input:focus { border-color: var(--dv-orange) !important; }

/* Default-filled field: subtle teal tint */
.roi-field input.roi-field--defaulted {
  border-color: var(--dv-teal-border);
  background: var(--dv-teal-dim);
}

/* User-overridden field: teal border, stronger signal */
.roi-field input.roi-field--overridden {
  border-color: var(--dv-teal);
  background: var(--bg-card);
}

/* ── Tooltip ── */
.roi-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  color: var(--text-muted);
  flex-shrink: 0;
}
.roi-tip svg { width: 13px; height: 13px; }
.roi-tip__bubble {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-hero);
  color: var(--text-hero-dim);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  width: 240px;
  white-space: normal;
  z-index: 200;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
/* Arrow */
.roi-tip__bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-hero);
}
.roi-tip:hover .roi-tip__bubble,
.roi-tip:focus .roi-tip__bubble {
  visibility: visible;
  opacity: 1;
}
/* Prevent tooltip clipping at left edge */
.roi-field:first-child .roi-tip__bubble,
.roi-seed-row .roi-tip__bubble {
  left: 0;
  transform: translateX(0);
}
.roi-field:first-child .roi-tip__bubble::after,
.roi-seed-row .roi-tip__bubble::after {
  left: 12px;
  transform: none;
}

/* ── Advanced assumptions ── */
.roi-advanced {
  margin-top: var(--space-4);
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-3);
}
.roi-advanced__toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600;
  color: var(--text-secondary); padding: 0;
}
.roi-advanced__toggle svg { width: 16px; height: 16px; transition: transform var(--transition-base); color: var(--text-muted); }
.roi-advanced__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.roi-advanced__panel { display: none; padding-top: var(--space-3); }
.roi-advanced__panel.open { display: block; }
.roi-advanced__note {
  font-size: var(--text-xs); color: var(--text-muted);
  font-style: italic; margin-bottom: var(--space-3); line-height: 1.5;
}
.roi-assumption-field {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-2); gap: var(--space-2);
}
.roi-assumption-field label { font-size: var(--text-xs); color: var(--text-secondary); flex: 1; }
.roi-assumption-field input {
  width: 72px; padding: 6px 10px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-primary);
  font-size: var(--text-sm); font-family: var(--font-body); text-align: right;
}
.roi-assumption-field input:focus { outline: none; border-color: var(--dv-orange); }
.roi-assumption-field .roi-pct { font-size: var(--text-xs); color: var(--text-muted); flex-shrink: 0; }

/* ── Results section ── */
.roi-results {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: sticky;
  top: calc(var(--nav-height, 72px) + 80px); /* account for sticky bar height */
}
.roi-results__label {
  font-size: var(--text-xs); font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: var(--space-4); display: block;
}

/* Empty state */
.roi-results__empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: var(--space-10) var(--space-6);
  gap: var(--space-3);
}
.roi-results__empty svg { width: 40px; height: 40px; color: var(--border); }
.roi-results__empty p {
  font-size: var(--text-sm); color: var(--text-muted); line-height: 1.6;
  max-width: 220px; margin: 0;
}

/* Defaults note below results */
.roi-results__defaults-note {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

/* Results table */
.roi-table { width: 100%; border-collapse: collapse; }
.roi-table th {
  font-size: var(--text-xs); font-weight: 600; color: var(--text-muted);
  text-align: left; padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-light);
}
.roi-table th:not(:first-child) { text-align: right; }
.roi-table td {
  font-size: var(--text-sm); color: var(--text-secondary);
  padding: 10px 0; border-bottom: 1px solid var(--border-light); vertical-align: top;
}
.roi-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.roi-table tr.roi-total td {
  font-weight: 700; color: var(--text-primary);
  border-bottom: none; border-top: 2px solid var(--border); padding-top: 14px;
}
.roi-savings-val { color: var(--dv-teal); font-weight: 600; }
.roi-total .roi-savings-val { color: var(--dv-teal); font-size: var(--text-base); }

/* Summary block */
.roi-summary {
  margin-top: var(--space-4); padding: var(--space-4);
  background: var(--dv-orange-dim);
  border: 1px solid var(--dv-orange-border);
  border-radius: var(--radius-md);
}
.roi-summary__row { display: flex; justify-content: space-between; align-items: baseline; }
.roi-summary__row + .roi-summary__row {
  margin-top: var(--space-2); padding-top: var(--space-2);
  border-top: 1px solid var(--dv-orange-border);
}
.roi-summary__key { font-size: var(--text-sm); color: var(--text-secondary); }
.roi-summary__val { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; color: var(--dv-orange); }
.roi-summary__3yr .roi-summary__val { font-size: var(--text-lg); }

/* ── S3: Methodology Note ── */
.roi-method { padding: var(--space-6) 0; border-top: 1px solid var(--border-light); }
.roi-method__toggle {
  display: flex; align-items: center; gap: var(--space-1);
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600;
  color: var(--text-muted); padding: 0;
}
.roi-method__toggle svg:last-child { width: 16px; height: 16px; transition: transform var(--transition-base); }
.roi-method__toggle[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
.roi-method__body { display: none; max-width: 720px; padding-top: var(--space-4); }
.roi-method__body.open { display: block; }
.roi-method__body p { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.7; margin-bottom: var(--space-3); }
.roi-method__body strong { color: var(--text-primary); }

/* ── S4: CTA (always-dark) ── */
.roi-cta { background: var(--bg-hero); padding: var(--space-10) 0; text-align: center; }
.roi-cta .eyebrow { color: var(--dv-orange); }
.roi-cta__savings {
  font-family: var(--font-display); font-size: clamp(32px, 5vw, 64px); font-weight: 800;
  color: var(--dv-orange); margin: var(--space-3) 0 var(--space-2);
  letter-spacing: -0.02em; line-height: 1;
}
.roi-cta__savings-label { font-size: var(--text-sm); color: var(--text-hero-mute); margin-bottom: var(--space-6); }
.roi-cta h2 { color: var(--text-hero-color); max-width: 560px; margin: 0 auto var(--space-3); }
.roi-cta__body { font-size: var(--text-base); color: var(--text-hero-dim); max-width: 600px; margin: 0 auto var(--space-6); line-height: 1.65; }
.roi-cta__actions { display: flex; justify-content: center; gap: var(--space-4); flex-wrap: wrap; }

/* ── Table scroll wrapper (mobile) ── */
.roi-table-wrap { overflow-x: auto; }

/* ── Modeled benchmark note in net panel ── */
.roi-results__bench-note { margin-bottom: var(--space-3); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .roi-calc__grid { grid-template-columns: 1fr; }
  .roi-results {
    position: static;
    top: auto;
  }
}
@media (max-width: 767px) {
  .roi-seed-row { grid-template-columns: 1fr; }
  .roi-sticky-bar__inner { padding: 0 var(--space-4); }
  .roi-tab-btn { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
  .roi-tip__bubble { width: 200px; }
}
@media (max-width: 640px) {
  .roi-tabs { max-width: 100%; width: 100%; }
  .roi-tab-btn { flex: 1; }
  .roi-cta__actions { flex-direction: column; align-items: center; }
  .roi-table { font-size: var(--text-xs); }
  .roi-table th, .roi-table td { padding: 8px 0; }
}
