/* ============================================================
   CIVITAS — Consulta Wizard CSS (Rediseño 2026)
   Taste · Motion · Impeccable · 100% nativo · Sin Tailwind
   ============================================================ */

:root {
  --navy: #041627;
  --gold: #b8945a;
  --gold-soft: rgba(184,148,90,0.12);
  --cream: #fbf9fa;
  --surface: #ffffff;
  --surface-2: #f3f1ed;
  --ink: #041627;
  --ink-muted: #5a6471;
  --ink-subtle: #8a93a0;
  --line: rgba(4,22,39,0.10);
  --line-strong: rgba(4,22,39,0.18);
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(4,22,39,0.06), 0 1px 2px rgba(4,22,39,0.03);
  --shadow-md: 0 12px 32px rgba(4,22,39,0.08), 0 4px 12px rgba(4,22,39,0.04);
  --shadow-lg: 0 24px 60px rgba(4,22,39,0.12), 0 8px 24px rgba(4,22,39,0.06);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Defensiva: forzar claro siempre */
html { color-scheme: light !important; }

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ============================================================
   NAV — usa civitas-native.css (no duplicar estilos aquí)
   ============================================================ */

/* ============================================================
   MAIN
   ============================================================ */
.consulta-main { max-width: 760px; margin: 0 auto; padding: 56px 24px 100px; }

.consulta-header { text-align: center; margin-bottom: 36px; }
.consulta-badge { display: inline-block; padding: 6px 14px; background: rgba(4,22,39,0.05); color: var(--gold); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; border-radius: 999px; margin-bottom: 14px; border: 1px solid var(--line); }
.consulta-header h1 { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 700; margin: 0 0 10px; letter-spacing: -0.03em; line-height: 1.08; color: var(--navy); text-wrap: balance; }
.consulta-header p { font-size: 1.05rem; color: var(--ink-muted); max-width: 540px; margin: 0 auto; text-wrap: pretty; }
.consulta-header strong { color: var(--gold); font-weight: 700; }
.consulta-header em { font-family: 'Spectral', Georgia, serif; font-style: italic; color: var(--ink-muted); }

/* ============================================================
   WIZARD CARD
   ============================================================ */
.wizard-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 40px 36px 36px; box-shadow: var(--shadow-md); overflow: hidden; }
.wizard-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: 0.7; }

.btn-reset { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 50%; color: var(--ink-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); z-index: 2; }
.btn-reset:hover { color: var(--navy); border-color: var(--gold); transform: rotate(-90deg); box-shadow: var(--shadow); }
.btn-reset:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; }

/* Progress */
.progress-track { width: 100%; height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold)); width: 25%; border-radius: 999px; transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.progress-steps { display: flex; justify-content: center; gap: 8px; margin-bottom: 28px; }
.step-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); border: 1.5px solid var(--line); transition: var(--transition); }
.step-dot.active { background: var(--gold); border-color: var(--gold); transform: scale(1.25); box-shadow: 0 0 0 4px rgba(184,148,90,0.15); }

/* Steps */
.step-title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.45rem; font-weight: 700; text-align: center; margin: 0 0 6px; color: var(--navy); letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.step-desc { text-align: center; color: var(--ink-muted); font-size: 0.95rem; margin: 0 auto 24px; max-width: 480px; text-wrap: pretty; }

/* ============================================================
   OPTIONS — Step 1 (Grid)
   ============================================================ */
.options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }
.option-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 22px 18px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 10px; transition: var(--transition); font-family: inherit; color: var(--ink); position: relative; overflow: hidden; font-size: 0.95rem; font-weight: 600; }
.option-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 40%, rgba(184,148,90,0.06) 100%); opacity: 0; transition: var(--transition); pointer-events: none; }
.option-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.option-card:hover::after { opacity: 1; }
.option-card:active { transform: translateY(0) scale(0.98); }
.option-card:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 3px; }
.option-card.selected { border-color: var(--gold); background: rgba(4,22,39,0.03); box-shadow: 0 0 0 3px rgba(184,148,90,0.12); }
.option-icon { font-size: 1.75rem; line-height: 1; filter: grayscale(0.25); }
.option-label { color: var(--navy); text-wrap: balance; }

/* ============================================================
   OPTIONS — Steps 2-4 (List)
   ============================================================ */
.options-list { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.option-row { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 16px 20px; cursor: pointer; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: inherit; font-size: 1rem; font-weight: 600; color: var(--ink); transition: var(--transition); }
.option-row > span { flex: 1; }
.option-row svg { color: var(--ink-subtle); flex-shrink: 0; transition: var(--transition); }
.option-row:hover { border-color: var(--gold); transform: translateX(3px); box-shadow: var(--shadow); }
.option-row:hover svg { color: var(--gold); transform: translateX(2px); }
.option-row:active { transform: translateX(1px) scale(0.99); }
.option-row:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; }
.option-row.selected { border-color: var(--gold); background: rgba(4,22,39,0.03); box-shadow: 0 0 0 3px rgba(184,148,90,0.12); }

.option-row.urgency-high { border-color: rgba(220,38,38,0.25); background: rgba(220,38,38,0.04); }
.option-row.urgency-high:hover { border-color: #dc2626; }
.option-row.urgency-high > span { color: #dc2626; font-weight: 700; }
.option-row.solvency-yes { border-color: rgba(22,163,74,0.25); background: rgba(22,163,74,0.04); }
.option-row.solvency-yes:hover { border-color: #16a34a; }
.option-row.solvency-yes > span { color: #16a34a; font-weight: 700; }
.option-row.rejection { border-color: var(--line); background: transparent; color: var(--ink-muted); }
.option-row.rejection:hover { border-color: var(--ink-subtle); color: var(--ink); transform: translateX(3px); }

/* Back */
.btn-back { margin-top: 24px; background: transparent; border: none; color: var(--ink-muted); font-size: 0.88rem; font-weight: 600; cursor: pointer; padding: 8px 0; transition: var(--transition-fast); font-family: inherit; }
.btn-back:hover { color: var(--navy); transform: translateX(-2px); }
.btn-back:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; }

/* Final */
.final-icon { width: 70px; height: 70px; border-radius: 50%; background: rgba(22,163,74,0.08); color: #16a34a; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; font-weight: 700; margin: 0 auto 18px; animation: pulseSuccess 2s ease-in-out infinite; }
.final-icon.info { background: rgba(4,22,39,0.06); color: var(--ink-muted); animation: none; }
@keyframes pulseSuccess { 0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0.3); } 50% { box-shadow: 0 0 0 14px rgba(22,163,74,0); } }

/* ============================================================
   FINAL STEP LINK (icono azul, no botón verde)
   ============================================================ */

.btn-retry { display: inline-flex; margin: 24px auto 0; padding: 14px 28px; background: var(--navy); color: var(--cream); border: none; border-radius: var(--radius-md); font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: var(--transition); font-family: inherit; }
.btn-retry:hover { background: #0b1f36; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-retry:active { transform: translateY(0) scale(0.98); }
.btn-retry:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 24px; margin-top: 60px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-footer p { margin: 0; color: var(--ink-muted); font-size: 0.82rem; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--ink-muted); text-decoration: none; font-size: 0.82rem; transition: var(--transition-fast); }
.footer-links a:hover { color: var(--gold); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .consulta-main { padding: 36px 16px 80px; }
  .wizard-card { padding: 28px 20px 28px; border-radius: var(--radius-sm); }
  .options-grid { grid-template-columns: 1fr; gap: 10px; }
  .option-card { padding: 18px 16px; }
  .option-row { padding: 14px 16px; font-size: 0.95rem; }
  .consulta-header h1 { font-size: 1.8rem; }
  .wa-fab { bottom: 16px; right: 16px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .final-icon { animation: none; }
  .btn-reset:hover { transform: none; }
  .wa-fab__glow { animation: none; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-subtle); }
