/* ==========================================================================
   Pearl – Loan Application Form UI
   Hand-written CSS (no framework). Light + dark theme via CSS variables.
   ========================================================================== */

:root {
  --navy: #1f3864;
  --navy-2: #2f5597;
  --accent: #e0a526;
  --accent-ink: #4a3300;
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --line: #d9dfec;
  --line-strong: #bcc6dc;
  --text: #17223b;
  --muted: #5d6b86;
  --primary: #1f3864;
  --primary-ink: #ffffff;
  --focus: #3b74e0;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --ok: #1e8449;
  --ok-bg: #e7f6ed;
  --warn-bg: #fff6df;
  /* header: deep graphite with a gold hairline – professional, no blue */
  --header-bg: linear-gradient(180deg, #2a4f8f 0%, #1a3768 100%);
  --header-line: #d4b05a;
  --header-fg: #f6f3ec;
  --header-muted: #c3d0ea;
  --shadow: 0 1px 2px rgba(23, 34, 59, .06), 0 6px 20px rgba(23, 34, 59, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0e1526;
  --surface: #162038;
  --surface-2: #1b2745;
  --line: #2a3858;
  --line-strong: #3a4a72;
  --text: #e8edf8;
  --muted: #9aa9c7;
  --primary: #4f86e8;
  --primary-ink: #ffffff;
  --focus: #7aa7f5;
  --danger: #ff7b6b;
  --danger-bg: #3a1f24;
  --ok: #4cd08a;
  --ok-bg: #12301f;
  --warn-bg: #3a3012;
  --header-bg: linear-gradient(180deg, #1b3a6e 0%, #0f2347 100%);
  --header-line: #c29d48;
  --header-fg: #f6f3ec;
  --header-muted: #a4b4d4;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  background-image: radial-gradient(1200px 380px at 50% -120px, rgba(140, 135, 160, .14), transparent 70%);
  background-repeat: no-repeat;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
p { margin: 0 0 .6em; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }
.icon { flex: none; vertical-align: middle; }
.when-dark { display: none; }
:root[data-theme="dark"] .when-dark { display: inline; }
:root[data-theme="dark"] .when-light { display: none; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ------------------------------------------------------------ site header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg); color: var(--header-fg);
  border-bottom: 2px solid var(--header-line);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .22);
}
.site-header__inner { max-width: 1280px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--header-fg); text-decoration: none; }
.brand img { display: block; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .55)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-size: 21px; letter-spacing: 1.2px; font-weight: 700; text-transform: uppercase; }
.brand__text small { color: var(--header-muted); font-size: 12px; letter-spacing: .3px; }
.site-header__actions { display: flex; align-items: center; gap: 6px; }
.save-state { font-size: 12px; color: var(--header-muted); margin-right: 8px; white-space: nowrap; }
.site-header .btn--ghost { color: var(--header-fg); }
.site-header .btn--ghost:hover { background: rgba(255, 255, 255, .12); }
.site-header .btn:focus-visible { outline-color: #e6c470; }

/* ----------------------------------------------------------------- layout */
.shell { max-width: 1280px; margin: 0 auto; padding: 24px 20px 40px; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; }
.sidebar { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.main { min-width: 0; }

.progress-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.progress-card__row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.progress-card__row strong { color: var(--text); font-size: 16px; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--navy-2), var(--accent)); border-radius: 99px; transition: width .4s ease; }
.progress-card small { display: block; margin-top: 8px; }

.stepper { list-style: none; margin: 0; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stepper__item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; position: relative; transition: background .15s; }
.stepper__item:hover { background: var(--surface-2); }
.stepper__icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.stepper__label { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; line-height: 1.2; min-width: 0; }
.stepper__label small { font-weight: 500; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stepper__state { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; flex: none; }
.stepper__item.is-active { background: color-mix(in srgb, var(--navy-2) 12%, var(--surface)); }
.stepper__item.is-active .stepper__icon { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.stepper__item.is-done .stepper__icon { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.stepper__item.is-done .stepper__state { background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/70% no-repeat; }
.stepper__item.has-error .stepper__icon { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.stepper__item.has-error .stepper__state { background: var(--danger); box-shadow: inset 0 0 0 5px var(--danger); }

/* ------------------------------------------------------------------ steps */
.step { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.step-head__num { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--navy), var(--navy-2)); box-shadow: 0 6px 16px rgba(31, 56, 100, .3); flex: none; }
.step-head h2 { font-size: 26px; letter-spacing: -.2px; outline: none; }
.eyebrow { margin: 0 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--muted); font-weight: 600; }
.lead { color: var(--muted); font-size: 15px; margin-bottom: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 0 0 18px; box-shadow: var(--shadow); min-width: 0; }
.card__title { font-size: 17px; margin-bottom: 4px; }
.card__sub { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.card__title + .grid { margin-top: 14px; }
.card > .choice.c-12 { margin-bottom: 18px; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
fieldset.card { margin-inline: 0; }
fieldset.card > legend { padding: 0; float: left; width: 100%; margin-bottom: 14px; }
fieldset.card > legend + * { clear: both; }

.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 6px 0 0; }

/* ------------------------------------------------------------------- grid */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 16px; }
.c-2 { grid-column: span 2; } .c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; }
.c-6 { grid-column: span 6; } .c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; } .c-12 { grid-column: span 12; }

/* ----------------------------------------------------------------- fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { font-size: 13px; font-weight: 600; color: var(--text); padding: 0; }
.req { color: var(--danger); margin-left: 3px; }
.control { display: flex; align-items: stretch; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; overflow: hidden; }
.control:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--focus) 25%, transparent); }
.control input, .control textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 11px 12px; height: 44px; }
.control textarea { height: auto; min-height: 72px; resize: vertical; line-height: 1.45; }
.control input::placeholder, .control textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.control input[type=number] { -moz-appearance: textfield; }
.control input[type=number]::-webkit-outer-spin-button, .control input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.control input[type=date] { padding-right: 8px; }
:root[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.85); }
.affix { display: flex; align-items: center; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.affix--pre { border-right: 1px solid var(--line); }
.affix--suf { border-left: 1px solid var(--line); }
.control.is-readonly, .addr.is-locked .control { background: var(--surface-2); }
.control.is-readonly input { cursor: default; color: var(--muted); font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; }
.error { color: var(--danger); font-size: 12.5px; font-weight: 600; min-height: 0; }
.error:empty { display: none; }
.has-error > .control, .field.has-error .control { border-color: var(--danger); }
.has-error > .control:focus-within { box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--danger) 22%, transparent); }
.field--action { justify-content: flex-end; }

/* pill choices */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills--wide .pill span { padding: 11px 16px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; padding: 10px 16px; min-height: 44px; border: 1.5px solid var(--line-strong); border-radius: 99px; background: var(--surface); font-weight: 600; font-size: 14px; transition: all .15s; user-select: none; }
.pill:hover span { border-color: var(--navy-2); }
.pill input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 35%, transparent); }
.pill input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 2px; }
.field.choice.has-error .pill span { border-color: var(--danger); }

/* checkbox */
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14.5px; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 21px; height: 21px; margin: 1px 0 0; border: 1.8px solid var(--line-strong); border-radius: 6px; background: var(--surface); display: grid; place-content: center; cursor: pointer; transition: all .12s; }
.check input::after { content: ""; width: 11px; height: 6px; border-left: 2.6px solid #fff; border-bottom: 2.6px solid #fff; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform .12s; }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 2px; }
.check--lg { font-size: 15px; font-weight: 600; margin-top: 16px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch__track { width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 2px; }

/* searchable select (combobox) */
.combo { position: relative; }
.combo .control { position: relative; }
.combo__lead { display: grid; place-items: center; padding-left: 12px; color: var(--muted); }
.combo__input { padding-left: 8px !important; }
.combo__toggle { flex: none; width: 42px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-left: 1px solid var(--line); }
.combo__toggle:hover { background: var(--surface-2); color: var(--text); }
.combo__toggle .icon { transition: transform .15s; }
.combo.is-open .combo__toggle .icon { transform: rotate(180deg); }
.combo.is-open .control { border-color: var(--focus); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--focus) 25%, transparent); }
.combo__list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 14px 34px rgba(0, 0, 0, .18); overscroll-behavior: contain; }
.combo__list li[role=option] { display: flex; flex-direction: column; gap: 1px; padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.combo__list li[role=option] small { color: var(--muted); font-size: 12px; }
.combo__list li.is-active, .combo__list li[role=option]:hover { background: color-mix(in srgb, var(--focus) 14%, var(--surface)); }
.combo__list li.is-selected .combo__name::after { content: "  \2713"; color: var(--ok); font-weight: 800; }
.combo__list mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.combo__custom .combo__name { font-style: italic; }
.combo__empty { padding: 12px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; min-height: 44px; border-radius: 12px; border: 1.5px solid transparent; font-weight: 700; font-size: 14.5px; cursor: pointer; transition: transform .1s, box-shadow .15s, background .15s; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 50%, transparent); outline-offset: 2px; }
.btn--primary { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; box-shadow: 0 6px 16px rgba(31, 56, 100, .3); }
:root[data-theme="dark"] .btn--primary { background: linear-gradient(135deg, #3b6fd4, #4f86e8); }
.btn--primary:hover { box-shadow: 0 8px 22px rgba(31, 56, 100, .4); }
.btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { filter: brightness(1.05); }
.btn--ghost { background: transparent; color: var(--text); padding: 8px 12px; min-height: 38px; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn--danger-ghost:hover { background: var(--danger-bg); }
.btn--icon { padding: 8px; min-width: 40px; }
.btn--sm { padding: 6px 12px; min-height: 34px; font-size: 13px; }

/* ----------------------------------------------------------------- photos */
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.photo { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.photo__drop { width: 100%; max-width: 220px; aspect-ratio: 3 / 4; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; overflow: hidden; transition: all .15s; position: relative; }
.photo__drop:hover, .photo.is-drag .photo__drop { border-color: var(--navy-2); background: color-mix(in srgb, var(--navy-2) 8%, var(--surface)); }
.photo__drop:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 2px; }
.photo.has-photo .photo__drop { border-style: solid; border-color: var(--ok); }
.photo__empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px; color: var(--muted); }
.photo__empty strong { color: var(--text); font-size: 15px; }
.photo__empty small { font-size: 12px; }
.photo__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ----------------------------------------------------------------- proofs */
.proofs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.proof-col { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin: 0; background: var(--surface-2); min-width: 0; }
.proof-col legend { padding: 0; float: left; width: 100%; margin-bottom: 10px; }
.proof-col legend + * { clear: both; }
.proof-col__badge { display: inline-block; padding: 5px 14px; border-radius: 99px; font-weight: 700; font-size: 13px; color: #fff; background: var(--navy); }
.proof-col__badge--addr { background: #2f6f6a; }
.proof-col__badge--inc { background: #8a5a14; }
.proof { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.proof:last-child { border-bottom: 0; }
.proof__no { width: 100%; margin-top: 8px; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: 13.5px; }
.proof__no:focus { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }

/* -------------------------------------------------------------- addresses */
.addr-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 8px; }
.addr, .row-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin: 0; background: var(--surface-2); min-width: 0; }
.addr legend, .row-card legend { padding: 0 8px; font-weight: 700; font-size: 14px; color: var(--navy-2); }
:root[data-theme="dark"] .addr legend, :root[data-theme="dark"] .row-card legend { color: #8fb3f5; }
.addr .control, .row-card .control { background: var(--surface); }
.row-card { margin-bottom: 14px; }
.row-card__badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; margin-right: 6px; }

/* ------------------------------------------------- guarantors / references */
.guarantors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.guarantor__no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; font-size: 14px; margin-right: 8px; }
.tag { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: middle; }

/* ---------------------------------------------------------- EMI summary */
.emi-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding: 16px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--navy-2) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--navy-2) 30%, var(--line)); animation: rise .3s ease; }
.emi-summary div { display: flex; flex-direction: column; }
.emi-summary small { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.emi-summary strong { font-size: 22px; letter-spacing: -.3px; }
.emi-summary .muted { grid-column: 1 / -1; margin: 0; }

/* ------------------------------------------------------------ declaration */
.declaration { margin: 12px 0 0; padding: 18px 20px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14.5px; line-height: 1.65; color: var(--text); }
.signs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sign { display: flex; flex-direction: column; gap: 6px; }
.sign__top { display: flex; justify-content: space-between; align-items: center; }
.sign__pad { width: 100%; height: 150px; background: #fff; border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); touch-action: none; cursor: crosshair; }
.sign.is-signed .sign__pad { border-style: solid; border-color: var(--ok); }

/* ------------------------------------------------------------ office use */
.card--office { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 14px, var(--surface-2) 14px, var(--surface-2) 28px); border-style: dashed; border-color: var(--line-strong); }
.stamp-note { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 16px; }

/* ---------------------------------------------------------------- review */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert--ok { background: var(--ok-bg); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); font-weight: 600; align-items: center; }
.alert--warn { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); flex-direction: column; gap: 6px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert a { color: inherit; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.review__sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.review__sec > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.review__sec h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.review__sec h3 span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; }
.review dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; }
.review dl > div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.review dt { color: var(--muted); }
.review dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }
.review__photos { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.review__photos figure { margin: 0; text-align: center; }
.review__photos img { height: 110px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; background: #fff; }
.review__photos--sign img { height: 70px; width: auto; object-fit: contain; }
.review__photos figcaption { font-size: 12px; color: var(--muted); text-transform: capitalize; margin-top: 4px; }

/* ----------------------------------------------------------------- footer */
.site-footer { text-align: center; padding: 24px 20px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); margin-top: 10px; }
.site-footer p { margin: 0 0 4px; }
.site-footer strong { color: var(--text); }

/* ----------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { background: var(--text); color: var(--surface); padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); opacity: 0; transform: translateY(10px); transition: all .25s; max-width: 340px; }
.toast.is-in { opacity: 1; transform: none; }
.toast--warn { background: #b35c00; color: #fff; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 250px minmax(0, 1fr); gap: 20px; }
  .proofs { grid-template-columns: 1fr; }
  .addr-cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding-top: 14px; }
  .sidebar { position: static; }
  .stepper { display: flex; overflow-x: auto; gap: 4px; padding: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .stepper li { flex: none; scroll-snap-align: start; }
  .stepper__item { flex-direction: column; text-align: center; gap: 4px; padding: 8px 10px; width: 92px; }
  .stepper__label small { display: none; }
  .stepper__label { font-size: 11.5px; align-items: center; }
  .stepper__state { position: absolute; top: 6px; right: 8px; width: 14px; height: 14px; }
  .guarantors, .signs { grid-template-columns: 1fr; }
  .photos { gap: 12px; }
  .save-state { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .step-head h2 { font-size: 22px; }
  .step-head__num { width: 44px; height: 44px; }
  .card { padding: 16px; }
  .c-2, .c-3, .c-4, .c-5 { grid-column: span 6; }
  .c-6, .c-7, .c-8, .c-12 { grid-column: span 12; }
  .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .photo__empty small { display: none; }
  .emi-summary { grid-template-columns: 1fr; }
  .review dl { grid-template-columns: 1fr; }
  .brand__text small { display: none; }
  .step-nav .btn { flex: 1; }
}
@media (max-width: 440px) {
  .c-4, .c-5 { grid-column: span 12; }
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ------------------------------------------------------------------ print */
@media print {
  @page { size: A4; margin: 12mm; }
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #444; --line: #999; --line-strong: #666; --shadow: none; color-scheme: light; }
  body { background: #fff; font-size: 11px; }
  .site-header { position: static; background: none; color: #000; box-shadow: none; border-bottom: 1px solid #999; }
  .site-header__inner { padding: 0 0 8px; }
  .site-header .brand { color: #000; }
  .brand img { filter: none; }
  .combo__toggle, .combo__lead, .combo__list { display: none !important; }
  .site-header__actions, .sidebar, .step-nav, .toasts, .skip-link, .sign__clear, .photo__remove, .switch, .field--action, #calc-emi { display: none !important; }
  .shell { display: block; padding: 8px 0; max-width: none; }
  .step[hidden] { display: block !important; }
  .step { animation: none; break-inside: auto; }
  #step-review { display: none !important; }
  .step-head { margin: 10px 0 6px; padding: 6px 10px; background: var(--navy); color: #fff; border-radius: 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .step-head__num { display: none; }
  .step-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: #fff; }
  .eyebrow { display: none; }
  .card { box-shadow: none; border: 1px solid #999; border-radius: 4px; padding: 8px 10px; margin-bottom: 8px; break-inside: avoid; }
  .card--office { background: none; }
  .control { border-width: 0 0 1px; border-radius: 0; box-shadow: none !important; }
  .control input, .control textarea { height: 24px; padding: 2px 4px; font-weight: 600; }
  .affix { background: none; padding: 0 4px; }
  .grid { gap: 8px 10px; }
  .pill span { padding: 2px 10px; min-height: 0; font-size: 11px; box-shadow: none !important; }
  .pill input:checked + span { background: #000 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .proof__no[hidden] { display: none !important; }
  .photo__drop { max-width: 110px; }
  .photo__empty small { display: none; }
  .guarantors, .addr-cols, .proofs, .signs { gap: 8px; }
  .hint, .card__sub, .lead { font-size: 10px; }
  .site-footer { border: 0; padding: 8px 0; }
  .site-footer .muted { display: none; }
  .declaration { font-size: 10.5px; padding: 8px 10px; }
  .emi-summary { break-inside: avoid; }
}
