/* =========================================================================
   Ready File Portal — Shared Styles
   Extends the main site design system for the authenticated portal.
   Brand colors, typography, and components stay consistent with Phase 1.
   ========================================================================= */

:root {
  color-scheme: light;

  /* Palette — from BRANDING.md */
  --cream:        #F7F3EA;
  --soft-white:   #FFFDF8;
  --ink:          #17211B;
  --ink-soft:     #2E3A30;
  --muted:        #5E6B62;
  --sage:         #7D9277;
  --olive:        #A9B89E;
  --navy:         #243B53;
  --sand:         #E6D8C3;
  --accent:       #C97C5D;
  --accent-deep:  #B5634A;

  /* Derived */
  --line:         #E2D9C8;
  --line-soft:    #ECE5D6;
  --card-bg:      #FFFDF8;
  --card-alt:     #FCF7EC;

  --shadow-sm: 0 1px 2px rgba(34,28,16,.04), 0 2px 8px rgba(34,28,16,.05);
  --shadow-md: 0 8px 30px rgba(34,28,16,.08);
  --shadow-lg: 0 24px 70px rgba(34,28,16,.12);

  --radius-sm: 12px;
  --radius:    20px;
  --radius-lg: 28px;

  --maxw: 1140px;
  --maxw-narrow: 760px;

  /* Typography — branding guide says Source Serif 4 for headings, Inter for body */
  /* Site uses Fraunces; we keep Fraunces as primary with Source Serif 4 fallback */
  --font-head: "Fraunces", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, li, a { overflow-wrap: break-word; }
img, svg { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.08; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 .5em; }
h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: -0.015em; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.25em; }
li { margin-bottom: .5em; }
li:last-child { margin-bottom: 0; }
strong { font-weight: 650; color: var(--ink); }

/* --------------------------------------------------------------- layout */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: var(--maxw-narrow); }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--tight { padding: clamp(40px, 5vw, 64px) 0; }
.bg-soft   { background: var(--soft-white); }
.bg-cream  { background: var(--cream); }
.bg-sand   { background: var(--card-alt); }
.center { text-align: center; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 16px;
}
.eyebrow.accent { color: var(--accent-deep); }

.lead { font-size: clamp(1.1rem, 1.8vw, 1.32rem); color: var(--muted); max-width: 60ch; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 234, .82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; font-size: 1.32rem; color: var(--ink); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; flex: 0 0 auto; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a {
  font-size: .95rem; color: var(--ink-soft); font-weight: 500;
  padding: 8px 12px; border-radius: 10px;
}
.site-nav a:hover { background: rgba(125,146,119,.12); text-decoration: none; color: var(--ink); }
.site-nav .nav-cta { margin-left: 8px; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none; line-height: 1; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: #1c2f43; color: #fff; box-shadow: var(--shadow-md); }
.btn--accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--accent:hover { background: var(--accent-deep); color: #fff; box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--soft-white); border-color: var(--sand); color: var(--ink); }
.btn--soft { background: rgba(36,59,83,.07); color: var(--navy); }
.btn--soft:hover { background: rgba(36,59,83,.12); color: var(--navy); }
.btn--lg { padding: 16px 28px; font-size: 1.06rem; }
.btn--block { display: flex; width: 100%; }
.btn-group { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ------------------------------------------------------------------ cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.card {
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card__icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; margin-bottom: 18px;
  background: rgba(125,146,119,.16); color: var(--sage);
}
.card__icon.accent { background: rgba(201,124,93,.14); color: var(--accent-deep); }
.card__icon.navy { background: rgba(36,59,83,.10); color: var(--navy); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .98rem; }
.card__foot { margin-top: auto; padding-top: 18px; }
.card a.card__link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: .95rem; color: var(--navy);
}
.card a.card__link:hover { color: var(--accent-deep); text-decoration: none; }

/* ----------------------------------------------------------- auth styles */
.auth-wrap {
  min-height: calc(100vh - 70px);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(40px, 6vw, 80px) 24px;
}
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 52px);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px;
  text-align: center;
}
.auth-card h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 12px; }
.auth-card .lead { margin: 0 auto 32px; font-size: 1.08rem; }

.auth-form { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.auth-form label {
  font-size: .88rem; font-weight: 600; color: var(--ink-soft);
  margin-bottom: 6px; display: block;
}
.auth-form input[type="email"] {
  width: 100%;
  font-family: var(--font-body); font-size: 1rem;
  padding: 14px 18px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--cream);
  color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-form input[type="email"]:focus {
  outline: none; border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(125,146,119,.18);
}
.auth-form input::placeholder { color: var(--muted); opacity: .7; }
.auth-form .btn--accent { margin-top: 8px; }

.auth-note {
  margin-top: 24px; padding: 14px 18px;
  background: rgba(36,59,83,.05); border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--muted); line-height: 1.5;
}

/* ---------------------------------------------------------- dashboard */
.dash-hero {
  background: var(--soft-white);
  border-bottom: 1px solid var(--line-soft);
  padding: clamp(40px, 6vw, 64px) 0;
}
.dash-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 8px; }
.dash-hero p { color: var(--muted); font-size: 1.08rem; }

.dash-section {
  padding: clamp(40px, 5vw, 64px) 0;
}
.dash-section h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  margin-bottom: 24px;
}

/* Refresh reminder callout */
.refresh-banner {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, rgba(201,124,93,.08), rgba(230,216,195,.20));
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 40px;
}
.refresh-banner__icon {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(201,124,93,.14);
  color: var(--accent-deep);
  display: grid; place-items: center;
}
.refresh-banner__text { flex: 1; }
.refresh-banner__text h3 { font-size: 1.1rem; margin-bottom: 4px; }
.refresh-banner__text p { font-size: .92rem; color: var(--muted); margin: 0; }

/* Placeholder section */
.placeholder-section {
  background: var(--card-alt);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px; text-align: center;
  color: var(--muted);
}

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--ink); color: #C8D0C3; padding: clamp(48px, 6vw, 72px) 0 36px; margin-top: 0; }
.site-footer a { color: #DCE4D6; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; }
.site-footer h4 { font-family: var(--font-body); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: #8FA089; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; font-size: .92rem; }
.site-footer .brand { color: #fff; }
.site-footer__brand p { color: #9FB0A0; font-size: .92rem; margin-top: 12px; max-width: 34ch; }
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.10); margin-top: 40px; padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: .84rem; color: #9FB0A0;
}
.site-footer__bottom .links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------------------------------------------------------- responsive */
/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  margin-left: auto;
}
.nav-toggle:hover { background: rgba(125,146,119,.12); }
/* ------------------------------------------------------- templates page */
.new-template-banner {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(125,146,119,.12), rgba(230,216,195,.20));
  border: 1px solid var(--olive);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 32px;
}
.new-template-banner__icon {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(125,146,119,.18);
  color: var(--sage);
  display: grid; place-items: center;
}
.new-template-banner__text { flex: 1; font-size: .96rem; color: var(--ink-soft); }
.new-template-banner__text a { font-weight: 600; color: var(--navy); }
.new-template-banner__close {
  flex: 0 0 auto;
  background: none; border: none; font-size: 1.4rem; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.new-template-banner__close:hover { background: rgba(0,0,0,.06); color: var(--ink); }

.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.filter-bar__search {
  flex: 1 1 280px;
  display: flex; align-items: center; gap: 10px;
  background: var(--soft-white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--muted);
}
.filter-bar__search:focus-within {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(125,146,119,.18);
}
.filter-bar__search input {
  border: none; background: none; outline: none;
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  width: 100%;
}
.filter-bar__selects {
  display: flex; gap: 10px;
}
.filter-bar__selects select {
  font-family: var(--font-body); font-size: .92rem; font-weight: 500;
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--soft-white);
  color: var(--ink-soft); cursor: pointer;
  transition: border-color .15s ease;
}
.filter-bar__selects select:focus {
  outline: none; border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(125,146,119,.18);
}

.life-event-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 28px;
}
.chip {
  display: inline-flex; align-items: center;
  font-family: var(--font-body); font-size: .85rem; font-weight: 500;
  padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--soft-white);
  color: var(--ink-soft); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover { background: rgba(125,146,119,.10); border-color: var(--olive); }
.chip--active {
  background: var(--navy); border-color: var(--navy); color: #fff;
}

/* Template cards */
.template-card {
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column;
}
.template-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: var(--olive);
}
.template-card__badge {
  display: inline-block; align-self: flex-start;
  font-size: .74rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(125,146,119,.14); color: var(--sage);
  margin-bottom: 12px;
}
.template-card__badge.category--core-documents { background: rgba(36,59,83,.10); color: var(--navy); }
.template-card__badge.category--household-info { background: rgba(201,124,93,.12); color: var(--accent-deep); }
.template-card__badge.category--contacts { background: rgba(169,184,158,.20); color: #5a7048; }
.template-card__badge.category--checklists { background: rgba(230,216,195,.30); color: #8a7444; }
.template-card__badge.category--guides { background: rgba(36,59,83,.08); color: var(--ink-soft); }
.template-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.template-card__desc {
  color: var(--muted); font-size: .92rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 16px;
}
.template-card__meta {
  font-size: .82rem; color: var(--muted); margin-bottom: 14px;
}
.template-card__download {
  margin-top: auto;
}

.no-results {
  text-align: center; padding: 48px 24px;
  color: var(--muted); font-size: 1.02rem;
}

/* ------------------------------------------------------- progress page */
.progress-overview {
  background: var(--soft-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
}
.progress-overview__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.progress-overview__text {
  display: flex; align-items: baseline; gap: 8px;
}
.progress-overview__percent {
  font-family: var(--font-head);
  font-size: 2.2rem; font-weight: 700;
  color: var(--sage); letter-spacing: -0.03em;
}
.progress-overview__label {
  font-size: 1rem; color: var(--muted); font-weight: 500;
}
.progress-overview__actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.btn--sm {
  padding: 9px 16px; font-size: .88rem;
}
.progress-bar {
  width: 100%; height: 14px;
  background: rgba(125,146,119,.15);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--sage);
  border-radius: 999px;
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}
.progress-overview__summary {
  margin: 14px 0 0; font-size: .9rem; color: var(--muted);
}

/* Due for refresh section */
.refresh-section {
  margin-bottom: 40px;
}
.refresh-section h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.3rem; color: var(--accent-deep);
}
.refresh-section__icon { color: var(--accent-deep); }
.refresh-section__desc {
  font-size: .92rem; color: var(--muted); margin-bottom: 16px;
}
.refresh-items {
  display: flex; flex-direction: column; gap: 10px;
}
.refresh-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--soft-white);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.refresh-item__badge {
  flex: 0 0 auto;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px;
  background: rgba(201,124,93,.14); color: var(--accent-deep);
}
.refresh-item__label {
  flex: 1; font-size: .95rem; color: var(--ink);
}
.refresh-item__date {
  flex: 0 0 auto; font-size: .82rem; color: var(--muted);
}

/* Recently completed section */
.recent-section {
  margin-bottom: 40px;
}
.recent-section h2 {
  font-size: 1.3rem; color: var(--sage);
}
.recent-section__desc {
  font-size: .92rem; color: var(--muted); margin-bottom: 16px;
}
.recent-items {
  display: flex; flex-direction: column; gap: 10px;
}
.recent-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(125,146,119,.08);
  border: 1px solid var(--olive);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.recent-item__check {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--sage);
  display: grid; place-items: center;
  color: #fff;
}
.recent-item__label {
  flex: 1; font-size: .95rem; color: var(--ink);
}
.recent-item__date {
  flex: 0 0 auto; font-size: .82rem; color: var(--muted);
}

/* Accordion categories */
.accordion {
  display: flex; flex-direction: column; gap: 12px;
}
.accordion-item {
  background: var(--soft-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.accordion-item__header {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  background: none; border: none; cursor: pointer;
  padding: 18px 22px; text-align: left;
  font-family: var(--font-body); font-size: 1.05rem; font-weight: 600;
  color: var(--ink);
  transition: background .15s ease;
}
.accordion-item__header:hover {
  background: rgba(125,146,119,.06);
}
.accordion-item__chevron {
  flex: 0 0 auto;
  transition: transform .2s ease;
  color: var(--muted);
}
.accordion-item--open .accordion-item__chevron {
  transform: rotate(90deg);
}
.accordion-item__badge {
  flex: 0 0 auto;
  font-size: .78rem; font-weight: 600;
  padding: 3px 10px; border-radius: 6px;
  background: rgba(125,146,119,.14); color: var(--sage);
}
.accordion-item__title {
  flex: 1;
}
.accordion-item__body {
  display: none;
  padding: 0 22px 18px;
}
.accordion-item--open .accordion-item__body {
  display: block;
}

/* Checklist items */
.checklist-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.checklist-item:last-child {
  border-bottom: none;
}
.checklist-item--due {
  border-left: 3px solid var(--accent);
  padding-left: 12px; margin-left: -12px;
}
.checklist-item__checkbox {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border: 2px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  background: var(--cream);
  display: grid; place-items: center;
  margin-top: 1px;
}
.checklist-item__checkbox:hover {
  border-color: var(--sage);
}
.checklist-item__checkbox--checked {
  background: var(--sage);
  border-color: var(--sage);
}
.checklist-item__checkbox--checked::after {
  content: '';
  width: 6px; height: 10px;
  border: 2px solid #fff;
  border-top: 0; border-left: 0;
  transform: rotate(45deg);
  margin-top: -2px;
}
.checklist-item__label {
  flex: 1; font-size: .96rem; color: var(--ink);
  cursor: pointer; line-height: 1.5;
}
.checklist-item--checked .checklist-item__label {
  color: var(--muted);
  text-decoration: line-through;
}
.checklist-item__meta {
  display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto;
}
.checklist-item__date {
  font-size: .78rem; color: var(--muted);
}
.checklist-item__refresh-badge {
  font-size: .68rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(201,124,93,.14); color: var(--accent-deep);
}

/* ------------------------------------------------------- reminders page */
.reminder-pref-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0;
}
.reminder-pref-row__label {
  flex: 1;
}
.reminder-pref-row__label h3 {
  font-size: 1.08rem;
  margin-bottom: 4px;
}
.reminder-pref-row__label p {
  font-size: .9rem;
  color: var(--muted);
  margin: 0;
}
.reminder-divider {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 20px 0;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex: 0 0 auto;
  margin-top: 6px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  transition: background .2s ease;
}
.toggle-switch__slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  transition: transform .2s ease;
}
.toggle-switch input:checked + .toggle-switch__slider {
  background: var(--sage);
}
.toggle-switch input:checked + .toggle-switch__slider::before {
  transform: translateX(24px);
}
.toggle-switch input:focus-visible + .toggle-switch__slider {
  box-shadow: 0 0 0 3px rgba(125,146,119,.3);
}

/* Reminder select */
.reminder-select {
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--soft-white);
  color: var(--ink-soft);
  cursor: pointer;
  flex: 0 0 auto;
  min-width: 140px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.reminder-select:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(125,146,119,.18);
}

/* Email display (read-only) */
.reminder-email-display {
  font-family: var(--font-body);
  font-size: .95rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--card-alt);
  color: var(--ink-soft);
  flex: 0 0 auto;
  min-width: 200px;
}

/* Info note */
.reminder-info-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 14px 18px;
  background: rgba(36,59,83,.05);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--muted);
}
.reminder-info-note svg {
  flex: 0 0 auto;
  color: var(--navy);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23,33,27,.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line-soft);
}
.modal__header h3 {
  margin: 0;
  font-size: 1.2rem;
}
.modal__close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.modal__close:hover {
  background: rgba(0,0,0,.06);
  color: var(--ink);
}
.modal__body {
  padding: 24px 28px;
  overflow-y: auto;
}
.modal__footer {
  padding: 16px 28px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: flex-end;
}

/* Email preview */
.email-preview__field {
  margin-bottom: 18px;
  font-size: .98rem;
}
.email-preview__field strong {
  color: var(--ink);
}
.email-preview__body {
  background: var(--card-alt);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.email-preview__body pre {
  font-family: var(--font-body);
  font-size: .92rem;
  line-height: 1.6;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: toast-in .3s ease;
}
.toast svg {
  color: var(--sage);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ------------------------------------------------------- q&a page */
.qa-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.qa-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--olive);
}
.qa-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px 0;
  flex-wrap: wrap;
}
.qa-card__badge {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 10px; border-radius: 6px;
  background: rgba(125,146,119,.14); color: var(--sage);
}
.qa-card__badge.category--scope { background: rgba(36,59,83,.10); color: var(--navy); }
.qa-card__badge.category--privacy { background: rgba(201,124,93,.12); color: var(--accent-deep); }
.qa-card__badge.category--pricing { background: rgba(169,184,158,.20); color: #5a7048; }
.qa-card__featured {
  font-size: .72rem; font-weight: 600;
  color: var(--accent-deep);
}
.qa-card__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 14px 24px 16px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  transition: color .15s ease;
}
.qa-card__toggle:hover {
  color: var(--navy);
}
.qa-card__question {
  flex: 1;
}
.qa-card__chevron {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform .2s ease;
}
.qa-card--open .qa-card__chevron {
  transform: rotate(90deg);
}
.qa-card__answer {
  display: none;
  padding: 0 24px 20px;
  color: var(--ink-soft);
  font-size: .96rem;
  line-height: 1.6;
  border-top: 1px solid var(--line-soft);
}
.qa-card--open .qa-card__answer {
  display: block;
  padding-top: 16px;
}
.qa-card__answer p {
  margin: 0;
}

/* Q&A textarea focus */
#submitter-question:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(125,146,119,.18);
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav { display: none; }
  .site-nav.mobile-open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--cream); padding: 16px; border-bottom: 1px solid var(--line); gap: 4px; }
  .site-nav.mobile-open a { width: 100%; }
  .site-nav.mobile-open .nav-cta { margin-left: 0; }
}

@media (max-width: 768px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .refresh-banner { flex-direction: column; text-align: center; }
}

@media (max-width: 540px) {
  .site-footer__grid { grid-template-columns: 1fr; }
  .site-footer__bottom { flex-direction: column; text-align: center; }
}

/* -------------------------------------------------------- walkthrough cards */

.walkthrough-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
}
.walkthrough-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.walkthrough-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.walkthrough-card__thumb-icon {
  width: 56px;
  height: 56px;
  opacity: .85;
  color: #fff;
}
.walkthrough-card__thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(36,59,83,.85) 0%, rgba(125,146,119,.45) 100%);
}
.walkthrough-card__thumb-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}
.walkthrough-card__body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.walkthrough-card__badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sage);
}
.walkthrough-card__title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}
.walkthrough-card__desc {
  font-size: .92rem;
  color: var(--muted);
  margin: 0;
  flex: 1;
}
.walkthrough-card__link {
  margin-top: 4px;
}

/* -------------------------------------------------- walkthrough detail page */

.wt-breadcrumb {
  padding: 18px 0 0;
}
.wt-breadcrumb a {
  font-size: .9rem;
  color: var(--muted);
  font-weight: 500;
}
.wt-breadcrumb a:hover {
  color: var(--ink);
}

.wt-header {
  margin-bottom: 32px;
}
.wt-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}
.wt-meta__duration {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  color: var(--muted);
  font-weight: 500;
}
.wt-meta__duration::before {
  content: '\25B6';
  font-size: .7rem;
  color: var(--accent);
}

/* Video player */
.wt-player-wrapper {
  margin-bottom: 40px;
}
.wt-player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  box-shadow: var(--shadow-md);
}
.wt-player__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #fff;
}
.wt-player__placeholder-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(36,59,83,.92) 0%, rgba(125,146,119,.5) 100%);
}
.wt-player__play-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
  z-index: 1;
}
.wt-player__play-icon svg {
  width: 28px;
  height: 28px;
  margin-left: 4px;
}
.wt-player__coming-soon {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}
.wt-player__hint {
  font-size: .88rem;
  opacity: .7;
  position: relative;
  z-index: 1;
}
.wt-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Script section */
.wt-script-section {
  margin-bottom: 48px;
}
.wt-script {
  background: var(--soft-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-height: 480px;
  overflow-y: auto;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.wt-script p {
  margin-bottom: 1.2em;
}
.wt-script p:last-child {
  margin-bottom: 0;
}

/* Related section */
.wt-related-section h2 {
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 640px) {
  .wt-script {
    padding: 20px 18px;
    max-height: none;
  }
  .wt-player__play-icon {
    width: 56px;
    height: 56px;
  }
  .wt-player__coming-soon {
    font-size: 1.1rem;
  }
}

/* =========================================================================
   Info Banner (How this works)
   ========================================================================= */

.info-banner {
  display: flex;
  gap: 18px;
  background: var(--paper, #fffdf8);
  border: 1px solid var(--line, #e6ddcf);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 32px;
}

.info-banner__icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #eef2e9;
  display: grid;
  place-items: center;
  color: var(--navy, #243b53);
}

.info-banner__content h3 {
  font-family: var(--serif, "Source Serif 4", Georgia, serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--ink, #17211b);
}

.info-banner__content p {
  color: var(--muted, #5f6e65);
  line-height: 1.6;
  margin: 0 0 14px;
  font-size: 15px;
}

.info-banner__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.info-banner__list li {
  color: var(--muted, #5f6e65);
  font-size: 14px;
  padding-left: 20px;
  position: relative;
}

.info-banner__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--sage, #7d9277);
  font-weight: 800;
}

@media (max-width: 640px) {
  .info-banner {
    padding: 18px;
    gap: 14px;
  }

  .info-banner__icon {
    width: 36px;
    height: 36px;
  }

  .info-banner__content h3 {
    font-size: 18px;
  }

  .info-banner__content p {
    font-size: 14px;
  }
}
