/* ============================================================
   INDEX - Landing Page tipo Diapositiva
   ============================================================ */

/* ============================================================
   PRELOADER
   ============================================================ */
.preloader {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--color-bg);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.preloader-logo {
    font-family: 'Great Vibes', 'Playfair Display', cursive;
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--color-gold);
    letter-spacing: 2px;
    text-shadow: 0 0 30px var(--color-gold-glow);
}

.preloader-bar {
    width: min(240px, 60vw);
    height: 2px;
    background: var(--color-border);
    border-radius: 999px;
    overflow: hidden;
}

.preloader-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold), var(--color-gold-light));
    border-radius: 999px;
    width: 0%;
    animation: preloader-fill 1.2s ease-out forwards;
}

@keyframes preloader-fill {
    to { width: 100%; }
}

/* ============================================================
   ESTADO PRELOADING (controlado desde <html>)
   Unificado: ya no se usa body.is-loading
   ============================================================ */
html.preloading {
    overflow: hidden;
    height: 100vh;
}

html.preloading body {
    overflow: hidden;
    height: 100vh;
}

html.preloading .preloader {
    display: flex;
}

/* Ocultar todo lo demas mientras carga */
html.preloading .header-global,
html.preloading .page-layout,
html.preloading .scene-nav,
html.preloading footer {
    opacity: 0;
    visibility: hidden;
}

/* ============================================================
   LANDING
   ============================================================ */
.landing-page {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: auto !important;
}

/* Cada seccion = una diapositiva full-screen */
.landing-page section[data-scene] {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

/* Contenido dentro de cada escena (se anima con GSAP) */
.scene-content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    /* Padding-top compensa el header fixed */
    padding: clamp(5rem, 9vh, 7rem) clamp(1rem, 3vw, 2rem) clamp(2rem, 4vh, 3rem);
    box-sizing: border-box;
}

.scene-content--centered {
    text-align: center;
}

.hero-scene-content {
    text-align: center;
    max-width: 900px;
    gap: 0;
}

/* ============================================================
   HEADER DE SECCION
   ============================================================ */
.section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-kicker {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-gold);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    line-height: 1.15;
}

/* ============================================================
   ESCENA 1: HERO
   ============================================================ */
.hero-central {
    background: var(--color-bg);
}

.hero-bg-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    will-change: transform;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(ellipse at center, rgba(9, 9, 13, 0.75) 0%, rgba(9, 9, 13, 0.55) 50%, rgba(9, 9, 13, 0.3) 100%);
}

html[data-theme="light"] .hero-overlay {
    background: radial-gradient(ellipse at center, rgba(61, 44, 2, 0.55) 0%, rgba(61, 44, 2, 0.35) 50%, rgba(61, 44, 2, 0.15) 100%);
}

.hero-badge {
    display: block;
    font-family: 'Great Vibes', 'Playfair Display', cursive;
    font-size: clamp(2.5rem, 4vw, 5.5rem);
    color: var(--color-gold);
    text-shadow: 0 4px 20px var(--color-gold-glow);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    font-weight: 800;
}

.hero-titulo {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 800;
    letter-spacing: 1px;
    margin: 0 0 1rem 0;
    background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 45%, var(--color-gold-dark) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.05;
}

.hero-subtitulo {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: rgba(234, 234, 240, 0.9);
    font-weight: 300;
    max-width: 560px;
    margin: 0 auto 2.5rem auto;
    line-height: 1.6;
}

html[data-theme="light"] .hero-subtitulo {
    color: rgba(255, 255, 226, 0.95);
}

.hero-botones-login {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-botones-login .boton {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2.2rem;
    font-size: 1rem;
    font-weight: 600;
    min-width: 180px;
    justify-content: center;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.hero-botones-login .boton svg {
    flex-shrink: 0;
}

.boton-principal {
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-dark)) !important;
    color: #111 !important;
    border: none !important;
    box-shadow: 0 8px 30px var(--color-gold-glow) !important;
}

.boton-principal:hover {
    box-shadow: 0 12px 40px var(--color-gold-glow) !important;
}

.boton-secundario {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border-light) !important;
    backdrop-filter: blur(10px);
}

html[data-theme="light"] .boton-secundario {
    background: rgba(255, 255, 226, 0.15) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 226, 0.35) !important;
}

.boton-secundario:hover {
    border-color: var(--color-gold) !important;
    background: rgba(212, 168, 83, 0.15) !important;
}

/* ============================================================
   ESCENA 2: FEATURES
   ============================================================ */
.features-section {
    background: var(--color-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    width: 100%;
}

.feature-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.75rem 2rem;
    text-align: center;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.feature-card:hover {
    border-color: var(--color-gold-dim);
    box-shadow: var(--shadow-medium), var(--shadow-glow);
}

.feature-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.2rem;
    color: var(--color-gold);
}

.feature-icon svg {
    stroke: var(--color-gold);
}

.feature-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: var(--color-text);
    margin: 0 0 0.6rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--color-text-secondary);
    line-height: 1.65;
    font-size: 0.92rem;
    margin: 0 0 1.5rem;
    flex: 1;
}

.feature-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.35rem 1.2rem;
    border-radius: 100px;
    background: var(--color-gold-dim);
    color: var(--color-gold);
    border: 1px solid var(--color-gold-dim);
    margin-top: auto;
}

/* ============================================================
   ESCENA 3: COMO FUNCIONA
   ============================================================ */
.como-funciona {
    background: var(--color-bg-alt);
}

.pasos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    width: 100%;
}

.paso {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.75rem 2rem;
    text-align: center;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.paso:hover {
    border-color: var(--color-gold-dim);
    box-shadow: var(--shadow-medium), var(--shadow-glow);
}

.paso-numero-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--color-gold);
    background: var(--color-gold-dim);
    border: 1px solid var(--color-gold-dim);
    padding: 0.25rem 0.7rem;
    border-radius: 100px;
    letter-spacing: 1px;
}

.paso-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.2rem;
    color: var(--color-gold);
}

.paso-icon svg {
    stroke: var(--color-gold);
}

.paso-titulo {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: var(--color-text);
    margin: 0 0 0.6rem;
    font-weight: 700;
}

.paso-texto {
    color: var(--color-text-secondary);
    line-height: 1.65;
    font-size: 0.92rem;
    margin: 0 0 1.5rem;
    flex: 1;
}

/* ============================================================
   ESCENA 4: FRASE
   ============================================================ */
.frase-section {
    position: relative;
    padding: 0;
}

.frase-bg-wrapper {
    position: absolute;
    inset: -10% 0;
    overflow: hidden;
    z-index: 1;
}

.frase-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 120%;
    object-fit: cover;
    object-position: center;
    will-change: transform;
}

.frase-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(9, 9, 13, 0.55) 0%, rgba(9, 9, 13, 0.75) 100%);
}

html[data-theme="light"] .frase-overlay {
    background: linear-gradient(180deg, rgba(61, 44, 2, 0.4) 0%, rgba(61, 44, 2, 0.65) 100%);
}

.frase-content {
    text-align: center;
    max-width: 900px;
    padding: 0 1rem;
}

.frase-texto {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

.frase-texto::before {
    content: '"';
    font-family: 'Playfair Display', serif;
    font-size: 1.2em;
    color: var(--color-gold);
    position: absolute;
    left: -0.4em;
    top: -0.2em;
    opacity: 0.5;
}

.frase-texto::after {
    content: '"';
    font-family: 'Playfair Display', serif;
    font-size: 1.2em;
    color: var(--color-gold);
    position: absolute;
    right: -0.4em;
    bottom: -0.5em;
    opacity: 0.5;
}

.frase-autor {
    display: block;
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-gold);
    font-weight: 600;
}

/* ============================================================
   ESCENA 5: CTA FINAL
   ============================================================ */
.cta-final {
    background: var(--color-bg);
    text-align: center;
}

.cta-content {
    max-width: 720px;
    gap: 0.75rem;
}

.cta-titulo {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 800;
    color: var(--color-text);
    margin: 0.5rem 0 1rem;
    line-height: 1.1;
}

.cta-subtitulo {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto 2.5rem;
}

.cta-boton {
    display: inline-flex !important;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2.5rem !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    text-decoration: none;
    cursor: pointer;
}

.cta-boton svg {
    flex-shrink: 0;
}

/* ============================================================
   NAVEGACION DE ESCENAS
   ============================================================ */
.scene-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.scene-nav.visible {
    opacity: 1;
}

.scene-nav-btn {
    pointer-events: auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--color-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--color-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 10px var(--color-gold-dark);
    transition: background 0.25s ease, color 0.25s ease,
                border-color 0.25s ease, box-shadow 0.25s ease,
                opacity 0.3s ease;
}

.scene-nav-btn:hover {
    background: var(--color-gold);
    color: #111;
    border-color: var(--color-gold);
    box-shadow: 0 0 20px var(--color-gold-glow);
}

.scene-nav-btn:active {
    /* Sin transform: solo cambio de color */
    background: var(--color-gold-dark);
    color: #111;
    border-color: var(--color-gold-dark);
}

.scene-nav-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.scene-nav-btn svg {
    stroke: currentColor;
    display: block;
}

html.preloading .scene-nav {
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   RESPONSIVE - TABLET
   ============================================================ */
@media (max-width: 991px) {
    .landing-page section[data-scene] {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .scene-content {
        padding: clamp(5rem, 9vh, 7rem) clamp(1rem, 3vw, 1.5rem) clamp(3rem, 6vh, 4rem);
    }

    .features-grid,
    .pasos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }

    .features-grid > *:last-child,
    .pasos-grid > *:last-child {
        grid-column: 1 / -1;
        max-width: 60%;
        margin: 0 auto;
    }

    .feature-card,
    .paso {
        padding: 2rem 1.5rem 1.75rem;
    }

    .scene-content {
        gap: 1.5rem;
    }
}

/* ============================================================
   RESPONSIVE - MOVIL
   ============================================================ */
@media (max-width: 640px) {
    .landing-page section[data-scene] {
        min-height: 100vh;
    }

    .scene-content {
        padding: clamp(4.5rem, 8vh, 6rem) 1rem clamp(2.5rem, 5vh, 3.5rem);
        gap: 1.25rem;
    }

    .features-grid,
    .pasos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .features-grid > *:last-child,
    .pasos-grid > *:last-child {
        max-width: 100%;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-kicker {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }

    .hero-badge {
        font-size: 2.5rem;
    }

    .hero-titulo {
        font-size: 2.2rem;
    }

    .hero-subtitulo {
        font-size: 0.95rem;
        margin-bottom: 1.75rem;
    }

    .hero-botones-login {
        flex-direction: column;
        width: 100%;
    }

    .hero-botones-login .boton {
        width: 100%;
        min-width: unset;
    }

    .feature-card,
    .paso {
        padding: 1.75rem 1.25rem 1.5rem;
    }

    .feature-card h3,
    .paso-titulo {
        font-size: 1.15rem;
    }

    .feature-card p,
    .paso-texto {
        font-size: 0.88rem;
    }

    .frase-texto {
        font-size: 1.6rem;
    }

    .cta-titulo {
        font-size: 1.75rem;
    }

    .cta-subtitulo {
        font-size: 0.95rem;
    }

    .scene-nav {
        display: none;
    }
}

/* ============================================================
   OVERRIDES DEL BASE_SITE EN LA LANDING
   ============================================================ */

/* El layout no reserva espacio para el header (que sera fixed) */
body.is-landing .page-layout {
    padding: 0 !important;
    margin: 0 !important;
}

body.is-landing .layout-content {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

body.is-landing .breadcrumb {
    display: none !important;
}

body.is-landing footer {
    display: none !important;
}

body.is-landing .btn-retroceder {
    display: none !important;
}

/* Header en la landing: FIJO para no reservar espacio */
body.is-landing .header-global {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    background: var(--glass-bg);
    border-bottom: none;
    transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

body.is-landing .header-global.scrolled {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.185);
}

html.preloading .header-global,
html.preloading .sidebar {
    opacity: 0;
    pointer-events: none;
}

html.preloading .mensajes-flash,
html.preloading .messages-container {
    display: none !important;
}