/* ============================================================================
   Wardlow Estate Law — MasaCMS Theme
   Design system: "Ink & Paper, with Continuity"
   ----------------------------------------------------------------------------
   Fonts loaded in <head>: Fraunces (display serif), Public Sans (civic body).
   ========================================================================== */

:root {
  /* Colour ---------------------------------------------------------------- */
  --ink:        #1C2B27;   /* deep green-black text                          */
  --ink-soft:   #43514B;   /* secondary text                                */
  --eucalypt:   #3E5C50;   /* lead brand — muted deep eucalyptus            */
  --eucalypt-d: #2C4238;   /* darker brand for footers/hover                */
  --sage:       #8CA598;   /* soft sage for borders / quiet accents         */
  --sage-tint:  #DDE4DD;   /* pale sage panel                               */
  --paper:      #F5F1E8;   /* warm ivory page                               */
  --paper-2:    #EFEADD;   /* slightly deeper panel                         */
  --paper-line: #E2DBC9;   /* ledger hairline                               */
  --brass:      #B08A4F;   /* restrained brass — "the seal"                 */
  --brass-d:    #94713A;
  --claret:     #6B2E3A;   /* rare deep emphasis / wax seal                 */
  --white:      #FFFDF8;

  /* Type ------------------------------------------------------------------ */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body:    "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Scale ----------------------------------------------------------------- */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.55rem, 1.35rem + 1vw, 2.15rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.1rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.4vw, 4.4rem);

  --wrap: 1180px;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(28,43,39,.06), 0 12px 32px -18px rgba(28,43,39,.28);
}

/* Reset ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  /* faint paper grain via layered gradients, no image needed */
  background-image:
    radial-gradient(circle at 20% 12%, rgba(176,138,79,.05), transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(62,92,80,.05), transparent 40%);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--eucalypt); text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.08; color: var(--ink); }
h1 { font-size: var(--step-4); letter-spacing: -.01em; }
h2 { font-size: var(--step-3); letter-spacing: -.01em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p  { max-width: 62ch; }

.wrap { width: min(100% - 3rem, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 3rem, 760px); margin-inline: auto; }

/* Eyebrow / structural label ---------------------------------------------- */
.eyebrow {
  font-family: var(--body);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brass-d);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--brass);
  display: inline-block;
}

/* Buttons ----------------------------------------------------------------- */
.btn {
  --_bg: var(--eucalypt);
  --_fg: var(--white);
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--body); font-weight: 700; font-size: var(--step--1);
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--_fg); background: var(--_bg);
  border: 1px solid var(--_bg);
  padding: .95em 1.7em; border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover { background: var(--eucalypt-d); border-color: var(--eucalypt-d); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
.btn--ghost { --_bg: transparent; --_fg: var(--ink); border-color: var(--sage); }
.btn--ghost:hover { --_bg: var(--sage-tint); border-color: var(--eucalypt); transform: translateY(-2px); }
.btn--brass { --_bg: var(--brass); border-color: var(--brass); }
.btn--brass:hover { background: var(--brass-d); border-color: var(--brass-d); }
.btn--lg { padding: 1.1em 2.2em; font-size: var(--step-0); text-transform: none; letter-spacing: .01em; }

/* ============================================================================
   HEADER
   ========================================================================== */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: rgba(245,241,232,.86);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--paper-line);
}
.site-head__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; padding-block: .85rem;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand__seal { flex: none; width: 40px; height: 40px; }
.brand__name { font-family: var(--display); font-size: 1.35rem; line-height: 1; }
.brand__name b { font-weight: 500; }
.brand__kicker {
  display: block; font-family: var(--body); font-size: .62rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--brass-d); margin-top: 3px;
}
.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav a {
  font-size: var(--step--1); font-weight: 600; letter-spacing: .02em;
  color: var(--ink-soft); text-decoration: none;
}
.nav a:hover { color: var(--eucalypt); }
.nav__cta { margin-left: .4rem; }
.nav-toggle { display: none; }

/* ============================================================================
   HERO
   ========================================================================== */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 8vw, 7rem); }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.hero__eyebrow { margin-bottom: 1.4rem; }
.hero h1 { margin-bottom: 1.3rem; }
.hero h1 em { font-style: italic; color: var(--eucalypt); }
.hero__lead { font-size: var(--step-1); color: var(--ink-soft); max-width: 46ch; margin-bottom: 2rem; line-height: 1.5; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.hero__note { font-size: var(--step--1); color: var(--ink-soft); display: flex; align-items: center; gap: .5rem; }

/* The signature: an engraved deed panel */
.deed {
  position: relative; background: var(--white);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 2.2rem 2.2rem 2.4rem;
  box-shadow: var(--shadow);
}
.deed::before {
  /* double-rule border reminiscent of an engraved certificate */
  content: ""; position: absolute; inset: 10px;
  border: 1px solid var(--sage); border-radius: 1px; pointer-events: none;
}
.deed__head { text-align: center; border-bottom: 1px solid var(--paper-line); padding-bottom: 1.1rem; margin-bottom: 1.3rem; }
.deed__title { font-family: var(--display); font-size: 1.5rem; letter-spacing: .02em; }
.deed__sub { font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: var(--brass-d); margin-top: .35rem; }
.deed__list { list-style: none; padding: 0; display: grid; gap: .1rem; }
.deed__list li { display: flex; align-items: center; gap: .85rem; padding: .7rem 0; border-bottom: 1px dashed var(--paper-line); }
.deed__list li:last-child { border-bottom: 0; }
.deed__list svg { flex: none; color: var(--eucalypt); }
.deed__list b { font-weight: 700; }
.deed__list span { font-size: var(--step--1); color: var(--ink-soft); display: block; }
.deed__seal {
  position: absolute; right: -18px; bottom: -18px; width: 84px; height: 84px;
  filter: drop-shadow(0 6px 10px rgba(107,46,58,.28));
}

/* ============================================================================
   INSTRUMENTS (the three documents)
   ========================================================================== */
.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section--paper2 { background: var(--paper-2); border-block: 1px solid var(--paper-line); }
.section__head { max-width: 60ch; margin-bottom: 2.8rem; }
.section__head h2 { margin: .8rem 0 1rem; }
.section__head p { color: var(--ink-soft); font-size: var(--step-1); line-height: 1.5; }

.instruments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.instrument {
  background: var(--white); border: 1px solid var(--paper-line);
  border-radius: var(--radius); padding: 2rem 1.8rem;
  display: flex; flex-direction: column; gap: .9rem;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.instrument:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sage); }
.instrument__num { font-family: var(--display); font-size: .95rem; color: var(--brass); letter-spacing: .1em; }
.instrument__icon { width: 46px; height: 46px; color: var(--eucalypt); }
.instrument h3 { font-size: var(--step-1); }
.instrument p { font-size: var(--step-0); color: var(--ink-soft); flex: 1; }
.instrument__link { font-weight: 700; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.instrument__link::after { content: "→"; transition: transform .2s ease; }
.instrument:hover .instrument__link::after { transform: translateX(4px); }

/* ============================================================================
   PROCESS (real 4-step sequence — numbering earns its place here)
   ========================================================================== */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; }
.process__step { position: relative; padding: 0 1.6rem; }
.process__step + .process__step { border-left: 1px solid var(--paper-line); }
.process__num {
  font-family: var(--display); font-size: 2.6rem; color: var(--eucalypt);
  line-height: 1; display: block; margin-bottom: .8rem;
}
.process__step h4 { margin-bottom: .5rem; font-size: var(--step-1); }
.process__step p { font-size: var(--step-0); color: var(--ink-soft); }

/* ============================================================================
   ASSURANCE / TRUST strip
   ========================================================================== */
.assure { background: var(--eucalypt-d); color: var(--paper); }
.assure .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem,5vw,4rem); align-items: center; padding-block: clamp(3rem,6vw,5rem); }
.assure h2 { color: var(--white); margin-bottom: 1rem; }
.assure p { color: rgba(245,241,232,.82); }
.assure__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.stat { border-top: 1px solid rgba(140,165,152,.4); padding-top: 1rem; }
.stat b { font-family: var(--display); font-size: var(--step-3); color: var(--brass); display: block; line-height: 1; }
.stat span { font-size: var(--step--1); letter-spacing: .04em; color: rgba(245,241,232,.75); }

/* ============================================================================
   CALL TO ACTION band
   ========================================================================== */
.cta-band { text-align: center; }
.cta-band h2 { margin-bottom: 1rem; }
.cta-band p { margin: 0 auto 2rem; color: var(--ink-soft); font-size: var(--step-1); }

/* ============================================================================
   FOOTER
   ========================================================================== */
.site-foot { background: var(--ink); color: rgba(245,241,232,.72); padding-block: 3.5rem 2rem; }
.site-foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.site-foot h5 { font-family: var(--body); font-weight: 700; font-size: var(--step--1); letter-spacing: .12em; text-transform: uppercase; color: var(--brass); margin-bottom: 1rem; }
.site-foot a { color: rgba(245,241,232,.72); text-decoration: none; display: block; padding: .28rem 0; }
.site-foot a:hover { color: var(--white); }
.site-foot__brand p { font-size: var(--step--1); line-height: 1.6; margin-top: 1rem; max-width: 34ch; }
.site-foot__legal { border-top: 1px solid rgba(245,241,232,.14); margin-top: 2.5rem; padding-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: var(--step--1); }
.site-foot__legal p { max-width: none; }

/* ============================================================================
   FORM WIZARD  (create-documents page)
   ========================================================================== */
.wizard { padding-block: clamp(2rem, 5vw, 4rem); }
.wizard__layout { display: grid; grid-template-columns: 260px 1fr; gap: clamp(2rem,4vw,3.5rem); align-items: start; }

/* progress rail */
.rail { position: sticky; top: 90px; }
.rail ol { list-style: none; padding: 0; display: grid; gap: .2rem; }
.rail li { display: flex; gap: .9rem; padding: .7rem .6rem; border-radius: var(--radius); align-items: flex-start; }
.rail li[data-state="active"] { background: var(--white); border: 1px solid var(--paper-line); }
.rail__dot { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--sage); display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--ink-soft); background: var(--paper); }
.rail li[data-state="active"] .rail__dot { background: var(--eucalypt); color: var(--white); border-color: var(--eucalypt); }
.rail li[data-state="done"] .rail__dot { background: var(--brass); color: var(--white); border-color: var(--brass); }
.rail__label b { display: block; font-size: var(--step--1); }
.rail__label span { font-size: .74rem; color: var(--ink-soft); }

/* form panel styled like a drawn deed */
.form-deed { background: var(--white); border: 1px solid var(--paper-line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.form-deed__head { padding: 1.6rem 2rem; border-bottom: 1px solid var(--paper-line); background: var(--paper-2); }
.form-deed__head .eyebrow { margin-bottom: .5rem; }
.form-deed__head h2 { font-size: var(--step-2); }
.form-deed__head p { font-size: var(--step-0); color: var(--ink-soft); margin-top: .4rem; }
.form-deed__body { padding: 2rem; }

.fieldset { border: 0; padding: 0; margin: 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 1.4rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: var(--step--1); font-weight: 700; letter-spacing: .02em; }
.field label .req { color: var(--claret); }
.field .hint { font-size: .78rem; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font-family: var(--body); font-size: var(--step-0); color: var(--ink);
  background: var(--paper); border: 1px solid var(--paper-line);
  border-radius: var(--radius); padding: .75em .85em; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--eucalypt); background: var(--white);
  box-shadow: 0 0 0 3px rgba(62,92,80,.12);
}
.field textarea { min-height: 110px; resize: vertical; }

.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--paper-line); }
.step { display: none; }
.step[data-active="true"] { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.notice {
  display: flex; gap: .9rem; background: var(--sage-tint); border: 1px solid var(--sage);
  border-radius: var(--radius); padding: 1rem 1.2rem; font-size: var(--step--1); color: var(--ink-soft);
}
.notice svg { flex: none; color: var(--eucalypt); }

/* repeatable person block (executors, beneficiaries) */
.person-card { border: 1px dashed var(--paper-line); border-radius: var(--radius); padding: 1.3rem; margin-bottom: 1rem; background: var(--paper); }
.person-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.person-card__head b { font-family: var(--display); font-size: var(--step-1); }
.btn-remove { background: none; border: 0; color: var(--claret); font-weight: 700; font-size: var(--step--1); cursor: pointer; }
.btn-add { background: none; border: 1px dashed var(--sage); color: var(--eucalypt); font-weight: 700; padding: .8em 1.2em; border-radius: var(--radius); cursor: pointer; width: 100%; letter-spacing: .02em; }
.btn-add:hover { background: var(--sage-tint); }

/* review summary */
.review-group { border: 1px solid var(--paper-line); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.review-group h4 { background: var(--paper-2); padding: .85rem 1.1rem; font-family: var(--body); font-weight: 700; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em; display: flex; justify-content: space-between; }
.review-group dl { margin: 0; padding: 1.1rem; display: grid; grid-template-columns: 200px 1fr; gap: .5rem 1rem; }
.review-group dt { font-weight: 700; font-size: var(--step--1); }
.review-group dd { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }

/* ============================================================================
   AUTH (sign-up / sign-in)
   ========================================================================== */
.auth { min-height: 70vh; display: grid; place-items: center; padding-block: 3rem; }
.auth__card { width: min(100% - 3rem, 460px); }
.auth__card .form-deed__body { padding: 2rem; }
.auth__alt { text-align: center; font-size: var(--step--1); color: var(--ink-soft); margin-top: 1.4rem; }

/* ============================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .instruments { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr 1fr; gap: 2rem 0; }
  .process__step + .process__step { border-left: 0; }
  .assure .wrap { grid-template-columns: 1fr; }
  .site-foot__grid { grid-template-columns: 1fr 1fr; }
  .wizard__layout { grid-template-columns: 1fr; }
  .rail { position: static; }
  .rail ol { grid-auto-flow: column; overflow-x: auto; }
}
@media (max-width: 680px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--paper); border-bottom: 1px solid var(--paper-line); padding: .5rem 1.5rem 1.5rem; }
  .nav.is-open { display: flex; }
  .nav a { padding: .9rem 0; border-bottom: 1px solid var(--paper-line); }
  .nav__cta { margin: 1rem 0 0; }
  .nav-toggle { display: inline-flex; background: none; border: 1px solid var(--sage); border-radius: var(--radius); padding: .5rem .7rem; cursor: pointer; }
  .field-grid { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
  .site-foot__grid { grid-template-columns: 1fr; }
  .review-group dl { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}

/* Focus visibility everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brass); outline-offset: 2px;
}
