:root {
  --navy-950: #091b2a;
  --navy-900: #10293f;
  --navy-800: #183b57;
  --navy-700: #24506f;
  --gold: #b68a3a;
  --gold-light: #e9d6ac;
  --ivory: #f7f3ea;
  --cream: #fcfaf5;
  --white: #ffffff;
  --ink: #17232e;
  --muted: #66717b;
  --line: #dfe3e6;
  --line-strong: #c5ccd1;
  --success: #217653;
  --error: #b04444;
  --shadow: 0 24px 70px rgba(20, 40, 55, 0.12);
  --radius-lg: 24px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 4%, rgba(182, 138, 58, 0.11), transparent 26rem),
    linear-gradient(135deg, #f2eee5 0%, #fbfaf6 52%, #edf2f4 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 86px;
  padding: 0 clamp(22px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(16, 41, 63, 0.1);
  background: rgba(252, 250, 245, 0.88);
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; color: inherit; text-decoration: none; }
.brand-logo { display: block; width: 265px; height: 66px; object-fit: contain; object-position: left center; mix-blend-mode: multiply; }

.privacy-badge {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 999px;
  background: #edf5f0; color: #286047; font-size: 13px; font-weight: 650;
}
.privacy-badge svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.portal-layout {
  width: min(1220px, calc(100% - 40px));
  margin: 38px auto;
  flex: 1;
  display: grid;
  grid-template-columns: 345px minmax(0, 1fr);
  min-height: 720px;
  background: var(--white);
  border: 1px solid rgba(16, 41, 63, 0.11);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 48px 38px 32px;
  color: white;
  background:
    linear-gradient(165deg, rgba(255,255,255,.05) 0 22%, transparent 22%),
    linear-gradient(145deg, var(--navy-800), var(--navy-950));
}
.sidebar::after {
  content: ""; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(233,214,172,.14);
  border-radius: 50%; right: -90px; bottom: -90px;
}
.eyebrow { color: var(--gold-light); font-size: 12px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.sidebar h1 { margin: 14px 0 13px; font: 400 30px/1.18 Georgia, serif; letter-spacing: -.02em; }
.sidebar-intro > p { margin: 0; color: rgba(255,255,255,.68); font-size: 14px; line-height: 1.65; }

.step-nav { margin: 40px 0 36px; position: relative; z-index: 1; }
.step-item {
  appearance: none; border: 0; background: transparent; width: 100%; color: rgba(255,255,255,.62);
  display: grid; grid-template-columns: 34px 1fr auto; gap: 13px; align-items: center;
  text-align: left; padding: 10px 0; cursor: pointer;
}
.step-item + .step-item { margin-top: 12px; }
.step-number {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25); font-size: 12px; font-weight: 750;
}
.step-label strong { display: block; color: inherit; font-size: 14px; }
.step-label span { display: block; font-size: 12px; margin-top: 3px; opacity: .72; }
.step-check { opacity: 0; color: var(--gold-light); font-size: 16px; }
.step-item.active { color: white; }
.step-item.active .step-number { color: var(--navy-950); background: var(--gold-light); border-color: var(--gold-light); box-shadow: 0 0 0 5px rgba(233,214,172,.09); }
.step-item.complete .step-number { font-size: 0; border-color: rgba(233,214,172,.7); }
.step-item.complete .step-number::after { content: "✓"; font-size: 13px; color: var(--gold-light); }
.step-item.complete .step-check { opacity: 1; }

.sidebar-note {
  position: relative; z-index: 1; margin-top: auto; display: flex; gap: 12px; padding: 16px;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); border-radius: 14px;
}
.note-icon { flex: 0 0 auto; width: 23px; height: 23px; display: grid; place-items: center; color: var(--navy-900); background: var(--gold-light); border-radius: 50%; font-size: 12px; font-weight: 800; }
.sidebar-note strong { display: block; font-size: 13px; }
.sidebar-note p { margin: 4px 0 0; color: rgba(255,255,255,.62); font-size: 11.5px; line-height: 1.5; }

.workspace { display: flex; flex-direction: column; min-width: 0; padding: 0 clamp(28px, 6vw, 78px) 42px; }
.workspace-toolbar { height: 68px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.workspace-toolbar > div { display: flex; align-items: center; gap: 18px; }
.mobile-step { display: none; font-size: 13px; color: var(--muted); }
.save-status { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.save-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.save-status.saving i { background: var(--gold); }
.text-button, .footer-link { border: 0; padding: 8px 0; color: var(--navy-700); background: transparent; font-weight: 700; font-size: 13px; cursor: pointer; }
.text-button:hover, .footer-link:hover { text-decoration: underline; }
.progress-track { height: 3px; margin: 0 calc(clamp(28px, 6vw, 78px) * -1); background: #eef0f1; }
.progress-track span { display: block; height: 100%; width: 25%; background: linear-gradient(90deg, var(--gold), #d1ae65); transition: width .32s ease; }

#intakeForm { flex: 1; }
.form-panel { animation: panelIn .28s ease both; max-width: 760px; margin: 0 auto; padding-top: 46px; }
@keyframes panelIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.section-kicker { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.form-panel h2 { margin: 10px 0 8px; color: var(--navy-900); font: 400 clamp(30px, 4vw, 40px)/1.15 Georgia, serif; letter-spacing: -.02em; }
.section-description { margin: 0 0 33px; max-width: 620px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 720; }
.optional { color: #90989e; font-weight: 500; }
.required { color: var(--error); margin-left: 2px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff;
  color: var(--ink); padding: 13px 14px; outline: none; transition: border-color .18s, box-shadow .18s, background .18s;
}
input, select { height: 49px; }
textarea { min-height: 118px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #9aa1a7; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 4px rgba(36,80,111,.09); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--error); background: #fffafa; }
.error-text { display: none; margin: 6px 0 0; color: var(--error); font-size: 12px; }
.field.invalid .error-text { display: block; }
.hint { margin: 7px 0 0; color: #818990; font-size: 11.5px; line-height: 1.4; }

.scope-note {
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid #ded5c1;
  border-radius: 12px;
  background: #fffcf5;
}
.scope-note strong { display: block; color: var(--navy-900); font-size: 12px; }
.scope-note p { margin: 5px 0 0; color: #68727a; font-size: 11.5px; line-height: 1.55; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.choice-card { position: relative; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card label {
  min-height: 84px; margin: 0; padding: 15px; display: block; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; cursor: pointer; transition: .18s ease;
}
.choice-card label strong { display: block; color: var(--navy-900); font-size: 13px; }
.choice-card label span { display: block; margin-top: 5px; color: var(--muted); font-size: 11.5px; line-height: 1.4; font-weight: 400; }
.choice-card input:checked + label { border-color: var(--navy-700); background: #f2f7f9; box-shadow: 0 0 0 3px rgba(36,80,111,.07); }
.choice-card input:focus-visible + label { outline: 3px solid rgba(36,80,111,.2); }

.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); }
.action-group { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; padding: 0 20px; border: 1px solid transparent; font-weight: 750; font-size: 13px; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--navy-900); box-shadow: 0 8px 20px rgba(16,41,63,.17); }
.button.primary:hover { background: var(--navy-800); box-shadow: 0 10px 24px rgba(16,41,63,.22); }
.button.secondary { color: var(--navy-800); background: #fff; border-color: var(--line-strong); }
.button.ghost { color: var(--muted); background: transparent; padding-left: 0; padding-right: 0; }

.review-grid { display: grid; gap: 14px; }
.review-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.review-card-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; background: var(--cream); border-bottom: 1px solid var(--line); }
.review-card-header h3 { margin: 0; color: var(--navy-900); font: 600 16px Georgia, serif; }
.edit-link { border: 0; background: transparent; color: var(--navy-700); font-size: 12px; font-weight: 750; cursor: pointer; }
.review-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); margin: 0; padding: 17px 18px; gap: 16px 24px; }
.review-list > div.full { grid-column: 1 / -1; }
.review-list dt { margin-bottom: 4px; color: #7e878e; font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.review-list dd { margin: 0; color: #263640; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-list dd.empty { color: #9ca3a7; font-style: italic; }
.consent-box { margin-top: 22px; padding: 17px 18px; border: 1px solid #d9cfb9; border-radius: 13px; background: #fffcf4; }
.check-row { display: grid; grid-template-columns: 20px 1fr; gap: 11px; align-items: start; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy-800); }
.check-row span { color: #3d474e; font-size: 12.5px; line-height: 1.5; }
.inline-policy { display: inline; border: 0; padding: 0; color: var(--navy-700); background: transparent; font: inherit; font-weight: 750; text-decoration: underline; cursor: pointer; }

.complete-state { max-width: 620px; margin: 0 auto; padding: 74px 0; text-align: center; animation: panelIn .3s ease both; }
.complete-icon { width: 74px; height: 74px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--success); font-size: 30px; box-shadow: 0 12px 30px rgba(33,118,83,.2); }
.complete-state h2 { margin: 0; color: var(--navy-900); font: 400 38px Georgia, serif; }
.complete-state > p { color: var(--muted); line-height: 1.65; }
.completion-card { margin: 28px 0; padding: 20px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: var(--cream); }
.completion-card strong { display: block; color: var(--navy-900); font-size: 13px; }
.completion-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.complete-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.next-steps-card { margin: 28px 0; padding: 20px; display: grid; grid-template-columns: 30px 1fr; gap: 17px 14px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: var(--cream); }
.next-steps-card > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--navy-800); font: 700 12px Georgia, serif; }
.next-steps-card strong { display: block; color: var(--navy-900); font-size: 13px; }
.next-steps-card p { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.completion-terms { max-width: 540px; margin: 18px auto 0; color: #7d858a; font-size: 10.5px; line-height: 1.5; }

footer { width: min(1220px, calc(100% - 40px)); margin: 0 auto 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #7a838a; font-size: 11.5px; }
.legal-links { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.footer-link { color: #7a838a; font-size: 11.5px; }

.legal-modal { position: fixed; z-index: 50; inset: 0; display: none; place-items: center; padding: 22px; }
.legal-modal.open { display: grid; }
.legal-backdrop { position: absolute; inset: 0; background: rgba(4,17,27,.76); backdrop-filter: blur(5px); }
.legal-card { position: relative; z-index: 1; width: min(780px, 100%); max-height: calc(100vh - 44px); overflow: auto; padding: clamp(30px, 5vw, 52px); border-radius: 20px; background: white; box-shadow: 0 30px 90px rgba(0,0,0,.35); scroll-behavior: smooth; }
.legal-card h2 { margin: 10px 0 30px; color: var(--navy-900); font: 400 clamp(29px, 4vw, 40px)/1.15 Georgia, serif; }
.legal-close { position: absolute; top: 13px; right: 15px; width: 40px; height: 40px; border: 0; color: #7e878d; background: transparent; font-size: 28px; cursor: pointer; }
.legal-section { padding: 5px 0 22px; scroll-margin-top: 12px; }
.legal-section + .legal-section { padding-top: 24px; border-top: 1px solid var(--line); }
.legal-section h3 { margin: 0 0 11px; color: var(--navy-900); font: 600 19px Georgia, serif; }
.legal-section p { margin: 0 0 11px; color: #59666f; font-size: 12px; line-height: 1.65; }

.toast {
  position: fixed; z-index: 20; right: 24px; bottom: 24px; padding: 12px 16px; border-radius: 10px;
  color: white; background: var(--navy-950); box-shadow: 0 14px 40px rgba(0,0,0,.2);
  font-size: 12px; font-weight: 650; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .22s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 820px) {
  .topbar { height: 74px; padding: 0 20px; }
  .brand-logo { width: 225px; height: 58px; }
  .privacy-badge { font-size: 0; padding: 10px; }
  .privacy-badge svg { width: 17px; height: 17px; }
  .portal-layout { width: min(100% - 24px, 700px); grid-template-columns: 1fr; margin: 20px auto; min-height: 0; }
  .sidebar { padding: 25px 24px; }
  .sidebar h1 { font-size: 26px; max-width: 540px; }
  .sidebar-intro > p { max-width: 520px; }
  .step-nav { display: none; }
  .sidebar-note { display: none; }
  .workspace { padding: 0 24px 30px; }
  .workspace-toolbar { height: 60px; }
  .mobile-step { display: inline; }
  .progress-track { margin: 0 -24px; }
  .form-panel { padding-top: 32px; }
  .form-panel h2 { font-size: 32px; }
}

@media (max-width: 560px) {
  .brand { gap: 10px; }
  .brand-logo { width: 205px; height: 53px; }
  .portal-layout { width: calc(100% - 16px); margin-top: 10px; border-radius: 18px; }
  .sidebar { padding: 22px 20px; }
  .sidebar h1 { margin-bottom: 0; font-size: 23px; }
  .sidebar-intro > p, .eyebrow { display: none; }
  .workspace { padding-left: 18px; padding-right: 18px; }
  .workspace-toolbar { height: 56px; }
  .save-status { display: none; }
  .progress-track { margin-left: -18px; margin-right: -18px; }
  .form-grid, .review-list, .choice-grid { grid-template-columns: 1fr; }
  .field.full, .review-list > div.full { grid-column: auto; }
  .form-panel { padding-top: 26px; }
  .form-panel h2 { font-size: 29px; }
  .section-description { font-size: 14px; margin-bottom: 26px; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions > .button, .action-group, .action-group .button { width: 100%; }
  .action-group { flex-direction: column-reverse; }
  footer { width: calc(100% - 28px); align-items: flex-start; flex-direction: column; }
  .legal-links { justify-content: flex-start; gap: 10px 14px; }
  .legal-modal { padding: 10px; }
  .legal-card { max-height: calc(100vh - 20px); padding: 35px 21px 25px; }
  .toast { left: 14px; right: 14px; bottom: 14px; text-align: center; }
}

@media print {
  body { background: white; }
  .topbar, .sidebar, .workspace-toolbar, .progress-track, .form-actions, footer, .consent-box, .toast { display: none !important; }
  .portal-layout { width: 100%; margin: 0; display: block; border: 0; box-shadow: none; }
  .workspace { padding: 0; }
  .form-panel { max-width: none; padding: 0; }
  .review-card { break-inside: avoid; }
}
