/* ==========================================================================
   What Does the Law Say About Your Family Home? (v1.2)
   5ML & Sapience Web Diagnostic UX SSOT v4.3
   ========================================================================== */

:root {
  --bg-page: #f4f6f9;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --ink-primary: #0f172a;
  --ink-secondary: #334155;
  --ink-muted: #64748b;
  --brand-navy: #0f172a;
  --brand-accent: #2563eb;
  --brand-gold: #d97706;
  --border-light: #e2e8f0;
  --border-mid: #cbd5e1;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06);

  --red-bg: #fef2f2;
  --red-border: #fca5a5;
  --red-ink: #b91c1c;

  --amber-bg: #fffbeb;
  --amber-border: #fcd34d;
  --amber-ink: #b45309;

  --green-bg: #ecfdf5;
  --green-border: #6ee7b7;
  --green-ink: #065f46;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-primary);
  background-color: var(--bg-page);
}

@media (min-width: 1200px) {
  html {
    font-size: 17px;
  }
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--ink-primary);
}

.site-header {
  background: var(--brand-navy);
  color: #ffffff;
  padding: 26px 24px 30px;
  border-bottom: 4px solid var(--brand-gold);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 6px;
}

.site-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
}

.site-header .subtitle {
  margin: 0;
  color: #cbd5e1;
  font-size: 1.02rem;
  max-width: 920px;
}

.container-wide {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 24px 52px;
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

.section-kicker {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-accent);
  margin-bottom: 4px;
}

.card-panel h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink-primary);
}

/* Step 1: 3 Equal Columns (1fr 1fr 1fr) */
.perspective-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 900px) {
  .perspective-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.perspective-card {
  appearance: none;
  text-align: left;
  background: var(--bg-subtle);
  border: 2px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.perspective-card:hover {
  border-color: var(--brand-accent);
  background: #eff6ff;
}

.perspective-card.active {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #ffffff;
}

.p-badge {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-accent);
}

.perspective-card.active .p-badge {
  color: #fbbf24;
}

.perspective-card strong {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.p-sub {
  font-size: 0.86rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.perspective-card.active .p-sub {
  color: #cbd5e1;
}

/* Step 2: Asymmetrical 1fr / 2fr Grid matching Step 1's 1/3 column seam */
.inputs-grid-asym {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 14px;
  align-items: end;
}

@media (min-width: 900px) {
  .inputs-grid-asym {
    grid-template-columns: 1fr 2fr;
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.form-control-sap {
  width: 100%;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink-primary);
  background: #ffffff;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}

.form-control-sap:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.info-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--brand-accent);
  color: #ffffff;
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.82rem;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.info-popover {
  display: none;
  background: var(--brand-navy);
  color: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  margin-top: 14px;
}

.info-popover.visible {
  display: block;
}

.info-popover strong {
  color: #fbbf24;
}

/* Step 3: Traffic Light Result Card */
.result-panel.state-red {
  border: 2px solid var(--red-border);
  background: #fffafa;
}

.result-panel.state-amber {
  border: 2px solid var(--amber-border);
  background: #fffdf5;
}

.result-panel.state-green {
  border: 2px solid var(--green-border);
  background: #f6fef9;
}

.traffic-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1.5px solid;
}

.pill-red { background: var(--red-bg); border-color: var(--red-border); color: var(--red-ink); }
.pill-amber { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-ink); }
.pill-green { background: var(--green-bg); border-color: var(--green-border); color: var(--green-ink); }

.result-body-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 10px;
}

@media (min-width: 920px) {
  .result-body-grid {
    grid-template-columns: 1.55fr 1fr;
    align-items: start;
  }
}

.result-main-box h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.result-main-box p {
  margin: 0 0 14px;
  font-size: 0.96rem;
  color: var(--ink-secondary);
}

.statutory-note-box {
  background: #ffffff;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--ink-primary);
}

.handoff-card {
  background: var(--brand-navy);
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.handoff-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fbbf24;
}

.handoff-card h4 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.handoff-card p {
  margin: 0;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.btn-handoff-primary {
  display: block;
  text-align: center;
  background: #fbbf24;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  margin-top: 4px;
}

.btn-handoff-primary:hover {
  background: #f59e0b;
  color: #0f172a;
}

.btn-handoff-secondary {
  display: block;
  text-align: center;
  background: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.btn-handoff-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.disclaimer-footer {
  border-top: 1px solid var(--border-mid);
  padding-top: 14px;
  font-size: 0.84rem;
  color: var(--ink-secondary);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.footer-advice-note {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 3px;
}

.footer-version {
  font-weight: 700;
  color: var(--ink-muted);
}
