:root {
    --bg: #F9FAFB;
    --card: #FFFFFF;
    --fg: #0A0A0A;
    --muted: #F3F4F6;
    --muted-fg: #6B7280;
    --border: #E5E7EB;
    --green: #22C55E;
    --green-dark: #16A34A;
    --green-light: #DCFCE7;
    --red: #EF4444;
    --orange: #F59E0B;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 16px 100px;
}

/* ── LOGO ── */
.logo-bar {
    width: 100%;
    max-width: 620px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}
.logo-mark img {
    height: 36px;
    width: auto;
    display: block;
}

/* ── CONTENEDOR ── */
.container {
    max-width: 620px;
    width: 100%;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 48px 44px;
    position: relative;
}

/* ── PROGRESS BAR ── */
.progress-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 32px;
}
.progress-step {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    transition: background 300ms ease;
}
.progress-step.done {
    background: var(--green);
}
.progress-step.current {
    background: var(--green);
    opacity: 0.5;
}

/* ── SCREENS ── */
.screen { display: none; }
.screen.active { display: block; animation: fadeUp 220ms ease-out; }

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

/* ── TITULO ── */
.q-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--fg);
    margin-bottom: 8px;
}

.q-subtitle {
    font-size: 0.9rem;
    color: var(--muted-fg);
    margin-bottom: 32px;
    line-height: 1.55;
}

/* ── PHONE PREFIX ── */
.phone-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.phone-prefix {
    flex-shrink: 0;
    padding: 14px 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--fg);
    transition: border-color 150ms, box-shadow 150ms;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}
.phone-prefix:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}
.phone-wrap .text-input { flex: 1; }

/* ── INPUT TEXTO ── */
.input-wrap { margin-bottom: 20px; }

.field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-fg);
    margin-bottom: 6px;
}

.text-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--fg);
    transition: border-color 150ms, box-shadow 150ms;
    outline: none;
}
.text-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}
.text-input::placeholder { color: #9CA3AF; font-weight: 400; }

.input-error {
    font-size: 12px;
    font-weight: 500;
    color: var(--red);
    margin-top: 6px;
    opacity: 0;
    transition: opacity 150ms;
}
.input-error.show { opacity: 1; }

.field-hint {
    font-size: 12px;
    color: var(--muted-fg);
    margin-top: 6px;
    line-height: 1.4;
}

/* ── PILLS ── */
.pills {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 32px;
}

.pill {
    padding: 16px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 150ms ease;
    background: var(--card);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--fg);
    line-height: 1.45;
}
.pill:hover {
    border-color: var(--green);
    background: var(--green-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.pill.selected {
    border-color: var(--green);
    background: var(--green-light);
    color: var(--green-dark);
}

/* ── CAMPO "OTRO" ── */
.other-input-wrap {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 300ms ease, opacity 200ms ease, margin 200ms ease;
    margin-top: 0;
}
.other-input-wrap.show {
    max-height: 120px;
    opacity: 1;
    margin-top: 10px;
}

/* ── CONSENT ── */
.consent-wrap {
    margin: 20px 0;
    padding: 16px;
    background: var(--muted);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
}
.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}
.consent-check {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--card);
    cursor: pointer;
    margin-top: 2px;
    transition: all 150ms;
    appearance: none;
    position: relative;
}
.consent-check:checked {
    background: var(--green);
    border-color: var(--green);
}
.consent-check:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}
.consent-text {
    font-size: 0.82rem;
    color: var(--muted-fg);
    line-height: 1.55;
}
.consent-text a { color: var(--fg); font-weight: 600; text-decoration: underline; }
.consent-error {
    font-size: 12px;
    font-weight: 500;
    color: var(--red);
    margin-top: 8px;
    opacity: 0;
    transition: opacity 150ms;
}
.consent-error.show { opacity: 1; }

/* ── BOTON PRINCIPAL ── */
@keyframes cta-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}
.btn {
    width: 100%;
    padding: 16px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: var(--green);
    border: none;
    border-radius: 99px;
    cursor: pointer;
    transition: all 150ms ease;
    letter-spacing: -0.01em;
}
.btn:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}
.btn:active { transform: translateY(0); }
.btn.pulsing { animation: cta-pulse 2.5s infinite; }

.btn-secondary {
    width: 100%;
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--green-dark);
    background: var(--green-light);
    border: 1.5px solid var(--green);
    border-radius: 99px;
    cursor: pointer;
    transition: all 150ms ease;
    margin-top: 10px;
}
.btn-secondary:hover {
    background: var(--green);
    color: #fff;
}

/* ── LOADING ── */
.loading-wrap {
    text-align: center;
    padding: 60px 0;
}
.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 6px;
    transition: opacity 150ms;
}
.loading-sub {
    font-size: 0.85rem;
    color: var(--muted-fg);
}

/* ── CONFIRMACION ── */
.confirm-wrap { text-align: center; }

.confirm-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--green-dark);
    background: var(--green-light);
    padding: 6px 14px;
    border-radius: 99px;
    margin-bottom: 16px;
}

.confirm-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--fg);
    line-height: 1.2;
    margin-bottom: 16px;
}

/* ── COUNTDOWN ── */
.countdown-wrap {
    background: var(--green-light);
    border: 1.5px solid var(--green);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}
.countdown-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--green-dark);
    margin-bottom: 6px;
}
.countdown-timer {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--green-dark);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    margin-bottom: 10px;
}
.countdown-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(34,197,94,0.2);
    border-radius: 99px;
    overflow: hidden;
}
.countdown-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--green);
    border-radius: 99px;
    transition: width 1s linear;
}
.countdown-done .countdown-label {
    color: var(--green-dark);
}
.countdown-done .countdown-timer {
    font-size: 1.1rem;
    font-weight: 700;
}

.confirm-text {
    font-size: 0.9rem;
    color: var(--muted-fg);
    line-height: 1.6;
    max-width: 460px;
    margin: 0 auto 28px;
}

.confirm-steps {
    text-align: left;
    max-width: 420px;
    margin: 0 auto 28px;
}
.confirm-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.confirm-step-num {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--green-dark);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-step-text {
    font-size: 0.88rem;
    color: var(--fg);
    line-height: 1.5;
}

.confirm-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}

.confirm-cta-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-fg);
    margin-bottom: 8px;
}

.confirm-cta-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--fg);
    line-height: 1.25;
    margin-bottom: 8px;
}

.confirm-cta-sub {
    font-size: 0.85rem;
    color: var(--muted-fg);
    line-height: 1.5;
    margin-bottom: 20px;
}

.whatsapp-btn {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green-dark);
    margin-top: 12px;
    text-decoration: none;
}
.whatsapp-btn:hover { text-decoration: underline; }

.privacy-line {
    text-align: center;
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--muted-fg);
}
.privacy-line a { color: var(--muted-fg); text-decoration: underline; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    body { padding: 16px 12px 80px; }
    .container { padding: 32px 24px; }
    .q-title { font-size: 1.4rem; }
    .confirm-title { font-size: 1.3rem; }
}
