/* =====================================================================
   MAGNOLIA HILLS — MULTISTEP APPLICATION STYLES (shared)
   ---------------------------------------------------------------------
   Everything here is prefixed .af- and loaded only by pages that carry a
   multistep application, so no existing page is affected. Colours and
   type come from the site's existing tokens — nothing new is introduced.
   ===================================================================== */

.af-wrap { display: grid; grid-template-columns: 250px 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.af-wrap > * { min-width: 0; }

/* ---------- Progress rail ---------- */
.af-progress { position: sticky; top: 140px; }
.af-progress-bar { height: 3px; background: var(--taupe-line); border-radius: 2px; overflow: hidden; margin-bottom: 20px; }
.af-progress-fill { display: block; height: 100%; background: var(--gold); width: 0; transition: width .45s var(--ease); }
.af-progress-count { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--taupe); font-weight: 500; margin-bottom: 16px; }
.af-steps { display: grid; gap: 2px; list-style: none; padding: 0; margin: 0; }
.af-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: .9rem; color: var(--taupe); transition: color var(--t); }
.af-dot { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--taupe-line); display: grid; place-items: center; font-size: .72rem; font-weight: 500; flex-shrink: 0; transition: all var(--t); }
.af-steps li.is-done { color: var(--ink-soft); }
.af-steps li.is-done .af-dot { background: var(--green); border-color: var(--green); color: var(--cream); }
.af-steps li.is-current { color: var(--ink); font-weight: 500; }
.af-steps li.is-current .af-dot { background: var(--midnight); border-color: var(--midnight); color: var(--gold-pale); }

/* ---------- Panel ---------- */
.af-panel { background: var(--cream); border: 1px solid var(--taupe-line); border-radius: var(--radius-lg); padding: clamp(22px, 3.5vw, 40px); box-shadow: var(--shadow); }
.af-panel-head { margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--taupe-line); }
.af-panel-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 8px; }
.af-panel-head p { margin: 0; color: var(--ink-soft); font-size: .98rem; line-height: 1.6; }
.af-panel-head strong { color: var(--ink); font-weight: 500; }
.af-note { border-left: 2px solid var(--gold); background: var(--ivory); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; margin-bottom: 26px; font-size: .93rem; color: var(--ink-soft); line-height: 1.6; }
.af-note p { margin: 0 0 .6em; }
.af-note p:last-child { margin-bottom: 0; }
.af-note strong { color: var(--ink); font-weight: 500; }

/* ---------- Fields ---------- */
.af-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; }
.af-field-grid .af-full { grid-column: 1 / -1; }
.af-help { font-size: .82rem; color: var(--taupe); line-height: 1.45; margin-top: -2px; }
.af-err { display: block; font-size: .78rem; color: #A8402F; margin-top: 4px; font-weight: 500; }
.af-invalid input, .af-invalid select, .af-invalid textarea { border-color: #A8402F; }
.af-field > span:first-child, .af-field > label { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; color: var(--ink-soft); }
.af-field b { color: var(--gold-deep); font-weight: 500; }

/* Radios */
.af-radios { display: grid; gap: 8px; margin-top: 4px; }
.af-radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--taupe-line); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color var(--t), background var(--t); }
.af-radio:hover { border-color: var(--gold); }
.af-radio input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex-shrink: 0; }
.af-radio span { font-size: .96rem; }
.af-radio:has(input:checked) { border-color: var(--green); background: rgba(38,56,43,.05); }

/* Radio cards */
.af-cards { display: grid; gap: 10px; }
.af-card { display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; padding: 18px 20px; border: 1px solid var(--taupe-line); border-radius: var(--radius-lg); background: #fff; cursor: pointer; transition: border-color var(--t), background var(--t), transform var(--t); }
.af-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.af-card input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--green); }
.af-card b { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.af-card small { display: block; font-size: .87rem; color: var(--ink-soft); margin-top: 2px; }
.af-card:has(input:checked) { border-color: var(--green); background: rgba(38,56,43,.05); box-shadow: var(--shadow); }

/* Checkbox group (chips) */
.af-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.af-chip-check { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border: 1px solid var(--taupe-line); border-radius: 999px; background: #fff; cursor: pointer; font-size: .88rem; transition: border-color var(--t), background var(--t); }
.af-chip-check:hover { border-color: var(--gold); }
.af-chip-check input { width: 16px; height: 16px; accent-color: var(--green); }
.af-chip-check:has(input:checked) { border-color: var(--green); background: rgba(38,56,43,.06); }

/* Scale */
.af-scale { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.af-scale-end { font-size: .76rem; color: var(--taupe); flex: 0 1 auto; max-width: 40%; }
.af-scale-step { cursor: pointer; }
.af-scale-step input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.af-scale-step span { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--taupe-line); border-radius: 50%; background: #fff; font-family: var(--serif); font-size: 1.15rem; transition: all var(--t); }
.af-scale-step:hover span { border-color: var(--gold); }
.af-scale-step input:checked + span { background: var(--midnight); color: var(--gold-pale); border-color: var(--midnight); }
.af-scale-step input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Acknowledgement checkbox */
.af-check { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--taupe-line); border-radius: var(--radius); background: #fff; margin-bottom: 10px; cursor: pointer; transition: border-color var(--t); grid-column: 1 / -1; }
.af-check:hover { border-color: var(--gold); }
.af-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex-shrink: 0; }
.af-check span { font-size: .94rem; line-height: 1.55; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }
.af-check:has(input:checked) { border-color: var(--green); }
.af-check.af-invalid { border-color: #A8402F; }

/* ---------- Navigation ---------- */
.af-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--taupe-line); flex-wrap: wrap; }
.af-nav-right { display: flex; gap: 10px; align-items: center; }
.af-saved { font-size: .76rem; color: var(--taupe); letter-spacing: .06em; }

/* ---------- Review ---------- */
.af-review-group { margin-bottom: 22px; border: 1px solid var(--taupe-line); border-radius: var(--radius-lg); overflow: hidden; }
.af-review-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 18px; background: var(--ivory); border-bottom: 1px solid var(--taupe-line); }
.af-review-head h3 { font-size: 1.2rem; }
.af-review-edit { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--gold-deep); }
.af-review-edit:hover { color: var(--ink); text-decoration: underline; }
.af-review-list { display: grid; margin: 0; }
.af-review-list > div { display: grid; grid-template-columns: 260px 1fr; gap: 18px; padding: 12px 18px; border-bottom: 1px solid var(--taupe-line); font-size: .93rem; }
.af-review-list > div:last-child { border-bottom: 0; }
.af-review-list dt { color: var(--taupe); }
.af-review-list dd { margin: 0; color: var(--ink); white-space: pre-wrap; }

/* ---------- Confirmation ---------- */
.af-confirm { text-align: center; padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 48px); }
.af-seal { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; border: 1px solid var(--gold); display: grid; place-items: center; color: var(--gold-deep); }
.af-seal svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.af-confirm h2 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); margin-bottom: 10px; }
.af-number { display: inline-block; font-family: var(--sans); font-size: 1.25rem; letter-spacing: .18em; font-weight: 500; padding: 14px 26px; margin: 16px 0 6px; border: 1px solid var(--gold); border-radius: var(--radius); background: var(--midnight); color: var(--gold-pale); font-variant-numeric: tabular-nums; }
.af-number-note { font-size: .84rem; color: var(--taupe); margin-bottom: 26px; }
.af-next { list-style: none; padding: 0; text-align: left; max-width: 620px; margin: 0 auto 28px; display: grid; gap: 12px; counter-reset: nx; }
.af-next li { counter-increment: nx; position: relative; padding-left: 44px; font-size: .95rem; color: var(--ink-soft); line-height: 1.6; }
.af-next li::before { content: counter(nx); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-deep); display: grid; place-items: center; font-size: .8rem; font-weight: 500; }
.af-next strong { color: var(--ink); font-weight: 500; }

/* ---------- Status messages ---------- */
.af-status { padding: 14px 18px; border-radius: var(--radius); font-size: .92rem; margin-bottom: 18px; }
.af-status.is-error { background: rgba(168,64,47,.08); border: 1px solid rgba(168,64,47,.4); color: #8A3527; }
.af-status[hidden] { display: none; }
.af-resume { background: var(--ivory); border: 1px solid var(--gold); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.af-resume-actions { display: flex; gap: 8px; }

@media (max-width: 1024px) {
  .af-wrap { grid-template-columns: 1fr; }
  .af-progress { position: static; }
  .af-steps { display: flex; flex-wrap: wrap; gap: 6px 16px; }
  .af-steps li { padding: 4px 0; font-size: .82rem; }
}
@media (max-width: 720px) {
  .af-field-grid { grid-template-columns: 1fr; }
  .af-review-list > div { grid-template-columns: 1fr; gap: 2px; }
  .af-review-list dt { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; }
  .af-nav { flex-direction: column-reverse; align-items: stretch; }
  .af-nav .btn, .af-nav-right .btn { width: 100%; }
  .af-nav-right { flex-direction: column-reverse; align-items: stretch; }
  .af-number { font-size: 1rem; letter-spacing: .12em; padding: 12px 16px; }
  .af-scale-end { max-width: 100%; flex-basis: 100%; }
  .af-scale-step span { width: 40px; height: 40px; }
  .af-resume { flex-direction: column; align-items: stretch; }
  .af-resume-actions { flex-direction: column; }
}
