/* ===========================================================================
   Just Married: legal & financial admin checklist
   Part of Niggly Stuff.

   Design system inherited verbatim from the Niggly Stuff house style
   (Life Assignment tool): same accent, warm-cream canvas, system font stack,
   12px radius, 720px column, .step / .notice-box / .will-tile / .btn patterns.

   Additions specific to this tool (all documented inline):
   - .alert  : a higher-weight warning block for the Wills Act s.18 revocation
               warning, which must read louder than an amber notice.
   - .checklist / .check-item : tickable, shrink-as-you-go action lists.
   - .result-block / .stat : the action-pack layout (the hero of the page).
   =========================================================================== */

:root {
  --accent: #1D5C96;
  --accent-dark: #164A7A;
  --accent-light: #e8f0f8;
  --ink: #26302c;
  --ink-soft: #57635c;
  --bg: #fbf9f5;
  --card-bg: #ffffff;
  --border: #e2ded4;
  --warn-bg: #fff6e5;
  --warn-border: #e9c46a;

  /* Additions for this tool */
  --alert-bg: #fdece9;          /* warm red, sits with the cream canvas */
  --alert-border: #d9584a;
  --alert-ink: #8a2a1f;
  --alert-accent: #c0392b;
  --ok: #2e7d55;                /* completed / positive money figures */
  --ok-bg: #eaf5ee;

  --radius: 12px;
  --max-width: 720px;
  font-size: 17px;
}

* { box-sizing: border-box; }

/* Visually hidden but available to screen readers (step announcements). */
.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;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  padding: 18px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-dark);
  text-decoration: none;
}
.brand .logo-mark { flex: none; display: block; }
.brand-text { line-height: 1.1; }
.brand-sub { font-weight: 400; color: var(--ink-soft); font-size: 0.95rem; }

.app-shell { padding: 32px 20px 80px; }

.progress {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 28px;
  overflow: hidden;
}
.progress::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--progress-pct, 0%);
  background: var(--accent);
  transition: width 0.3s ease;
}

h1 { font-size: 1.7rem; margin: 0 0 12px; color: var(--accent-dark); }
h2 { font-size: 1.35rem; margin: 0 0 16px; color: var(--accent-dark); }
h3 { font-size: 1.1rem; margin: 0 0 10px; color: var(--accent-dark); }
.lede { font-size: 1.05rem; color: var(--ink-soft); margin-bottom: 20px; }
.hint { color: var(--ink-soft); font-size: 0.95rem; margin-top: -8px; }
.jurisdiction {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* ---------- Notices ---------- */
.notice-box {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.notice-box--muted {
  background: var(--accent-light);
  border-color: var(--border);
}
.notice-box p:last-child { margin-bottom: 0; }
.notice-box p:first-child { margin-top: 0; }

/* ---------- Form fields ---------- */
.field { display: block; margin-bottom: 18px; }
.field > span, fieldset.field legend {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
fieldset.field { border: none; padding: 0; margin: 0 0 22px; }

input[type="text"], input[type="date"], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--ink);
  margin-bottom: 8px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Radio / checkbox option rows */
.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.option:hover { border-color: var(--accent); }
.option input { width: auto; margin: 3px 0 0; flex: none; }
.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}
.option-text { display: flex; flex-direction: column; gap: 2px; }
.option-text strong { font-weight: 600; }
.option-text small { color: var(--ink-soft); font-size: 0.85rem; line-height: 1.4; }

/* Steps get focus moved to their heading on navigation; that focus is a
   programmatic cue, not something the user tabbed to, so don't ring it. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }

/* Visible keyboard focus for all interactive controls. */
.btn:focus-visible,
.brand:focus-visible,
.check-item:focus-within,
[data-action]:focus-visible {
  outline: 3px solid var(--accent-dark);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: transparent; color: var(--accent-dark); border: 1px solid var(--border); }
.btn-tertiary { background: var(--accent-light); color: var(--accent-dark); }

.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  gap: 12px;
}

.inline-error {
  color: var(--alert-accent);
  font-size: 0.9rem;
  margin: 4px 0 12px;
  font-weight: 600;
}

/* ===========================================================================
   RESULTS: the action pack. This is the hero of the page.
   =========================================================================== */
.results-intro { margin-bottom: 8px; }
.results-summary {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin-bottom: 24px;
}

.result-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  background: var(--card-bg);
}
.result-block > h3:first-child { margin-top: 0; }
.result-block ul { padding-left: 20px; margin: 8px 0; }
.result-block li { margin-bottom: 6px; }
.result-block .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  margin-bottom: 10px;
}
.result-block .tag--good { background: var(--ok-bg); color: var(--ok); }

/* ---------- The upside: spousal tax reliefs ---------- */
.upside-block { border-color: #cfe6d8; background: linear-gradient(180deg, var(--ok-bg) 0%, var(--card-bg) 60%); }
.upside-list { padding-left: 20px; margin: 10px 0; }
.upside-list li { margin-bottom: 9px; }

/* ---------- The Wills Act s.18 alert: highest-consequence item ---------- */
.alert {
  border: 2px solid var(--alert-border);
  border-left-width: 8px;
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 24px;
  background: var(--alert-bg);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(192, 57, 43, 0.12);
}
.alert__flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--alert-accent);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.alert h2, .alert h3 { color: var(--alert-ink); }
.alert h2 { font-size: 1.45rem; margin: 0 0 12px; }
.alert p { margin: 0 0 12px; }
.alert p:last-child { margin-bottom: 0; }
.alert strong { color: var(--alert-ink); }
.alert .legal-cite {
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid rgba(217, 88, 74, 0.35);
  padding-top: 12px;
  margin-top: 6px;
}
.alert .children-flag {
  background: #fff;
  border: 1px solid var(--alert-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 0.95rem;
}

/* ---------- Will CTA (paid Fit to Retire product) ---------- */
.will-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0 4px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background .15s ease, transform .08s ease;
}
.will-tile:hover { background: var(--accent-dark); }
.will-tile:active { transform: translateY(1px); }
.will-tile:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }
.will-tile__icon {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 1.4rem;
  background: rgba(255, 255, 255, .16);
  border-radius: 10px;
}
.will-tile__body { display: flex; flex-direction: column; gap: 3px; }
.will-tile__title { font-weight: 700; font-size: 1.05rem; }
.will-tile__ext { font-size: .82em; opacity: .85; }
.will-tile__desc { font-size: .92rem; color: rgba(255, 255, 255, .92); line-height: 1.45; }
.will-tile__price {
  font-size: .82rem;
  color: rgba(255,255,255,.9);
  margin-top: 2px;
}
.paid-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 6px 2px 0;
}

/* ---------- Money stats (Marriage Allowance) ---------- */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0;
}
.stat {
  flex: 1 1 140px;
  background: var(--ok-bg);
  border: 1px solid #cfe6d8;
  border-radius: 10px;
  padding: 14px 16px;
}
.stat__value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ok);
  line-height: 1.1;
}
.stat__label { font-size: 0.82rem; color: var(--ink-soft); margin-top: 4px; }
.deadline-line {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  margin: 12px 0;
}
.deadline-line strong { color: var(--alert-ink); }

/* ---------- Tickable checklists (name change, pensions) ---------- */
.checklist { list-style: none; padding: 0; margin: 12px 0 0; counter-reset: step; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.check-item:last-child { border-bottom: none; }
.check-item input[type="checkbox"] {
  width: 22px; height: 22px;
  flex: none;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.check-item__body { flex: 1; }
.check-item__title { font-weight: 600; }
.check-item__meta, .check-item__meta-wrap { font-size: 0.88rem; color: var(--ink-soft); }
.check-item__meta-wrap { display: block; margin-top: 3px; }
.check-item__meta-wrap .check-item__meta { display: block; }
.check-item__facts {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--accent-light);
  border-radius: 8px;
  font-size: 0.83rem;
  line-height: 1.5;
}
.check-item__facts span { display: block; }
.check-item__facts strong { color: var(--ink); }
.check-item__link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-dark);
}
.pack-cta {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.pdf-status {
  margin: 4px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ok);
}
.pdf-status:empty { display: none; }
.check-item--done .check-item__title {
  text-decoration: line-through;
  color: var(--ink-soft);
}
.check-item--done { opacity: 0.62; }
.check-progress {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-light);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  display: inline-block;
}

/* ---------- Cross-tool handoff note (e.g. Assign a Life Policy) ---------- */
.handoff-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0 4px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.handoff-note__icon { font-size: 1.3rem; flex: none; line-height: 1.3; }
.handoff-note__body { display: block; }
.handoff-note a { color: var(--accent-dark); font-weight: 600; }

/* ---------- Fane escalation ---------- */
.adviser-cta {
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 14px 0 6px;
}
.adviser-cta p { margin: 0 0 12px; }
.adviser-cta .regbar {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 12px 0 0;
  line-height: 1.45;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 8px;
  align-items: center;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 40px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.site-footer p { margin: 0 0 8px; }

@media (max-width: 480px) {
  :root { font-size: 16px; }
  .step-nav { flex-direction: column-reverse; align-items: stretch; }
  .btn { text-align: center; }
  .result-actions .btn { width: 100%; text-align: center; }
}
