/* =====================================================
   IN MAZATLÁN: Estilos de la landing page
   Paleta tomada del logo:
     · Azul marino  #0E3C60  (color principal)
     · Beige / tan  #C7B38E  (secundario, la ola)
     · Naranja      #F2872B  (acento, el "sol")
     · Fondo blanco #FFFFFF
   Idea de diseño: "la línea del horizonte". La ola del logo
   separa secciones y el sol marca lo que está activo
   (progreso, opción elegida). Diseño limpio y responsivo.
   ===================================================== */

/* --- 1. Variables de color y medidas --- */
:root {
    --navy: #0e3c60;
    --navy-dark: #0a2c46;
    --tan: #c7b38e;
    --tan-light: #e5d8bf;
    --tan-tint: #faf6ee;
    --orange: #f2872b;
    --orange-dark: #e07a1f;
    --orange-text: #a5500a; /* naranja oscuro, legible sobre blanco (contraste AA) */
    --white: #ffffff;
    --ink: #0e3c60;        /* texto principal */
    --ink-soft: #4a5c72;   /* texto secundario */
    --line: #e7e1d5;       /* hairlines y bordes */
    --field: #f7f9fb;
    --success: #1f9d6b;
    --error: #c53a3a;
    --radius: 14px;
    --shadow: 0 14px 34px rgba(14, 60, 96, 0.10);
    --shadow-soft: 0 2px 8px rgba(14, 60, 96, 0.06);
}

/* --- 2. Reset básico --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* La página ocupa al menos toda la pantalla para que el pie toque el fondo */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Asegura que el atributo "hidden" siempre oculte el elemento */
[hidden] {
    display: none !important;
}

/* Un solo estilo de foco, visible con teclado en toda la página */
:focus-visible {
    outline: 3px solid var(--orange-text);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Iconos SVG en línea (cheurón, candado, check): heredan el color del texto */
.icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
}

/* --- 3. Botones reutilizables --- */
.btn {
    display: inline-block;
    border: none;
    border-radius: 999px;
    padding: 16px 30px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* Botón principal: el naranja del sol del logo.
   Sin resplandor de color: el naranja ya destaca por sí solo (R-13). */
.btn--primary {
    background: var(--orange);
    color: var(--navy-dark);
}

.btn--primary:hover {
    background: var(--orange-dark);
    transform: translateY(-2px);
}

.btn--full {
    width: 100%;
    margin-top: 10px;
}

/* --- 4. Barra de navegación --- */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 6%;
    position: relative;
    z-index: 2;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 52px;
    width: auto;
}

/* Enlace de acción del nav (lleva al formulario) */
.nav-cta {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    padding: 9px 18px;
    border: 1px solid var(--tan);
    border-radius: 999px;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-cta:hover {
    background: var(--tan-tint);
    border-color: var(--tan);
}

/* --- 5. Hero (fondo blanco, como el logo) --- */
.hero {
    background: var(--white);
    color: var(--ink);
    /* Crece para ocupar el alto sobrante y empujar el pie hasta el fondo */
    flex: 1 0 auto;
}

/* Banda con la foto: el texto y la tarjeta van por encima */
.hero__stage {
    position: relative;
    overflow: hidden;
    background: var(--navy-dark); /* color mientras carga la foto */
    color: var(--white);
}

.hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 58%;
    display: block;
}

/* Capa oscura para que el texto blanco se lea sobre la foto */
.hero__stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(7, 27, 45, 0.72) 0%, rgba(7, 27, 45, 0.30) 52%, rgba(7, 27, 45, 0) 78%),
        linear-gradient(180deg,
            rgba(7, 27, 45, 0.68) 0%,
            rgba(7, 27, 45, 0.52) 45%,
            rgba(7, 27, 45, 0.85) 100%);
}

/* Dos columnas en escritorio: el argumento y el calificador */
.hero__grid {
    position: relative;
    z-index: 2;
    max-width: 1080px;
    margin: 0 auto;
    padding: 64px 6% 72px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 52px;
    align-items: start;
}

.hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tan-light);
    margin-bottom: 16px;
}

/* El "sol" del logo como punto que marca la preventa */
.hero__kicker::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--orange);
}

.hero__title {
    font-size: clamp(2.1rem, 5.2vw, 3.4rem);
    line-height: 1.06;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 20px;
    text-wrap: balance;
}

.hero__subtitle {
    font-size: 1.07rem;
    color: rgba(255, 255, 255, 0.92);
    max-width: 46ch;
    margin-bottom: 28px;
    line-height: 1.65;
    text-wrap: pretty;
}

/* Ficha breve con los datos duros de la oferta */
.specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 34px;
    border-top: 1px solid rgba(255, 255, 255, 0.30);
    padding-top: 20px;
}

.spec {
    display: flex;
    flex-direction: column;
}

.spec__label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.80);
    margin-bottom: 2px;
}

.spec__value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
}

/* --- 6. Tarjeta del formulario (el protagonista) --- */
.card {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    text-align: left;
    /* Reservamos altura para que la tarjeta no salte entre pasos */
    min-height: 400px;
}

/* --- 7. Barra de progreso (de la ola al sol) --- */
.progress {
    width: 100%;
    height: 6px;
    background: var(--tan-light);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress__bar {
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, var(--tan), var(--orange));
    border-radius: 999px;
    transition: width 0.35s ease;
}

.progress__label {
    font-size: 0.8rem;
    color: var(--ink-soft);
    text-align: right;
    margin-bottom: 24px;
    font-variant-numeric: tabular-nums;
}

/* --- 8. Pasos y preguntas --- */
.step__question {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 18px;
    color: var(--navy);
}

.step__hint {
    font-size: 0.9rem;
    color: var(--ink-soft);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* --- 9. Opciones tipo tarjeta --- */
.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 6px;
}

.option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    background: var(--white);
    transition: border-color 0.15s ease, background 0.15s ease;
}

/* Círculo a la izquierda: se convierte en "sol" al elegir */
.option::before {
    content: "";
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--tan);
    background: var(--white);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.option:hover {
    border-color: var(--tan);
    background: var(--tan-tint);
}

/* Ocultamos el radio nativo, pero sigue funcionando con clic y teclado */
.option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.option__text {
    font-size: 1rem;
    color: var(--ink-soft);
}

/* Opción elegida: borde marino, fondo beige y el "sol" encendido */
.option:has(input:checked) {
    border-color: var(--navy);
    background: var(--tan-tint);
}

.option:has(input:checked)::before {
    background: var(--orange);
    border-color: var(--orange);
    box-shadow: inset 0 0 0 3px var(--white);
}

.option:has(input:checked) .option__text {
    color: var(--navy);
    font-weight: 600;
}

/* Accesibilidad: resalta la tarjeta cuando se navega con teclado */
.option:has(input:focus-visible) {
    outline: 3px solid var(--orange-text);
    outline-offset: 2px;
}

/* Enlace sutil para regresar a la pregunta anterior */
.back-link {
    display: block;
    background: none;
    border: none;
    padding: 0;
    margin: -12px 0 18px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--ink-soft);
    cursor: pointer;
    transition: color 0.15s ease;
}

.back-link:hover {
    color: var(--orange-text);
    text-decoration: underline;
}

.back-link .icon {
    margin-right: 4px;
}

/* --- 10. Campos de texto --- */
.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 7px;
}

.field input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--navy);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--field);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.field input:focus {
    outline: none;
    border-color: var(--orange-text);
    box-shadow: 0 0 0 3px rgba(242, 135, 43, 0.30);
    background: var(--white);
}

.field input.invalid {
    border-color: var(--error);
    background: #fff5f5;
}

/* --- 11. Mensajes de error --- */
.error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 8px;
    min-height: 0;
}

/* --- 12. Botón final del formulario --- */
#submitBtn {
    margin-top: 10px;
}

/* Texto de confianza bajo el botón final */
.trust-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 12px;
}

.trust-note .icon {
    margin-right: 6px;
}

/* --- 13. Pantallas de estado (spinner y éxito) --- */
.status {
    text-align: center;
    padding: 30px 10px;
}

.spinner {
    width: 62px;
    height: 62px;
    margin: 10px auto 26px;
    border: 5px solid var(--tan-light);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: girar 0.9s linear infinite;
}

@keyframes girar {
    to {
        transform: rotate(360deg);
    }
}

.status__title {
    font-size: 1.35rem;
    color: var(--navy);
    margin-bottom: 10px;
}

.status__text {
    color: var(--ink-soft);
    max-width: 420px;
    margin: 0 auto;
}

.success__icon {
    width: 72px;
    height: 72px;
    margin: 10px auto 24px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--tan-light);
    font-size: 2.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: aparecer 0.4s ease;
}

@keyframes aparecer {
    from {
        transform: scale(0.6);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Pantalla de error de envío: mismo círculo, en rojo */
.error__icon {
    width: 72px;
    height: 72px;
    margin: 10px auto 24px;
    border-radius: 50%;
    background: var(--error);
    color: var(--white);
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: aparecer 0.4s ease;
}

/* --- 14. Divisor "ola" y beneficios --- */
.horizon {
    display: block;
    width: 100%;
    height: 40px;
    margin: 52px 0 0;
    opacity: 0.75;
}

/* Razones para invertir: tres columnas alineadas a la izquierda, sin iconos */
.reasons {
    list-style: none;
    max-width: 1080px;
    margin: 0 auto;
    padding: 26px 6% 64px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 22px 44px;
}

.reason {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.reason__lead {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
}

.reason__detail {
    font-size: 0.95rem;
    color: var(--ink-soft);
}

/* --- 15. Pie de página --- */
.footer {
    background: var(--navy-dark);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 34px 6%;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.footer__note {
    color: var(--tan);
    margin-top: 6px;
    font-size: 0.85rem;
}

/* --- 16. Ajustes para pantallas medianas y móvil --- */
@media (max-width: 880px) {
    .hero__grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .hero__subtitle {
        max-width: none;
    }

    .card {
        min-height: 0;
    }
}

@media (max-width: 520px) {
    .nav-cta {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .logo img {
        height: 44px;
    }

    .hero__grid {
        padding: 44px 6% 52px;
    }

    .card {
        padding: 24px 20px;
    }

    .reasons {
        gap: 18px;
        padding-bottom: 48px;
    }

    .horizon {
        margin-top: 40px;
    }
}

/* --- 17. Menos movimiento si el usuario lo pide --- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
