/* ============================================================
   CIVITAS — Consulta Wizard CSS (Moderno 2026)
   Glassmorphism · Navy + Gold · Micro-animaciones
   ============================================================ */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f3f1ed;
    --primary: #041627;
    --primary-2: #1a2b3c;
    --primary-soft: rgba(4, 22, 39, 0.04);
    --gold: #b8945a;
    --gold-hover: #a07f48;
    --text: #041627;
    --text-muted: #5a6471;
    --text-subtle: #8a93a0;
    --border: rgba(4, 22, 39, 0.08);
    --border-strong: rgba(4, 22, 39, 0.16);
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.08);
    --error: #dc2626;
    --error-soft: rgba(220, 38, 38, 0.06);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow: 0 1px 3px rgba(4, 22, 39, 0.04), 0 1px 2px rgba(4, 22, 39, 0.02);
    --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);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #04101a;
        --surface: #0a1928;
        --surface-2: #122a3f;
        --primary: #f1f5f9;
        --primary-2: #cbd5e1;
        --primary-soft: rgba(241, 245, 249, 0.04);
        --gold: #d4ab6e;
        --gold-hover: #b8945a;
        --text: #f1f5f9;
        --text-muted: #94a3b8;
        --text-subtle: #64748b;
        --border: rgba(241, 245, 249, 0.08);
        --border-strong: rgba(241, 245, 249, 0.16);
    }
}

*, *::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(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Background ambient gradient */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(184, 148, 90, 0.08), transparent 50%),
        radial-gradient(circle at 80% 100%, rgba(4, 22, 39, 0.04), transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ============================================================
   NAV
   ============================================================ */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251, 249, 250, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.nav-links {
    display: flex;
    gap: 8px;
}
.nav-links a {
    padding: 8px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition-fast);
}
.nav-links a:hover { color: var(--primary); background: var(--primary-soft); }
.nav-links a.active { color: var(--gold); }

/* ============================================================
   MAIN
   ============================================================ */
.consulta-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}
.consulta-header { text-align: center; margin-bottom: 40px; }
.consulta-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-soft);
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 999px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
.consulta-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    text-wrap: balance;
    line-height: 1.15;
}
.consulta-header p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    text-wrap: pretty;
}
.consulta-header strong { color: var(--gold); font-weight: 700; }

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

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

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

/* Steps */
.wizard-step {
    display: none;
    animation: stepIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.wizard-step.active { display: block; }

@keyframes stepIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 8px;
    color: var(--primary);
    text-wrap: balance;
    letter-spacing: -0.01em;
}
.step-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 auto 28px;
    max-width: 480px;
    text-wrap: pretty;
}

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

/* ============================================================
   OPTIONS — Steps 2-4 (Lista de filas)
   ============================================================ */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}
.option-row {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    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(--text);
    transition: var(--transition);
}
.option-row > span { flex: 1; }
.option-row svg { color: var(--text-subtle); flex-shrink: 0; transition: var(--transition); }

.option-row:hover {
    border-color: var(--gold);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}
.option-row:hover svg { color: var(--gold); transform: translateX(4px); }
.option-row:active { transform: translateX(2px) scale(0.99); }
.option-row:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
.option-row.selected {
    border-color: var(--gold);
    background: var(--primary-soft);
    box-shadow: 0 0 0 3px rgba(184, 148, 90, 0.15);
}

.option-row.urgency-high {
    border-color: rgba(220, 38, 38, 0.3);
    background: var(--error-soft);
}
.option-row.urgency-high:hover {
    border-color: var(--error);
}
.option-row.urgency-high > span { color: var(--error); }

.option-row.solvency-yes {
    border-color: rgba(22, 163, 74, 0.3);
    background: var(--success-soft);
}
.option-row.solvency-yes:hover { border-color: var(--success); }
.option-row.solvency-yes > span { color: var(--success); }

.option-row.rejection {
    border-color: var(--border);
    background: transparent;
    color: var(--text-muted);
}
.option-row.rejection:hover {
    border-color: var(--text-subtle);
    color: var(--text);
    transform: translateX(4px);
}

/* ============================================================
   BACK BUTTON
   ============================================================ */
.btn-back {
    margin-top: 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    transition: var(--transition);
    font-family: inherit;
}
.btn-back:hover { color: var(--primary); transform: translateX(-2px); }
.btn-back:focus-visible { outline: 2px solid var(--gold); outline-radius: 4px; }

/* ============================================================
   FINAL / SUCCESS
   ============================================================ */
.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 auto 20px;
    animation: pulseSuccess 1.5s ease-in-out infinite;
}
@keyframes pulseSuccess {
    0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.3); }
    50% { box-shadow: 0 0 0 12px rgba(22, 163, 74, 0); }
}
.info-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.btn-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 24px auto 0;
    padding: 16px 28px;
    background: linear-gradient(135deg, #25d366, #1ebe5d);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius);
    letter-spacing: 0.02em;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
    transition: var(--transition);
    font-family: inherit;
    text-align: center;
}
.btn-wa:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.4);
}
.btn-wa:active { transform: translateY(0) scale(0.98); }
.btn-wa:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.btn-retry {
    display: inline-flex;
    margin: 24px auto 0;
    padding: 14px 28px;
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-retry:hover { background: var(--primary-2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-retry:active { transform: translateY(0) scale(0.98); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    border-top: 1px solid var(--border);
    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(--text-muted);
    font-size: 0.85rem;
}
.footer-links {
    display: flex;
    gap: 20px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}
.footer-links a:hover { color: var(--gold); }

/* ============================================================
   WHATSAPP FAB
   ============================================================ */
.wa-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 22px;
    background: #25d366;
    color: white;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    z-index: 40;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.wa-fab::before {
    content: '';
    width: 18px; height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.521.151-.172.2-.296.3-.495.099-.198.05-.372-.025-.521-.075-.148-.669-1.611-.916-2.206-.242-.579-.487-.501-.669-.51l-.57-.01c-.198 0-.52.074-.792.372s-1.04 1.016-1.04 2.479 1.065 2.876 1.213 3.074c.149.198 2.095 3.2 5.076 4.487.709.306 1.263.489 1.694.626.712.226 1.36.194 1.872.118.571-.085 1.758-.719 2.006-1.413.248-.695.248-1.29.173-1.414z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.wa-fab:hover { transform: scale(1.05); box-shadow: 0 12px 32px rgba(37, 211, 102, 0.5); }
.wa-fab:focus-visible { outline: 2px solid white; outline-offset: 3px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .nav-inner { padding: 12px 16px; }
    .nav-links { gap: 0; }
    .nav-links a { padding: 6px 10px; font-size: 0.8rem; }
    .nav-links a.active { background: var(--primary-soft); }

    .consulta-main { padding: 32px 16px 80px; }
    .wizard-card { padding: 28px 20px; }

    .options-grid { grid-template-columns: 1fr; }
    .option-card { padding: 18px 16px; }
    .option-row { padding: 16px 18px; font-size: 0.95rem; }

    .consulta-header h1 { font-size: 1.8rem; }

    .wa-fab { bottom: 16px; right: 16px; padding: 12px 18px; }
    .wa-fab span { display: none; }
    .wa-fab::before { width: 22px; height: 22px; }

    .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;
    }
    .success-icon { animation: none; }
    .btn-reset:hover { transform: none; }
}

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