/* Ur Mortgage — Online Mortgage Application (OMA) wizard styles.
 * Rocket-style: one focused question per screen, centered single column, a slim
 * top progress bar, big tap targets. Loaded only on apply.html. Needs tokens.css + styles.css. */

.oma { padding-block: 0 var(--space-4xl); }

/* ---- slim top progress (scrolls with the page; NOT sticky, so it never covers content) ---- */
.oma__top { background: #fff; border-bottom: var(--rule-hair); }
.oma__track { height: 5px; background: var(--line-soft); }
.oma__track i { display: block; height: 100%; width: 0%; background: var(--brand-green); transition: width var(--dur-slow) var(--ease-out); }
.oma__topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: 0.7rem 0; }
.oma__backlink { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); color: var(--ink-soft); background: none; border: none; cursor: pointer; padding: 0.3rem 0; }
.oma__backlink:hover { color: var(--brand-green-700); }
.oma__backlink[hidden] { visibility: hidden; }
.oma__count { font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); color: var(--ink-faint); }
.oma__count b { color: var(--brand-ink); }

/* ---- centered single column ---- */
.oma__center { max-width: 680px; margin-inline: auto; padding-top: var(--space-2xl); }
.oma__card { background: #fff; border: var(--rule-hair); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: var(--space-2xl); }
@media (max-width: 560px) { .oma__card { padding: var(--space-lg); border-radius: var(--radius-md); } .oma__center { padding-top: var(--space-lg); } }

.oma__switch { text-align: center; margin-top: var(--space-lg); font-size: var(--text-sm); color: var(--ink-soft); }
.oma__switch a { color: var(--brand-green-700); font-weight: 600; }
.oma__switch span { margin: 0 0.5rem; color: var(--line); }

/* ---- step panels ---- */
.step-panel { display: none; }
.step-panel[data-active="true"] { display: block; animation: step-in var(--dur-slow) var(--ease-out); }
@keyframes step-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.step-panel[data-dir="back"][data-active="true"] { animation-name: step-in-back; }
@keyframes step-in-back { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step-panel[data-active="true"] { animation: none; } }

.step-panel__head { margin-bottom: var(--space-2xl); }
.step-panel__kicker { display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); color: var(--brand-green-700); letter-spacing: var(--tracking-wide); text-transform: uppercase; margin-bottom: 0.5rem; }
.step-panel__head h2 { font-size: var(--text-3xl); margin-top: 0; letter-spacing: -0.02em; line-height: 1.15; }
.step-panel__head p { margin-top: var(--space-md); color: var(--ink-soft); font-size: var(--text-lg); }

/* form grid */
.fg { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--space-md) var(--space-lg); }
.fg .col-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .fg { grid-template-columns: 1fr; } }

.f { display: flex; flex-direction: column; gap: 0.4rem; }
.f > label { font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); }
.f .req { color: var(--error); }
.f .opt { color: var(--ink-faint); font-weight: 500; font-size: var(--text-sm); }
.f input, .f select, .f textarea {
  width: 100%; padding: 0.95rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-md);
  background: #fff; font-size: var(--text-lg);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.f input::placeholder, .f textarea::placeholder { color: var(--ink-faint); }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--brand-green); box-shadow: 0 0 0 3px var(--brand-green-050); }
.f .hint { font-size: var(--text-sm); color: var(--ink-faint); }
.f .err-msg { font-size: var(--text-sm); color: var(--error); display: none; }
.f.has-error input, .f.has-error select, .f.has-error textarea { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-bg); }
.f.has-error .err-msg { display: block; }
.f .with-prefix { position: relative; }
.f .with-prefix span { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; font-size: var(--text-lg); }
.f .with-prefix input { padding-left: 2rem; }

/* option tiles (big, Rocket-style) */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--space-md); }
.tiles--stack { grid-template-columns: 1fr; }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tile label {
  display: flex; gap: 1rem; align-items: center; cursor: pointer; min-height: 76px;
  border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: var(--space-md) var(--space-lg);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.tile label .ti { flex: 0 0 auto; width: 46px; height: 46px; border-radius: var(--radius-md); background: var(--brand-green-050); color: var(--brand-green-700); display: grid; place-items: center; }
.tile label .ti svg { width: 26px; height: 26px; }
.tile label > span:not(.ti) { display: flex; flex-direction: column; min-width: 0; }
.tile label .tt { display: block; font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); line-height: 1.25; }
.tile label .td { display: block; font-size: var(--text-sm); color: var(--ink-soft); margin-top: 4px; line-height: 1.45; }
.tile input:hover + label { border-color: var(--brand-green-300); background: var(--paper-2); transform: translateY(-1px); }
.tile input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.tile input:checked + label { border-color: var(--brand-green); background: var(--brand-green-050); box-shadow: inset 0 0 0 1px var(--brand-green); }
.tile input:checked + label .ti { background: var(--brand-green); color: #fff; }
@media (prefers-reduced-motion: reduce) { .tile input:hover + label { transform: none; } }

/* visually-hidden label (the visible question is the .q-head above it) */
.q-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* grouped sub-questions within a section */
.fieldset { margin-top: var(--space-2xl); }
.fieldset:first-child { margin-top: 0; }
.q-head { display: block; font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); line-height: 1.25; letter-spacing: -0.01em; margin-bottom: var(--space-md); }
.q-head .opt { color: var(--ink-faint); font-weight: 500; font-size: var(--text-sm); }
.q-sub { display: block; color: var(--ink-soft); font-size: var(--text-sm); margin: -0.4rem 0 var(--space-md); }

/* in-panel reveal (conditional sub-questions that appear as you answer — the "drop-down" branch) */
.reveal-block { margin-top: var(--space-2xl); padding-top: var(--space-xl); border-top: 1px dashed var(--line); animation: step-in var(--dur-mid) var(--ease-out); }
.reveal-block[hidden] { display: none; }
.reveal-block .rb-label { font-family: var(--font-display); font-weight: 600; margin-bottom: var(--space-sm); display: block; }
/* nested branch — softer left-accent instead of a second dashed rule, so depth reads cleanly */
.reveal-block .reveal-block { border-top: none; padding-top: 0; margin-top: var(--space-xl); padding-left: var(--space-lg); border-left: 2px solid var(--brand-green-100, var(--brand-green-050)); }
.reveal-block .fieldset:first-child { margin-top: 0; }

/* segmented choices */
.seg { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.seg .opt { position: relative; }
.seg .opt input { position: absolute; opacity: 0; }
.seg .opt label { display: inline-flex; padding: 0.7rem 1.15rem; border: 1.5px solid var(--line); border-radius: var(--radius-pill); cursor: pointer; font-size: var(--text-base); font-family: var(--font-display); font-weight: 500; transition: all var(--dur-fast) var(--ease-out); }
.seg .opt input:hover + label { border-color: var(--brand-green-300); }
.seg .opt input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg .opt input:checked + label { border-color: var(--brand-green); background: var(--brand-green-050); color: var(--brand-green-700); }

/* ===== TCPA consent box (the gate) ===== */
.consent { margin-top: var(--space-xl); border: 1.5px solid var(--line); border-radius: var(--radius-md); background: var(--paper-2); padding: var(--space-lg); }
.consent__scroll { max-height: 168px; overflow-y: auto; font-size: var(--text-xs); line-height: 1.6; color: var(--ink-soft); padding-right: var(--space-sm); margin-bottom: var(--space-md); }
.consent__scroll p + p { margin-top: 0.7rem; }
.consent__scroll a { color: var(--brand-green-700); text-decoration: underline; text-underline-offset: 2px; }
.consent__check { display: flex; gap: 0.75rem; align-items: flex-start; cursor: pointer; }
.consent__check input { flex: 0 0 auto; width: 24px; height: 24px; margin-top: 1px; accent-color: var(--brand-green); cursor: pointer; }
.consent__check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.consent__check .txt { font-size: var(--text-sm); color: var(--ink); }
.consent.has-error { border-color: var(--error); background: var(--error-bg); }
.consent__err { display: none; color: var(--error); font-size: var(--text-xs); margin-top: var(--space-sm); }
.consent.has-error .consent__err { display: block; }

/* footer nav of the wizard (Rocket: big full-width Continue) */
.oma__nav { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-2xl); }
.oma__nav .btn--continue { flex: 1; }
.save-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); margin-top: var(--space-md); flex-wrap: wrap; }
.save-row .btn--link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--text-sm); }
.save-note { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--text-xs); color: var(--ink-faint); }
.oma-toast { margin-top: var(--space-md); background: var(--brand-green-050); border: 1px solid var(--brand-green-300); color: var(--brand-green-700); border-radius: var(--radius-md); padding: 0.85rem 1rem; font-size: var(--text-sm); opacity: 0; transform: translateY(6px); transition: opacity var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out); }
.oma-toast.show { opacity: 1; transform: none; }

/* review */
.review { display: grid; gap: var(--space-lg); }
.review__group { border: var(--rule-hair); border-radius: var(--radius-md); overflow: clip; }
.review__group h3 { font-size: var(--text-base); background: var(--paper-2); padding: 0.8rem var(--space-md); border-bottom: var(--rule-hair); display: flex; justify-content: space-between; align-items: center; }
.review__group h3 button { font-size: var(--text-sm); }
.review__group dl { margin: 0; padding: var(--space-md); display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem var(--space-md); }
.review__group dl > div { min-width: 0; }
.review__group dt { font-size: var(--text-xs); color: var(--ink-faint); }
.review__group dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 480px) { .review__group dl { grid-template-columns: 1fr; } }

/* success */
.done { text-align: center; padding: var(--space-xl) 0; }
.done__badge { width: 84px; height: 84px; border-radius: 50%; background: var(--brand-green-050); color: var(--brand-green-700); display: grid; place-items: center; margin: 0 auto var(--space-lg); }
.done__badge svg { width: 44px; height: 44px; }
.done h2 { font-size: var(--text-3xl); }
.done p { margin-top: var(--space-md); color: var(--ink-soft); max-width: 44ch; margin-inline: auto; }
.done__next { text-align: left; max-width: 460px; margin: var(--space-xl) auto 0; display: grid; gap: var(--space-md); }
.done__next .row { display: flex; gap: 0.85rem; align-items: flex-start; }
.done__next .n { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-green); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); }
.ref { margin-top: var(--space-lg); font-family: var(--font-display); }
.ref b { color: var(--brand-green-700); letter-spacing: 0.04em; }

/* reassurance bar */
.assure { display: flex; flex-wrap: wrap; gap: var(--space-lg); justify-content: center; margin-top: var(--space-xl); }
.assure span { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--text-sm); color: var(--ink-soft); }
.assure svg { width: 18px; height: 18px; color: var(--brand-green-700); }
