/* =====================================================================
   EveryPound — everypound.app design system
   Forest/emerald brand, ported from the app + website/styles.css.
   WCAG AA: accent text uses #0F766E on light; dark text #06281D on emerald.
   ===================================================================== */

:root {
  --forest:     #0B3D2E;
  --forest-lt:  #164A38;
  --emerald:    #10B981;
  --emerald-dk: #0F766E;   /* AA accent text on light */
  --emerald-xl: #6EE7B7;   /* bright accent on dark */
  --on-emerald: #06281D;   /* AA dark text on emerald buttons */
  --cream:      #F7F8F5;
  --sage:       #E9F0EA;
  --ink:        #0F1C17;
  --muted:      #45564E;
  --line:       rgba(11, 61, 46, 0.13);
  --line-dk:    rgba(255, 255, 255, 0.16);
  --white:      #FFFFFF;
  --warn:       #B45309;
  --warn-bg:    #FEF3C7;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 1px 3px rgba(11, 61, 46, 0.06), 0 10px 30px rgba(11, 61, 46, 0.06);
  --maxw:       1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--emerald-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--forest);
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(34px, 5.2vw, 60px); }
h2 { font-size: clamp(26px, 3.2vw, 40px); }
h3 { font-size: clamp(19px, 2vw, 23px); letter-spacing: -0.015em; }
h1 em, h2 em, h3 em { font-style: normal; color: var(--emerald-dk); }
p { margin: 0 0 1em; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); }
.muted { color: var(--muted); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
section { padding: clamp(48px, 7vw, 92px) 0; }
.bg-cream { background: var(--cream); }
.bg-sage  { background: var(--sage); }
.bg-white { background: var(--white); }
.bg-forest { background: var(--forest); color: rgba(255,255,255,0.92); }
.bg-forest h1, .bg-forest h2, .bg-forest h3 { color: #fff; }
.bg-forest em { color: var(--emerald-xl); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--emerald-dk); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--emerald-dk); }
.eyebrow.center { justify-content: center; }
.bg-forest .eyebrow { color: var(--emerald-xl); }
.bg-forest .eyebrow::before { background: var(--emerald-xl); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.01em;
  padding: 14px 24px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  cursor: pointer; transition: transform 0.06s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--emerald); color: var(--on-emerald); }
.btn-primary:hover { background: #0ea271; box-shadow: 0 6px 18px rgba(16,185,129,0.28); }
.btn-forest { background: var(--forest); color: #fff; }
.btn-forest:hover { background: var(--forest-lt); }
.btn-ghost { background: transparent; color: var(--forest); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--forest); }
.btn-ghost.on-dark { color: #fff; border-color: rgba(255,255,255,0.34); }
.btn-ghost.on-dark:hover { border-color: #fff; background: rgba(255,255,255,0.06); }
.btn-lg { padding: 16px 30px; font-size: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247,248,245,0.88); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--forest); letter-spacing: -0.02em; font-size: 18px; }
.nav-logo:hover { text-decoration: none; }
.nav-logo .pound { color: var(--emerald-dk); }
.nav-mark { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--forest); font-weight: 600; font-size: 15px; }
.nav-links a:hover { color: var(--emerald-dk); text-decoration: none; }
.nav-cta { padding: 9px 18px; font-size: 14px; }
.nav-burger { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .nav.open .nav-links {
    display: flex; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    align-items: flex-start; gap: 4px; padding: 14px 22px 22px; background: var(--cream);
    border-bottom: 1px solid var(--line);
  }
  .nav.open .nav-links a { padding: 8px 0; }
}

/* ── Hero ────────────────────────────────────────────────── */
.hero { background: var(--forest); color: rgba(255,255,255,0.9); overflow: hidden; }
.hero h1 { color: #fff; }
.hero .lead { color: rgba(255,255,255,0.82); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 54px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } }

/* ── Feature / value grids ───────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 8px; }
.card .ico { width: 40px; height: 40px; border-radius: 9px; background: var(--sage); display: grid; place-items: center; margin-bottom: 14px; color: var(--emerald-dk); }
.card-link { display: block; transition: transform 0.1s ease, box-shadow 0.15s ease; }
.card-link:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(11,61,46,0.12); text-decoration: none; }
.card-link h3 { color: var(--forest); }
.card-tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--emerald-dk); background: var(--sage); padding: 3px 10px; border-radius: 20px; margin-bottom: 12px; letter-spacing: 0.03em; }
.arrow-link { font-weight: 700; color: var(--emerald-dk); display: inline-flex; align-items: center; gap: 6px; }

/* ── Funnel CTA card ─────────────────────────────────────── */
.cta-card {
  background: linear-gradient(135deg, var(--forest), var(--forest-lt));
  color: #fff; border-radius: var(--radius); padding: clamp(28px, 4vw, 44px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px;
}
.cta-card h3 { color: #fff; margin-bottom: 6px; }
.cta-card p { color: rgba(255,255,255,0.82); margin: 0; max-width: 52ch; }
.cta-card .btn-row { margin: 0; }

/* ── Footer ──────────────────────────────────────────────── */
.footer { background: var(--forest); color: rgba(255,255,255,0.7); padding: 56px 0 30px; }
.footer a { color: rgba(255,255,255,0.7); }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 36px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }
.footer h4 { color: #fff; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 9px; font-size: 15px; }
.footer-brand p { font-size: 14.5px; color: rgba(255,255,255,0.62); max-width: 34ch; }
.footer-bottom { border-top: 1px solid var(--line-dk); padding-top: 22px; font-size: 13.5px; color: rgba(255,255,255,0.55); display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }

/* =====================================================================
   Calculator UI
   ===================================================================== */
.calc { display: grid; grid-template-columns: 1fr 0.82fr; gap: 26px; align-items: start; }
@media (max-width: 940px) { .calc { grid-template-columns: 1fr; } }
.calc-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 30px); box-shadow: var(--shadow); }

/* Tabs (solve-for / salary sections) */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; background: var(--sage); padding: 5px; border-radius: var(--radius-sm); margin-bottom: 22px; }
.tab {
  flex: 1 1 auto; min-width: max-content; text-align: center; padding: 9px 14px;
  border: 0; background: transparent; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 13.5px; color: var(--muted); white-space: nowrap;
}
.tab[aria-selected="true"] { background: var(--white); color: var(--forest); box-shadow: 0 1px 4px rgba(11,61,46,0.12); }
.tab:hover:not([aria-selected="true"]) { color: var(--forest); }

/* Fields */
.field { margin-bottom: 18px; }
.field > label, .field-label { display: block; font-weight: 700; font-size: 14px; color: var(--forest); margin-bottom: 7px; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 5px; }
.control { position: relative; display: flex; align-items: stretch; }
.control input, .control select, input.control, select.control {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--ink);
  padding: 12px 14px; border: 1.5px solid rgba(11, 61, 46, 0.30); border-radius: var(--radius-sm);
  background: var(--white); -webkit-appearance: none; appearance: none;
}
.control input:focus, .control select:focus, input.control:focus, select.control:focus {
  outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(16,185,129,0.16);
}
.control.has-prefix input { padding-left: 34px; }
.control.has-suffix input { padding-right: 40px; }
.affix { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; color: var(--muted); font-weight: 600; pointer-events: none; }
.affix.prefix { left: 13px; }
.affix.suffix { right: 13px; }
select.control, .control select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2345564E' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .field-2 { grid-template-columns: 1fr; } }
/* The "solve-for" output field: looks like a highlighted answer, not a dead input. */
.control input:disabled, input.control:disabled {
  background: var(--sage); color: var(--forest); font-weight: 800;
  -webkit-text-fill-color: var(--forest); opacity: 1; cursor: default;
}
.field.is-output > label::after { content: " (we work this out)"; font-weight: 400; color: var(--emerald-dk); font-size: 12px; }

/* Segmented control (currency, timing, frequency) */
.seg { display: inline-flex; background: var(--sage); border-radius: var(--radius-sm); padding: 4px; gap: 3px; }
.seg button {
  border: 0; background: transparent; font-family: inherit; font-weight: 700; font-size: 14px;
  color: var(--muted); padding: 8px 16px; border-radius: 5px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--white); color: var(--forest); box-shadow: 0 1px 3px rgba(11,61,46,0.14); }
/* Segmented control on a dark panel (e.g. the salary result's period toggle):
   unselected buttons need light text so they are legible before selection. */
.seg.on-dark { background: rgba(255, 255, 255, 0.14); }
.seg.on-dark button { color: rgba(255, 255, 255, 0.82); }
.seg.on-dark button[aria-pressed="true"] { background: #fff; color: var(--forest); }

.toggle-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.toggle-line input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--emerald); flex: none; }
.toggle-line label { font-weight: 600; font-size: 14.5px; color: var(--ink); margin: 0; }

/* Results panel */
.result {
  background: linear-gradient(160deg, var(--forest), var(--forest-lt)); color: #fff;
  border-radius: var(--radius); padding: clamp(22px, 3vw, 30px); position: sticky; top: 80px;
}
@media (max-width: 940px) { .result { position: static; } }
.result .result-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--emerald-xl); margin-bottom: 8px; }
.result .headline { font-size: clamp(34px, 6vw, 46px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: #fff; }
.result .headline-sub { color: rgba(255,255,255,0.72); font-size: 15px; margin-top: 4px; margin-bottom: 18px; }
.result-rows { border-top: 1px solid var(--line-dk); }
.result-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-dk); font-size: 15px; }
.result-row .k { color: rgba(255,255,255,0.78); }
.result-row .v { font-weight: 700; color: #fff; text-align: right; }
.result-row.up .v { color: var(--emerald-xl); }
.result-note { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 14px; }

/* Pills / trap warning inside results */
.flag { display: flex; gap: 10px; align-items: flex-start; background: rgba(255,255,255,0.08); border: 1px solid var(--line-dk); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 16px; font-size: 13.5px; color: rgba(255,255,255,0.9); }
.flag strong { color: var(--emerald-xl); }

/* Multi-pot rows */
.pot { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; background: var(--cream); }
.pot-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pot-head input.pot-name { border: 0; background: transparent; font-weight: 800; font-size: 15px; color: var(--forest); padding: 2px 0; width: 60%; }
.pot-remove { border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 700; font-size: 13px; }
.pot-remove:hover { color: var(--warn); }
.add-pot { width: 100%; border: 1.5px dashed var(--line); background: transparent; color: var(--emerald-dk); font-weight: 700; padding: 13px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: 14.5px; }
.add-pot:hover { border-color: var(--emerald); background: rgba(16,185,129,0.05); }

/* Stepper for per-category rates */
.stepper { display: inline-flex; align-items: center; gap: 0; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button { border: 0; background: var(--white); width: 38px; height: 40px; font-size: 20px; line-height: 1; color: var(--forest); cursor: pointer; font-family: inherit; }
.stepper button:hover { background: var(--sage); }
.stepper .val { min-width: 64px; text-align: center; font-weight: 700; font-size: 15px; color: var(--ink); }

/* Chart */
.chart-wrap { margin-top: 14px; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch.contrib { background: var(--forest); }
.swatch.growth { background: var(--emerald); }
.bar-chart { width: 100%; height: auto; display: block; }

/* Schedule table */
.schedule-wrap { overflow-x: auto; margin-top: 8px; -webkit-overflow-scrolling: touch; }
table.schedule { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
table.schedule th, table.schedule td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.schedule th { color: var(--muted); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }
table.schedule th:first-child, table.schedule td:first-child { text-align: left; font-weight: 700; color: var(--forest); }
table.schedule tbody tr:hover { background: var(--cream); }

/* Breakdown bar (salary) */
.split-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; margin: 8px 0 6px; background: var(--sage); }
.split-bar > span { display: block; height: 100%; }
.split-net { background: var(--emerald); }
.split-tax { background: var(--forest); }
.split-ni { background: #2F6F5C; }
.split-other { background: #93A39B; }
.split-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.split-key span { display: inline-flex; align-items: center; gap: 7px; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--forest); padding: 16px 4px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--emerald-dk); font-weight: 700; }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { color: var(--emerald-dk); }
.faq .faq-body { padding: 0 4px 18px; color: var(--muted); }
.faq .faq-body p { margin: 0 0 0.7em; }

/* Disclaimer + breadcrumb */
.disclaimer { font-size: 13px; color: var(--muted); background: var(--sage); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 22px; }
.breadcrumb { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--emerald-dk); }

/* Section heading helper */
.section-head { max-width: 720px; margin-bottom: 38px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Accessibility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--emerald-dk); outline-offset: 2px; }
