
:root {
  --ink: #17211d;
  --ink-soft: #49524e;
  --paper: #f5f1e8;
  --paper-deep: #ece6da;
  --card: #fffdf8;
  --line: rgba(23, 33, 29, 0.13);
  --accent: #315f89;
  --accent-2: #d9e5f0;
  --accent-dark: #1d466c;
  --shadow: 0 22px 70px rgba(32, 55, 78, 0.10);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,.78), transparent 28%),
    linear-gradient(180deg, #f8f5ee 0%, var(--paper) 42%, #f1ece2 100%);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button, select, input { font: inherit; }

button { cursor: pointer; }

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.return-link {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.return-link:hover { text-decoration: underline; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-word {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: 19px;
}

.demo-chip,
.status-pill {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.42);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--ink-soft);
}

.hero {
  padding: 76px 0 48px;
  max-width: 850px;
}

.eyebrow,
.step-label,
.result-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.hero h1,
.why-section h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(44px, 6vw, 76px);
  line-height: .98;
  letter-spacing: -0.055em;
  max-width: 920px;
}

.hero-copy {
  max-width: 720px;
  margin: 28px 0 12px;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.55;
}

.privacy-note {
  display: inline-block;
  margin: 7px 0 0;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(49,95,137,.10);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 72px;
}

.panel {
  background: rgba(255,253,248,.86);
  border: 1px solid rgba(23,33,29,.11);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.input-panel { padding: 30px; }
.results-panel { padding: 30px; position: sticky; top: 18px; }

.calculator-grid:not(.results-mode) {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.calculator-grid.results-mode {
  grid-template-columns: minmax(0, 860px);
  justify-content: center;
}

.results-mode .results-panel {
  position: static;
}

.results-view .hero,
.calculating-view .hero {
  display: none;
}

.results-view main,
.calculating-view main {
  padding-top: 48px;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.back-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}

.back-button:hover {
  background: var(--accent-2);
}

.calculation-state {
  padding: 56px 48px;
  text-align: center;
  max-width: 650px;
  margin: 0 auto;
}

.calculation-state h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.04em;
  font-size: clamp(28px, 4vw, 42px);
}

.calculation-state > p:not(.step-label) {
  max-width: 460px;
  margin: 16px auto 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.loading-orbit {
  width: 56px;
  height: 56px;
  margin: 0 auto 28px;
  position: relative;
}

.loading-orbit::before,
.loading-orbit::after,
.loading-orbit span {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent-2);
  border-radius: 50%;
}

.loading-orbit::before {
  border-top-color: var(--accent);
  animation: orbit 1.2s linear infinite;
}

.loading-orbit::after {
  inset: 9px;
  border-right-color: var(--accent);
  animation: orbit 1.8s linear infinite reverse;
}

.loading-orbit span {
  inset: 23px;
  border: 0;
  background: var(--accent);
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

.loading-progress {
  height: 3px;
  max-width: 260px;
  margin: 30px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-2);
}

.loading-progress span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: loading-progress 1.4s ease-in-out infinite;
}

@keyframes loading-progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.035em;
  font-size: 29px;
}

.text-button {
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  padding: 4px 0;
  white-space: nowrap;
}

.text-button:hover { text-decoration: underline; }

.section-help {
  color: var(--ink-soft);
  margin: -2px 0 22px;
  line-height: 1.55;
  font-size: 14px;
}

.section-help.compact { margin-top: 6px; margin-bottom: 17px; }

.field-list { display: grid; gap: 13px; }

.field {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 220px);
  grid-template-areas:
    "name select"
    "help select";
  column-gap: 18px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.field:last-child { border-bottom: none; }

.field-name {
  grid-area: name;
  font-weight: 700;
  font-size: 15px;
}

.field-help {
  grid-area: help;
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 3px;
}

.field select {
  grid-area: select;
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 38px 13px 13px;
  background:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%) calc(100% - 17px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%) calc(100% - 13px) 50% / 6px 6px no-repeat,
    #fffdf9;
  color: var(--ink);
  font-weight: 600;
  outline: none;
}

.field select:focus {
  border-color: rgba(49,95,137,.55);
  box-shadow: 0 0 0 4px rgba(49,95,137,.10);
}

.pension-field-note {
  margin: -5px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: rgba(49,95,137,.08);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.pension-field-note strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-dark);
  font-size: 12px;
}

.single-field { border-bottom: none; padding-bottom: 8px; }

.divider {
  height: 1px;
  background: var(--line);
  margin: 26px 0;
}

.input-panel h3 {
  margin: 0;
  font-size: 20px;
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.02em;
}

.toggle-row {
  margin-top: 14px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(49,95,137,.07);
}

.child-benefit-line {
  grid-template-columns: 42px 1fr;
  grid-template-areas: "toggle copy";
  align-items: center;
  column-gap: 12px;
  padding: 16px 0 4px;
  border-bottom: none;
  cursor: pointer;
}

.child-benefit-line > input {
  grid-area: toggle;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.child-benefit-line > .toggle-ui {
  grid-area: toggle;
}

.child-benefit-line > input:checked + .toggle-ui {
  background: var(--accent);
}

.child-benefit-line > input:checked + .toggle-ui::after {
  transform: translateX(18px);
}

.child-benefit-line > input:focus-visible + .toggle-ui {
  outline: 3px solid rgba(49,95,137,.24);
  outline-offset: 3px;
}

.child-benefit-line > span:last-child {
  grid-area: copy;
}

.child-benefit-line .field-name,
.child-benefit-line .field-help {
  display: block;
}

.child-benefit-line .field-name {
  font-size: 14px;
}

.child-benefit-line .field-help {
  margin-top: 3px;
}

.toggle {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-ui {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #c9cdc9;
  position: relative;
  transition: .2s ease;
  margin-top: 2px;
}

.toggle-ui::after {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.16);
  transition: .2s ease;
}

.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); }

.toggle strong { display: block; font-size: 14px; }
.toggle small { display: block; color: var(--ink-soft); line-height: 1.45; margin-top: 3px; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: 13px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent-dark);
  color: white;
  flex: 1;
}

.primary-button:hover { background: #153b5e; }

.secondary-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.reserve-card {
  border-radius: var(--radius-lg);
  background: #142b45;
  color: #f8f4ea;
  padding: 25px;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}

.reserve-card::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -105px;
  top: -100px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 0 24px rgba(255,255,255,.03), 0 0 0 48px rgba(255,255,255,.02);
}

.reserve-card .result-kicker { color: #bfd2e4; position: relative; z-index: 1; }

.reserve-amount {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 8px;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  letter-spacing: -0.06em;
  font-size: clamp(56px, 7vw, 86px);
  line-height: 1;
  position: relative;
  z-index: 1;
}

.currency { font-size: .5em; opacity: .8; }

.range-copy {
  color: #d4e0eb;
  margin: 13px 0 0;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.mini-rule {
  height: 1px;
  background: rgba(255,255,255,.14);
  margin: 20px 0 16px;
  position: relative;
  z-index: 1;
}

.reserve-explainer {
  margin: 0;
  color: #c8d7e5;
  font-size: 12px;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

.result-card,
.insight-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 12px;
  background: rgba(255,255,255,.52);
}

.result-card-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.result-card strong {
  font-family: "Manrope", sans-serif;
  font-size: 24px;
  letter-spacing: -0.035em;
  text-align: right;
}

.result-copy {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.payment-amount-grid {
  display: grid;
  gap: 0;
  margin: 14px 0 4px;
}

.payment-amount {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.payment-amount:first-child {
  border-top: 1px solid var(--line);
}

.payment-amount > span {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.35;
}

.payment-amount strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -0.06em;
  line-height: 1;
}

.payment-amount strong span {
  display: inline;
}

.insight-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
  display: grid;
  gap: 9px;
  font-size: 13px;
  line-height: 1.48;
}

.method-note {
  margin-top: 16px;
  padding: 14px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.why-section {
  max-width: 820px;
  padding: 30px 0 82px;
}

.results-panel .why-section {
  max-width: none;
  margin-top: 28px;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
}

.results-panel .why-section h2 {
  font-size: clamp(30px, 4vw, 48px);
}

.why-section h2 { font-size: clamp(38px, 5vw, 62px); }

.why-section p:last-child {
  max-width: 680px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.6;
}

.results-cta-copy {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 600;
}

.waitlist-area {
  margin-top: 20px;
}

.waitlist-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--accent-2);
  border-radius: 13px;
  padding: 12px 16px;
  background: var(--accent-2);
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.waitlist-button:hover {
  background: #c6d8e8;
  border-color: #c6d8e8;
}

footer {
  min-height: 82px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

@media (max-width: 900px) {
  .calculator-grid,
  .calculator-grid:not(.results-mode),
  .calculator-grid.results-mode { grid-template-columns: 1fr; }
  .results-panel { position: static; }
  .hero { padding-top: 52px; }
}

@media (max-width: 620px) {
  .page-shell { width: min(100% - 24px, 1180px); }
  .topbar { min-height: 76px; }
  .return-link { font-size: 12px; }
  .demo-chip { display: none; }
  .hero { padding: 42px 0 32px; }
  .hero h1 { font-size: 44px; }
  .hero-copy { font-size: 17px; }
  .input-panel, .results-panel, .calculation-state { padding: 20px; border-radius: 22px; }
  .field {
    grid-template-columns: 1fr;
    grid-template-areas: "name" "help" "select";
    gap: 4px;
  }
  .field select { margin-top: 8px; }
  .panel-heading { flex-direction: column; }
  .result-actions { justify-content: flex-start; }
  .form-actions { flex-direction: column; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 20px 0; }
}
