/* ══════════════════════════════════════════════════════════════════════
   JOSE CASTILLO LOANS — questionnaire layout
   Shared by start.html and es/start.html. Same design in two languages, so
   the CSS lives here rather than twice in a <style> block.
   Tokens and shared components: brand.css
   ══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   START — the questionnaire. Tokens and shared parts: assets/brand.css

   Same brand rules as everywhere else: square corners, ink rules, and
   red held back for the primary action and the marker tiles. The
   progress bar deliberately fills in INK, not red — progress is not an
   action, and the guideline sheet reserves red for the mark and the
   primary action.
   ═══════════════════════════════════════════════════════════════════ */

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: 40px var(--gut) 56px; }

/* ── progress ── */
.progress { border-bottom: 1px solid var(--rule); background: var(--bg); }
.progress-in { max-width: 780px; margin: 0 auto; padding: 14px var(--gut); }
.progress-meta { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 9px; }
.progress-track { height: 4px; background: var(--rule); }
.progress-fill { height: 100%; background: var(--fg); transition: width .28s cubic-bezier(.22,.61,.36,1); }

/* ── step head ── */
.step-head { margin-bottom: 30px; }
.step-head h1 { font-size: clamp(1.7rem, 4.2vw, 2.5rem); margin: 12px 0 0; }
.step-head p { color: var(--fg-2); margin-top: 14px; max-width: 58ch; font-size: .98rem; }

/* ── choices ── */
.choices { display: grid; border-top: 1px solid var(--rule); }
.choice {
  display: flex; align-items: flex-start; gap: 18px; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--rule);
  padding: 18px 16px 18px 0; cursor: pointer; font: inherit; color: inherit;
  transition: background .12s ease, padding-left .12s ease;
}
.choice:hover { background: var(--surface); padding-left: 12px; }
.choice[aria-pressed="true"] {
  background: var(--surface); box-shadow: inset 4px 0 0 var(--red); padding-left: 16px;
}
.choice-mark {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--rule); background: var(--field-bg);
  font-weight: 700; font-size: .85rem; color: var(--fg-2);
}
.choice[aria-pressed="true"] .choice-mark {
  background: var(--red); border-color: var(--red); color: var(--white);
}
.choice-mark svg { stroke: currentColor; stroke-width: 2.5; stroke-linecap: square; stroke-linejoin: miter; fill: none; }
.choice-text strong { display: block; font-size: 1.05rem; font-weight: 600; letter-spacing: -.015em; }
.choice-text span { display: block; font-size: .88rem; color: var(--fg-2); margin-top: 3px; }

/* ── fields ── */
.fields { display: grid; gap: 20px; }
.fields.two { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > label { font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); }
.req { color: var(--red); }
.input-wrap { display: flex; border: 1px solid var(--rule); background: var(--field-bg); }
.input-wrap:focus-within { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.affix {
  display: flex; align-items: center; padding: 0 14px; background: var(--bg);
  color: var(--fg-2); font-size: .9rem; font-weight: 600; border-right: 1px solid var(--rule);
}
.affix.suffix { border-right: 0; border-left: 1px solid var(--rule); }
.input-wrap input { flex: 1; min-width: 0; border: 0; background: none; color: var(--fg); padding: 13px 14px; font: inherit; font-size: 1rem; }
.input-wrap input:focus { outline: none; }
select, textarea {
  width: 100%; border: 1px solid var(--rule); background: var(--field-bg); color: var(--fg);
  padding: 13px 14px; font: inherit; font-size: 1rem;
}
select:focus, textarea:focus { outline: none; border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
textarea { resize: vertical; min-height: 96px; }
.hint { font-size: .82rem; color: var(--fg-2); }

/* ── nav ── */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 34px; padding-top: 24px; border-top: 2px solid var(--divider);
}
.btn-back {
  border: 0; background: none; padding: 8px 0; cursor: pointer; font: inherit;
  font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-2); display: inline-flex; align-items: center; gap: 9px;
}
.btn-back:hover { color: var(--fg); }
.btn-back svg { stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; fill: none; }

/* ── alerts and assurances ── */
/* Ink ground with a red marker bar, not white-on-red: an error has to be
   readable, and white on Signal Red measures 4.2:1 — fine for a large button
   label, not for a sentence someone has to act on. */
.err {
  display: none; margin-bottom: 22px; padding: 15px 18px;
  border-left: 5px solid var(--red);
  background: var(--ink); color: var(--white); font-size: .95rem; font-weight: 600;
}
.err[data-show="1"] { display: block; }
.assure {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 28px;
  padding-top: 20px; border-top: 1px solid var(--rule);
  font-size: .8rem; color: var(--fg-2);
}
.assure span { display: inline-flex; align-items: center; gap: 9px; }
.assure svg { stroke: var(--red); stroke-width: 2.5; stroke-linecap: square; stroke-linejoin: miter; fill: none; flex: none; }

.privacy-note {
  margin-top: 26px; padding: 20px; background: var(--ink); color: var(--ground);
  font-size: .88rem; line-height: 1.65;
}
.privacy-note strong { color: var(--white); font-weight: 600; }

/* ── review ── */
.review { border-top: 1px solid var(--rule); margin: 0; }
.review-row {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: .92rem;
}
.review-row dt { color: var(--fg-2); }
.review-row dd { margin: 0; font-weight: 600; text-align: right; }

.check { display: flex; gap: 14px; align-items: flex-start; font-size: .88rem; color: var(--fg-2); line-height: 1.6; }
.check input { margin-top: 3px; flex: none; width: 20px; height: 20px; accent-color: var(--red); }

/* ── done ── */
.done { padding: 12px 0 20px; }
.done .tile { width: 56px; height: 56px; margin-bottom: 26px; }
.done .tile svg { stroke-width: 2.5; }
.done h1 { font-size: clamp(2rem, 5vw, 3rem); }
.done > p { color: var(--fg-2); max-width: 54ch; margin-top: 18px; font-size: 1.02rem; }
.next-steps { margin-top: 34px; border-top: 2px solid var(--divider); }
.next-steps div {
  display: grid; grid-template-columns: 44px 1fr; gap: 18px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--rule); font-size: .95rem;
}
.done-back { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; }

@media (max-width: 560px) {
  .fields.two { grid-template-columns: 1fr; }
  main { padding-top: 30px; }
  .nav .btn { padding: 15px 20px; font-size: .8rem; }
}
