/* REGLAS GLOBALES Y UX CERO RUIDO ("Above the fold") */
/* Cero scroll en escritorio (landing/intake). En móvil/Safari el 100vh recorta
   contenido detrás de la barra del navegador: ahí el scroll principal debe funcionar. */
body:has(#fnc-landing-wrapper),
body:has(.fnc-intake-fullscreen-bg) {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    font-family: 'Montserrat', sans-serif;
}

body:has(#fnc-landing-wrapper) #base-wrapper,
body:has(.fnc-intake-fullscreen-bg) #base-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    min-height: 0;
}

body:has(#fnc-landing-wrapper) #base-content,
body:has(.fnc-intake-fullscreen-bg) #base-content {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    margin-top: 4.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body:has(#fnc-landing-wrapper) #fnc-navegation,
body:has(.fnc-intake-fullscreen-bg) #fnc-navegation {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
}

body:has(#fnc-landing-wrapper) #base-footer,
body:has(.fnc-intake-fullscreen-bg) #base-footer {
    flex-shrink: 0 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 20 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

/* iPhone/Safari y pantallas estrechas: scroll del documento (no solo un div interno) */
@media (max-width: 1024px), (max-height: 900px) {
    html:has(body:has(#fnc-landing-wrapper)),
    html:has(body:has(.fnc-intake-fullscreen-bg)),
    body:has(#fnc-landing-wrapper),
    body:has(.fnc-intake-fullscreen-bg) {
        height: auto !important;
        max-height: none !important;
        min-height: 100%;
        min-height: 100dvh;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: auto;
    }

    body:has(#fnc-landing-wrapper) #base-wrapper,
    body:has(.fnc-intake-fullscreen-bg) #base-wrapper,
    body:has(#fnc-landing-wrapper) #base-content,
    body:has(.fnc-intake-fullscreen-bg) #base-content,
    body:has(#fnc-landing-wrapper) #fnc-navegation,
    body:has(.fnc-intake-fullscreen-bg) #fnc-navegation {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow: visible !important;
        flex: 1 0 auto !important;
    }

    body:has(#fnc-landing-wrapper) #base-footer,
    body:has(.fnc-intake-fullscreen-bg) #base-footer {
        display: flex !important;
        visibility: visible !important;
        margin-top: 0.5rem !important;
        padding: 0.4rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px)) !important;
        border-top: 1px solid #e1e8ed !important;
        background: #f8f9fa !important;
    }

    body:has(#fnc-landing-wrapper) #base-footer nav.footer-menu ul,
    body:has(.fnc-intake-fullscreen-bg) #base-footer nav.footer-menu ul {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.15rem 0.55rem !important;
    }

    body:has(#fnc-landing-wrapper) #base-footer nav.footer-menu ul a,
    body:has(.fnc-intake-fullscreen-bg) #base-footer nav.footer-menu ul a {
        width: auto !important;
        padding: 0.25rem 0.4rem !important;
        font-size: clamp(0.68rem, 2.8vw, 0.78rem) !important;
    }

    body:has(#fnc-landing-wrapper) #base-footer .copyright,
    body:has(.fnc-intake-fullscreen-bg) #base-footer .copyright {
        white-space: normal !important;
        text-align: center !important;
    }

    body:has(#fnc-landing-wrapper) #base-footer .icon-logo,
    body:has(.fnc-intake-fullscreen-bg) #base-footer .icon-logo {
        display: none !important;
    }

    #fnc-landing-wrapper,
    .fnc-intake-fullscreen-bg,
    .fnc-smart-intake-wrapper {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow: visible !important;
        justify-content: flex-start;
        padding-bottom: 1rem;
    }
}

/* Página standalone (wizard legacy / sin encapsulado) */
html.fnc-lp-standalone,
html.fnc-lp-standalone body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden !important;
    font-family: 'Montserrat', sans-serif;
    background-color: #FFFFFF;
    color: #1A1A1A;
}

@media (max-width: 900px), (max-height: 720px) {
    html.fnc-lp-standalone,
    html.fnc-lp-standalone body {
        height: auto !important;
        max-height: none !important;
        min-height: 100dvh;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* CONTENEDOR PRINCIPAL ABSOLUTO */
.landing-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 20px;
}

/* PREVENCIÓN DE DOBLE LOGOTIPO EN FENNECORE */
#global-header {
    position: absolute;
    top: 30px;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}
#global-header img.main-logo {
    display: block !important;
    max-height: 45px;
}
/* Fennecore a veces inyecta logos en componentes, los matamos aquí: */
.view-section img[src*="logo"] {
    display: none !important; 
}

/* TRANSICIÓN DE VISTAS */
.view-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 900px;
    text-align: center;
    animation: fadeIn 0.4s ease-in-out;
}
.view-section.hidden {
    display: none !important;
}

/* VISTA 1: HERO */
.hero-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: #008C99;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}
.hero-text {
    font-size: 1.15rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 750px;
}

/* BOTONES GLOBALES */
.btn-primary, .btn-secondary {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
}
.btn-primary {
    background-color: #008C99;
    color: #FFF;
    border: none;
    margin-top: 20px;
}
.btn-primary:hover {
    background-color: #006C7A;
    color: #fff;
}
.btn-secondary {
    background-color: transparent;
    color: #555;
    border: 2px solid #CCC;
}
.btn-secondary:hover {
    border-color: #008C99;
    color: #008C99;
}
/* Estilos para el botón de idioma, movidos desde el HTML */
#lang-toggle {
    padding: 8px 15px;
    font-size: 0.9rem;
    align-self: flex-start; /* Asegura alineación correcta en el header flex */
}

/* VISTA 2: BOTONERA (GRID DE SERVICIOS) */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
    width: 100%;
}
.service-btn {
    background-color: #F8F9FA;
    border: 1px solid #E0E0E0;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
}
.service-btn:hover {
    background-color: #008C99;
    color: #FFF;
    border-color: #008C99;
}

/* VISTA 3: FORMULARIO Y FIX DE LABELS (BLOQUEO FENNECORE) */
#service-details {
    width: 100%;
    max-width: 1200px;
    background: transparent;
}
#service-details h2 { color: #008C99; font-size: 1.8rem; margin-top: 0; }
#service-details p { color: #666; font-size: 1rem; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; width: 100%; }

/*
 * REFACTORIZACIÓN DE LABELS (CONFLICTO CON FENNECORE)
 * Fennecore oculta los labels por defecto. Usamos un selector de alta especificidad
 * para restaurar su visibilidad de forma limpia, minimizando el uso de `!important`.
*/
/* En Fennecore, los labels pueden venir ocultos por CSS global.
   Forzamos visibilidad en TODOS los labels del formulario de esta landing. */
#service-details .form-group label,
.landing-wrapper .form-group label,
.nms-form-group label {
    display: block !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    visibility: visible;
    opacity: 1;
    text-align: left;
    font-weight: 700;
    margin-bottom: 2px !important;
    font-size: 0.9rem !important;
    color: #1A1A1A;
}

/* Guard-rail: si alguna regla global intenta sacar estos labels del flujo */
#t-lbl-name,
#t-lbl-email,
#t-lbl-niche {
    display: block !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}
.form-group input { width: 100%; padding: 12px 15px; border: 1px solid #CCC; border-radius: 4px; box-sizing: border-box; font-size: 1rem; }
.btn-group { display: flex; justify-content: space-between; margin-top: 30px; }

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

/* COMPACTACIÓN DEL FOOTER GLOBAL DE FENNECORE (landing) */
body:has(#fnc-landing-wrapper) #base-footer,
body:has(.fnc-intake-fullscreen-bg) #base-footer {
    padding: 6px 12px !important;
    margin-top: 0 !important;
    min-height: auto !important;
    height: auto !important;
    line-height: 1.25 !important;
    font-size: 0.72rem !important;
}

body:has(#fnc-landing-wrapper) #base-footer .copyright,
body:has(.fnc-intake-fullscreen-bg) #base-footer .copyright {
    margin: 0 !important;
    white-space: normal !important;
    text-align: center !important;
}

/* Si Fennecore agrega padding al contenedor principal, lo matamos aquí */
#base-wrapper, #base-content {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* ==========================================================================
   SCORCHED EARTH: REMOVE ORANGE DOTS & ANIMATIONS FROM VIDEO BUTTONS
   ========================================================================== */

/* 1. Ensure the play icon itself is completely static */
.fnc-play-icon, 
.fnc-btn-executive .fa-play,
[class*="btn-video"] i,
[class*="video-btn"] i {
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

/* Button centered adjustments */
.fnc-btn-executive {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* SMART INTAKE WIZARD - PHASE 1 */
.fnc-intake-fullscreen-bg {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    box-sizing: border-box;
}

.fnc-smart-intake-wrapper {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.fnc-intake-fullscreen-bg .fnc-question-card {
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

@media (max-height: 800px) {
    .fnc-intake-fullscreen-bg .fnc-question-card { padding: 20px; }
    .fnc-intake-fullscreen-bg .fnc-question-card h3 { font-size: 1.15rem; margin-bottom: 12px; }
    .fnc-intake-fullscreen-bg .fnc-options-grid { margin-top: 12px; gap: 8px; }
    .fnc-intake-fullscreen-bg .fnc-option-btn { padding: 10px 14px; font-size: 0.9rem; }
    .fnc-intake-fullscreen-bg .fnc-progress-bar-container { margin-bottom: 16px; }
}
.fnc-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2-column layout for options */
    gap: 15px;
    margin-top: 30px;
}
.fnc-option-btn {
    padding: 15px 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    background: transparent;
    color: inherit;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-weight: 600;
}
.fnc-option-btn:hover {
    border-color: #008C99;
    background: #008C99;
    color: #fff;
}
.fnc-progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}
.fnc-progress-fill {
    height: 100%;
    background: #008C99;
    transition: width 0.3s ease;
}
.fnc-question-card h3 {
    font-size: 1.8rem;
    color: #1A1A1A;
    margin-bottom: 10px;
    text-align: center;
}

/* Hover oscuro del tema base → texto claro en landing */
#fnc-landing-wrapper button.fnc-funnel-option:hover,
#fnc-landing-wrapper button.fnc-funnel-submit:hover,
#fnc-landing-wrapper button.fnc-ctn-option:hover,
#fnc-landing-wrapper button.fnc-btn-executive:hover,
#fnc-landing-wrapper button#btn-submit:hover {
    color: #fff !important;
}
