/* ══════════════════════════════════════════════════
   YOUR HOUSING NEEDS — Luv Plymouth Lettings
   Public applicant form. Mobile-first.
   Tokens derived from the LPL design system:
   navy #112C3B · pink accent #C4467E · DM Sans / Playfair Display
   ══════════════════════════════════════════════════ */

:root {
  --navy: #112C3B;
  --navy-light: #1a3d50;
  --navy-dark: #0c1f2b;
  --pink: #C4467E;
  --pink-dark: #a82f63;
  --pink-bg: #fbe7f0;
  --pink-border: #f0bcd3;
  --bg-primary: #f7f4ee;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text: #112C3B;
  --text-muted: #5a7a8a;
  --border: #DED8CA;
  --border-light: #efebe1;
  --green: #28a745;
  --green-bg: #d4edda;
  --red: #e53935;
  --red-bg: #f8d7da;
  --heading-font: 'Playfair Display', Georgia, serif;
  --body-font: 'DM Sans', -apple-system, sans-serif;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(17,44,59,0.05), 0 6px 18px rgba(17,44,59,0.05);
  --shadow-lg: 0 6px 22px rgba(17,44,59,0.07), 0 12px 40px rgba(17,44,59,0.05);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  font-family: var(--body-font);
  background: var(--bg-primary);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: var(--safe-bottom);
  -webkit-font-smoothing: antialiased;
}

/* ── Hero ── */
.hero { background: var(--navy); color: #fff; position: relative; }
.hero-inner { max-width: 640px; margin: 0 auto; padding: 36px 20px 30px; }
.brand {
  font-size: 12px; font-weight: 700; letter-spacing: 2.2px;
  text-transform: uppercase; color: #d8c9d2; margin-bottom: 12px;
}
.hero h1 {
  font-family: var(--heading-font);
  font-size: clamp(30px, 7vw, 42px);
  font-weight: 700; line-height: 1.12; margin-bottom: 12px;
}
.hero-sub { font-size: 15.5px; line-height: 1.55; color: #c4d2da; max-width: 460px; }
.hero-stripe { height: 5px; background: linear-gradient(90deg, var(--pink) 0%, var(--pink-dark) 70%, var(--navy-light) 100%); }

/* ── Layout ── */
.container { width: 100%; max-width: 640px; margin: 0 auto; padding: 22px 16px 40px; flex: 1; }

/* ── Progress ── */
.progress-wrap { margin-bottom: 20px; }
.progress-bar { height: 7px; border-radius: 99px; background: #e8e2d6; overflow: hidden; }
.progress-fill {
  height: 100%; width: 20%; border-radius: 99px;
  background: linear-gradient(90deg, var(--pink), var(--pink-dark));
  transition: width var(--transition);
}
.progress-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-top: 7px; letter-spacing: 0.4px; }

/* ── Steps ── */
.step { display: none; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px 8px; }
.step.active { display: block; animation: fadeIn 0.3s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.step-title {
  font-family: var(--heading-font); font-size: 23px; font-weight: 700;
  margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light);
}

/* ── Fields ── */
.field { margin-bottom: 20px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label, .group-label { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 8px; }
.req { color: var(--pink); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  font-family: var(--body-font);
  font-size: 16px;            /* ≥16px stops iOS zoom-on-focus */
  color: var(--text);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 14px;
  min-height: 52px;           /* large touch target */
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%235a7a8a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
  padding-right: 40px;
}
textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(196, 70, 126, 0.14);
}
input::placeholder, textarea::placeholder { color: #a9b6bd; }
.field-hint { font-size: 13px; color: var(--text-muted); margin-top: 7px; line-height: 1.45; }
.field-error { display: none; font-size: 13px; font-weight: 600; color: var(--red); margin-top: 7px; }
.field.invalid .field-error { display: block; }
.field.invalid input, .field.invalid select { border-color: var(--red); }

/* ── Choice (radio/checkbox) rows ── */
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 18px;
  min-height: 52px; cursor: pointer; font-weight: 600; font-size: 15px;
  transition: border-color var(--transition), background var(--transition);
  flex: 1; min-width: 110px; margin-bottom: 0;
}
.choice input { width: 20px; height: 20px; accent-color: var(--pink); flex: none; }
.choice:has(input:checked) { border-color: var(--pink); background: var(--pink-bg); }
.choice.consent { font-weight: 500; line-height: 1.45; align-items: flex-start; padding: 15px 16px; }
.choice.consent input { margin-top: 2px; }

.review-note {
  background: var(--pink-bg); border: 1px solid var(--pink-border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 14px; line-height: 1.5; color: var(--pink-dark); margin-bottom: 20px;
}

/* ── Honeypot — visually removed, still in the DOM for bots ── */
.hp-field { position: absolute !important; left: -9999px !important; top: -9999px !important; height: 1px; width: 1px; overflow: hidden; }

/* ── Buttons ── */
.nav-row { display: flex; gap: 12px; margin-top: 20px; }
.btn {
  font-family: var(--body-font); font-size: 16.5px; font-weight: 700;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  min-height: 56px; padding: 15px 22px;
  transition: transform 0.12s ease, box-shadow var(--transition), background var(--transition);
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--navy); color: #fff; flex: 1; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--navy-light); }
.btn-secondary { background: #fff; color: var(--navy); border: 1.5px solid var(--border); flex: 0 0 auto; min-width: 104px; }
.btn-submit {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: #fff; flex: 1; box-shadow: 0 6px 18px rgba(196,70,126,0.3);
}
.btn-submit[disabled] { opacity: 0.65; cursor: wait; }

/* ── Form-level error / retry ── */
.form-error {
  margin-top: 18px; background: var(--red-bg); border: 1px solid #f5c6cb;
  border-radius: var(--radius-sm); padding: 16px;
  font-size: 14.5px; line-height: 1.5; color: #c62828;
}
.form-error .btn { margin-top: 12px; width: 100%; }

/* ── Confirmation ── */
.confirm {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 44px 24px; text-align: center;
  animation: fadeIn 0.4s ease both;
}
.confirm-tick {
  width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%;
  background: var(--green-bg); color: var(--green);
  font-size: 38px; font-weight: 700; line-height: 72px;
}
.confirm h2 { font-family: var(--heading-font); font-size: 30px; margin-bottom: 12px; }
.confirm p { font-size: 16px; line-height: 1.6; color: var(--text-muted); max-width: 380px; margin: 0 auto 8px; }
.confirm .signoff { margin-top: 18px; color: var(--text); }

/* ── Footer ── */
.footer { background: var(--navy-dark); color: #c4d2da; margin-top: auto; }
.footer-inner { max-width: 640px; margin: 0 auto; padding: 26px 20px 30px; text-align: center; }
.footer-brand {
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: #d8c9d2; margin-bottom: 10px;
}
.footer-contact { font-size: 14px; line-height: 1.6; }
.footer-contact a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.3); }
.footer-contact .dot { margin: 0 8px; color: #5a7a8a; }
.footer-small { font-size: 12px; color: #7d96a4; margin-top: 10px; }

/* ── Small screens ── */
@media (max-width: 420px) {
  .field-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .nav-row { flex-direction: row; }
}
