/* ============================================================
   Allocra True Cost Calculator  ·  v1.0
   Brand v2.2: Deep Green / Amber / Surface Cream / Poppins / Inter
   Companion to /etf-xray/styles.css; shared brand tokens and
   shared shell (site header, cards, hero) intentionally mirror
   the X-Ray so the two calculators feel like siblings.
   ============================================================ */

:root {
  --deep-green: #1B5E20;
  --teal: #00897B;
  --amber: #FF8F00;
  --amber-soft: #FFC078;
  --surface-cream: #FAFAF7;
  --ink: #0F172A;
  --slate: #6B7280;
  --slate-soft: #9CA3AF;
  --white: #FFFFFF;
  --line: #E5E7EB;
  --hover: #F3F4F6;
  --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

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

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--surface-cream);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Site header (matches X-Ray)
   ============================================================ */

.site-header {
  background: var(--surface-cream);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--deep-green);
}
.brand-mark-triangle {
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 16px solid var(--deep-green);
}
.brand-mark-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.2px;
}
.site-header nav {
  display: flex;
  gap: 24px;
}
.site-header nav a {
  color: var(--slate);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.site-header nav a:hover { color: var(--deep-green); }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  padding: 48px 0 32px;
}
.eyebrow {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate);
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.hero h1 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 40px;
  line-height: 1.15;
  color: var(--deep-green);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.hero .subhead {
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 16px;
  max-width: 640px;
}
.hero .meta {
  font-size: 13px;
  color: var(--slate);
}

/* ============================================================
   Video intro
   3-min YouTube walkthrough card. Sits below hero, above calculator.
   Mirrors the .card aesthetic (white surface, subtle shadow, rounded)
   so the video sits in-frame with the calculator that follows.
   The .video-wrap uses the classic padding-bottom 56.25% trick to
   hold a 16:9 aspect ratio at any container width.
   ============================================================ */

.video-intro {
  padding: 0 0 32px;
}
.video-card {
  background: var(--white);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}
.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--white);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 28px;
  margin-bottom: 24px;
}
.card h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--deep-green);
  margin-bottom: 8px;
}
.card-meta {
  font-size: 13px;
  color: var(--slate);
  margin-bottom: 16px;
}

/* ============================================================
   Input card sections
   ============================================================ */

.input-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.input-section:first-child { padding-top: 0; }
.input-section:last-of-type { border-bottom: none; }

.field-label {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--slate);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.field-meta {
  font-size: 13px;
  color: var(--slate);
  margin-bottom: 12px;
}

/* Portfolio size input with stepper buttons */
.portfolio-input-wrap {
  display: inline-flex;
  align-items: stretch;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  transition: border-color 0.15s;
  overflow: hidden;
}
.portfolio-input-wrap:focus-within {
  border-color: var(--deep-green);
}
.portfolio-stepper {
  flex: 0 0 44px;
  border: none;
  background: var(--surface-cream);
  color: var(--deep-green);
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.portfolio-stepper:hover {
  background: rgba(27, 94, 32, 0.08);
}
.portfolio-stepper:active {
  background: rgba(27, 94, 32, 0.15);
}
.portfolio-stepper:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.portfolio-prefix {
  display: flex;
  align-items: center;
  padding-left: 16px;
  color: var(--slate);
  font-size: 18px;
  pointer-events: none;
}
#portfolio-size {
  flex: 1;
  width: 100%;
  padding: 14px 16px 14px 6px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  color: var(--ink);
  background: var(--white);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
#portfolio-size:focus {
  outline: none;
}

/* ETF picker — 3x3 grid matching X-Ray */
.popular-etfs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
@media (max-width: 640px) {
  .popular-etfs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .popular-etfs { grid-template-columns: 1fr; }
}
.popular-etf-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
  text-align: left;
}
.popular-etf-btn .pop-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.popular-etf-btn:hover {
  border-color: var(--deep-green);
  background: rgba(27, 94, 32, 0.02);
}
.popular-etf-btn.added {
  border-color: var(--deep-green);
  background: rgba(27, 94, 32, 0.06);
}
.popular-etf-btn.added .pop-ticker::after {
  content: ' ✓';
  color: var(--deep-green);
}
.popular-etf-btn .pop-ticker {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--deep-green);
}
.popular-etf-btn .pop-name {
  font-size: 11px;
  color: var(--slate);
  margin-top: 2px;
}

/* Chips — same as X-Ray */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 14px;
  background: rgba(27, 94, 32, 0.08);
  border: 1px solid rgba(27, 94, 32, 0.18);
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--deep-green);
}
.chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--deep-green);
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.6;
}
.chip button:hover {
  opacity: 1;
  background: rgba(27, 94, 32, 0.1);
}

/* Platform picker — stacked radio cards */
.platform-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 4px;
}
.platform-option {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  grid-column-gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.platform-option:hover {
  border-color: var(--deep-green);
}
.platform-option.selected {
  border-color: var(--deep-green);
  background: rgba(27, 94, 32, 0.04);
}
.platform-option input[type="radio"] {
  grid-row: 1 / 3;
  align-self: center;
  margin: 0;
  accent-color: var(--deep-green);
}
.platform-option .platform-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--deep-green);
}
.platform-option .platform-note {
  font-size: 12px;
  color: var(--slate);
  line-height: 1.4;
}

/* Horizon picker — pill buttons */
.horizon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.horizon-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}
.horizon-option:hover {
  border-color: var(--deep-green);
}
.horizon-option input[type="radio"] {
  margin: 0;
  accent-color: var(--deep-green);
}
.horizon-option input[type="radio"]:checked + span {
  color: var(--deep-green);
  font-weight: 600;
}

/* Optional section — collapsible */
.optional-section {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.optional-section summary {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--slate);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.optional-section summary::before {
  content: '▸';
  color: var(--slate);
  transition: transform 0.15s;
}
.optional-section[open] summary::before {
  transform: rotate(90deg);
}

/* Trades slider */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
#trades-per-year {
  flex: 1;
  accent-color: var(--amber);
}
.slider-value {
  min-width: 32px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--deep-green);
  text-align: center;
}

/* Adviser fee toggle + input */
.advice-section {
  background: rgba(15, 23, 42, 0.02);
  border-radius: 8px;
  padding: 16px;
}
.advice-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.advice-toggle-row input[type="checkbox"] {
  accent-color: var(--deep-green);
  width: 18px;
  height: 18px;
}
.advice-toggle-label {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.advice-input-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
#advice-pct {
  width: 100px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  text-align: right;
}
#advice-pct:focus {
  outline: none;
  border-color: var(--deep-green);
}
.advice-pct-suffix {
  font-size: 14px;
  color: var(--slate);
}

/* ============================================================
   Results — hero card with the compounded number
   ============================================================ */

.hero-card {
  text-align: center;
  background: linear-gradient(135deg, var(--white) 0%, rgba(27, 94, 32, 0.02) 100%);
}
.hero-eyebrow {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--slate);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-number {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 56px;
  line-height: 1.1;
  color: var(--deep-green);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}
.hero-subtitle {
  font-size: 15px;
  color: var(--ink);
  font-style: italic;
  max-width: 480px;
  margin: 0 auto;
}

/* Annual summary above breakdown */
.annual-summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.annual-summary-label {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--slate);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.annual-summary-gbp {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 24px;
  color: var(--deep-green);
  font-variant-numeric: tabular-nums;
}
.annual-summary-bps {
  font-size: 14px;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
}

/* Breakdown bars */
.breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.breakdown-row {
  display: grid;
  grid-template-columns: 110px 1fr 160px;
  align-items: center;
  gap: 12px;
}
@media (max-width: 640px) {
  .breakdown-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.breakdown-label {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}
.breakdown-bar-wrap {
  background: var(--hover);
  border-radius: 4px;
  height: 18px;
  overflow: hidden;
}
.breakdown-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease-out;
}
.seg-ocr      { background: var(--deep-green); }
.seg-platform { background: var(--teal); }
.seg-spread   { background: var(--slate); }
.seg-fx       { background: var(--amber); }
.seg-advice   { background: #4B5563; }   /* darker slate — visually distinct as external */

.breakdown-value {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.breakdown-bps {
  color: var(--slate);
  margin-left: 6px;
}

/* Comparison card */
.comparison-card {
  border-left: 4px solid var(--amber);
}
.comparison-headline {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 8px;
}
.comparison-body {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.comparison-body strong {
  color: var(--deep-green);
}

/* Methodology footnote */
.methodology-footnote {
  background: rgba(15, 23, 42, 0.02);
  border: 1px dashed var(--line);
  box-shadow: none;
}
.methodology-footnote p {
  font-size: 12px;
  color: var(--slate);
  font-style: italic;
  line-height: 1.6;
  margin: 0;
}

/* Subscribe card */
.subscribe-card {
  background: var(--surface-cream);
  border: 1px solid rgba(27, 94, 32, 0.15);
}
.subscribe-eyebrow {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.subscribe-body {
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Primary button — same amber treatment as X-Ray */
.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  background: var(--amber);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover {
  background: #E67E00;
}
.btn-primary:disabled {
  background: var(--slate-soft);
  cursor: not-allowed;
  opacity: 0.6;
}

/* The big Calculate button inside the input card. Larger than the
   default btn-primary to read as the "reveal" action. */
.btn-calculate {
  display: block;
  width: 100%;
  padding: 18px 24px;
  font-size: 16px;
  margin-top: 24px;
  letter-spacing: 0.3px;
}
.helper-text {
  font-size: 13px;
  color: var(--slate);
  font-style: italic;
  text-align: center;
  margin-top: 8px;
}
.helper-text.ready {
  color: var(--deep-green);
  font-style: normal;
  font-weight: 500;
}

/* Path A reveal pattern. When inputs change after the first calculation,
   the results section is marked .stale to communicate that the displayed
   numbers are no longer current, and the Calculate button gets a
   .btn-stale-prompt accent to invite the re-click. Both are cleared
   when the user clicks Update your True Cost. */
.results.stale {
  opacity: 0.55;
  transition: opacity 0.2s ease;
  position: relative;
}
.results.stale::before {
  content: 'Your inputs have changed. Click Update your True Cost to refresh.';
  display: block;
  background: var(--amber, #FF8F00);
  color: #FFFFFF;
  padding: 12px 18px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px;
  margin-bottom: 20px;
  letter-spacing: 0.2px;
  /* Banner sits above the dimmed content; raise its opacity so it stays legible. */
  opacity: 1.6;
}
.btn-stale-prompt {
  box-shadow: 0 0 0 3px rgba(255, 143, 0, 0.35);
}

/* ============================================================
   Footer (matches X-Ray)
   ============================================================ */

.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  background: var(--surface-cream);
  margin-top: 48px;
}
.footer-disclaimer {
  font-size: 12px;
  color: var(--slate);
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.5;
}
.footer-meta {
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 12px;
}
.footer-links {
  font-size: 13px;
  color: var(--slate);
}
.footer-links a {
  color: var(--slate);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--deep-green); }
.footer-links .dot {
  margin: 0 8px;
  opacity: 0.5;
}

/* ============================================================
   Mobile adjustments
   ============================================================ */

@media (max-width: 640px) {
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 32px; }
  .card { padding: 20px; }
  .hero-number { font-size: 44px; }
  .platform-picker { grid-template-columns: 1fr; }
}
