/* ============================================================================
   ANIMACIONES Y MOVIMIENTO — Soluciones KRG
   ----------------------------------------------------------------------------
   Archivo NUEVO y separado a propósito: style.css no se toca.
   Si algún día quieres volver al diseño quieto, borra la línea que carga este
   archivo en el HTML y el sitio queda exactamente como estaba.

   Decisiones acordadas:
     - Sin librerías externas (solo CSS y JavaScript propio).
     - Intensidad: sutil y elegante.
     - Tarjetas: se levantan más, con sombra de resplandor degradado. SIN borde.
     - Degradado: azul corporativo #0056b3 -> celeste medio #0ea5e9.
     - Portada: título y bajada escalonados + fondo con zoom muy lento.
     - Se respeta la opción "reducir movimiento" del sistema operativo.
   ============================================================================ */

/* --------------------------------------------------------------- VARIABLES */
:root {
    --acento-desde: #0056b3;
    --acento-hasta: #0ea5e9;

    /* Sombra de las tarjetas al levantarse: lleva el resplandor del degradado */
    --brillo-tarjeta:
        0 18px 34px rgba(14, 165, 233, 0.26),
        0 6px 16px rgba(15, 23, 42, 0.10);
}

.dark-theme {
    --brillo-tarjeta:
        0 18px 36px rgba(14, 165, 233, 0.30),
        0 6px 18px rgba(0, 0, 0, 0.55);
}

/* ============================================================================
   1. APARICION SUAVE AL ENTRAR EN PANTALLA
   ----------------------------------------------------------------------------
   La clase .anim la pone el JavaScript. El retraso (--retraso) también, para
   que los elementos que entran juntos aparezcan uno tras otro.
   ============================================================================ */

.anim {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
        transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--retraso, 0ms);
}

.anim.anim-visible {
    opacity: 1;
    transform: none;
}

/* ============================================================================
   2. TARJETAS: LEVANTAR + RESPLANDOR
   ============================================================================ */

.card,
.bloque,
.articulo {
    transition: transform 0.32s ease, box-shadow 0.32s ease;
}

.card:hover,
.card:focus-within,
.bloque:hover,
.articulo:hover {
    transform: translateY(-9px);
    box-shadow: var(--brillo-tarjeta);
}

/* La foto crece un poquito dentro de su marco (sutil, sin salirse) */
.card .item-image,
.articulo .portada-articulo {
    transition: transform 0.45s ease;
}

.card:hover .item-image {
    transform: scale(1.04);
}

/* ============================================================================
   3. PORTADA: FONDO CON ZOOM LENTO Y TEXTO ESCALONADO
   ----------------------------------------------------------------------------
   El fondo se mueve en un pseudo-elemento para que el texto NO se agrande.
   ============================================================================ */

.hero {
    position: relative;
    overflow: hidden;
    background-image: none;   /* el fondo pasa al pseudo-elemento de abajo */
}

.hero::before {
    content: '';
    position: absolute;
    /* Se agranda un poco el área para que al hacer zoom no se vean los bordes */
    inset: -5%;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
        url('../banner-alt.png');
    background-size: cover;
    background-position: center;
    animation: zoomLento 26s ease-in-out infinite alternate;
    z-index: 0;
}

.hero > * {
    position: relative;
    z-index: 1;
}

@keyframes zoomLento {
    from { transform: scale(1); }
    to   { transform: scale(1.07); }
}

/* El título entra primero y la bajada justo después */
.hero h1 {
    animation: entraDesdeAbajo 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.hero p {
    animation: entraDesdeAbajo 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.18s both;
}

@keyframes entraDesdeAbajo {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}

/* ============================================================================
   4. BARRA DE PROGRESO DE LECTURA
   ----------------------------------------------------------------------------
   La línea fina de arriba. El JavaScript la crea y la estira según cuánto
   has bajado. Lleva el degradado acordado.
   ============================================================================ */

.barra-lectura {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--acento-desde), var(--acento-hasta));
    transform: scaleX(0);
    transform-origin: 0 50%;
    z-index: 3000;
    pointer-events: none;
    transition: transform 0.08s linear;
}

/* ============================================================================
   5. BOTON PARA VOLVER ARRIBA
   ----------------------------------------------------------------------------
   Queda justo encima del botón de WhatsApp, alineado al mismo borde derecho,
   para que no se tapen ni se salgan en pantallas chicas.
   ============================================================================ */

.volver-arriba {
    position: fixed;
    right: 30px;
    bottom: 104px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(140deg, var(--acento-desde), var(--acento-hasta));
    color: #ffffff;
    font-size: 1.35rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.volver-arriba.visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.volver-arriba:hover {
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.5);
}

/* ============================================================================
   6. BOTONES: EL BRILLO QUE SE DESLIZA
   ----------------------------------------------------------------------------
   Solo en los botones rellenos. El destello cruza al pasar el mouse, no en
   bucle, para no distraer.
   ============================================================================ */

.price,
.submit-btn,
.btn-plan-zero,
.btn-enviar {
    position: relative;
    overflow: hidden;
}

.price::after,
.submit-btn::after,
.btn-plan-zero::after,
.btn-enviar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        115deg,
        transparent 35%,
        rgba(255, 255, 255, 0.38) 50%,
        transparent 65%
    );
    transform: translateX(-130%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.price:hover::after,
.submit-btn:hover::after,
.btn-plan-zero:hover::after,
.btn-enviar:hover::after {
    transform: translateX(130%);
}

/* ============================================================================
   7. CARTEL AZUL: SE DETIENE AL PASAR EL MOUSE
   ============================================================================ */

.top-banner:hover .marquee-track,
.marquee-track:hover {
    animation-play-state: paused;
}

/* ============================================================================
   8. ENCUESTA: RESULTADO QUE APARECE CON EFECTO
   ----------------------------------------------------------------------------
   La clase la agrega el JavaScript cuando el resultado se muestra. No se tocó
   la lógica de la encuesta.
   ============================================================================ */

#quiz-result.entra-resultado {
    animation: resultadoAparece 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes resultadoAparece {
    0%   { opacity: 0; transform: translateY(14px) scale(0.97); }
    60%  { opacity: 1; transform: translateY(0) scale(1.01); }
    100% { opacity: 1; transform: none; }
}

/* Las opciones de la encuesta se destacan al pasar el mouse */
.quiz-container .question-block label {
    transition: color 0.2s ease, transform 0.2s ease;
}

.quiz-container .question-block label:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* ============================================================================
   9. ACCESIBILIDAD: SI EL SISTEMA PIDE MENOS MOVIMIENTO, SE APAGA TODO
   ----------------------------------------------------------------------------
   Es una opción del sistema operativo para personas que se marean con el
   movimiento. Se respeta y no se pregunta.
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    /* Lo que estaba oculto esperando animarse, se muestra de inmediato */
    .anim {
        opacity: 1 !important;
        transform: none !important;
    }

    .hero::before {
        animation: none;
        inset: 0;
    }

    .hero h1,
    .hero p {
        animation: none;
        opacity: 1;
    }

    .barra-lectura {
        display: none;
    }

    .volver-arriba {
        transition: none;
    }
}
