/**
 * SISTEMA INTEGRAL TAROT FRACTAL
 * Módulo Base: Tokens cromáticos, layout global, modales y autenticación
 * tarot-fractal.es
 */

/* =============================================================================
   1. TOKENS CROMÁTICOS OFICIALES (ANDROID COMPOSE)
   ============================================================================= */
:root {
    --color-fondo-oscuro: #071B36;
    --color-azul-maestro: #0B2D5C;
    --color-fondo-base: #040F1E;
    --color-dorado: #F1C40F;
    --color-dorado-suave: #F39C12;
    --color-amarillo-vivo: #FFEB3B;
    --color-tarjeta: rgba(9, 33, 68, 0.90);
    --color-tarjeta-seleccionada: rgba(19, 56, 110, 0.95);
    --color-tarjeta-borde: rgba(241, 196, 15, 0.35);
    --fuente-principal: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* =============================================================================
   2. RESET Y ESTRUCTURA GLOBAL
   ============================================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--color-fondo-oscuro);
    font-family: var(--fuente-principal);
    color: #FFFFFF;
    overflow-x: hidden;
}

/* LIENZO CÓSMICO (CANVAS GPU FIJO DE FONDO) */
#canvasCosmos {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    display: block;
    pointer-events: none;
}

/* CHASIS PRINCIPAL: FLUIDO Y PANORÁMICO EN PC, NATIVO EN MÓVIL */
#appContainer {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
}

#viewport {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 16px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    #viewport {
        padding: 28px 48px;
    }
}

/* ACCESIBILIDAD Y SEO SILENCIOSO */
.seo-crawler-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* =============================================================================
   3. PORTADA SPLASH CINEMÁTICA (3 SEGUNDOS)
   ============================================================================= */
#pantallaSplash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #0B2D5C 0%, #071B36 70%, #040F1E 100%);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
    cursor: pointer;
}

#pantallaSplash.oculto {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo-box {
    text-align: center;
    animation: respiracionLogo 2.5s ease-in-out infinite alternate;
}

.splash-icono {
    font-size: 72px;
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 0 20px rgba(241, 196, 15, 0.6));
}

.splash-subtitulo {
    color: var(--color-dorado);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.splash-titulo {
    color: #FFFFFF;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.8);
}

@keyframes respiracionLogo {
    0% { transform: scale(0.96); opacity: 0.85; }
    100% { transform: scale(1.04); opacity: 1; }
}

/* =============================================================================
   4. MODAL DETECCIÓN DE ANDROID
   ============================================================================= */
#modalAndroid {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1200;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-caja {
    background: linear-gradient(180deg, #092144 0%, #071B36 100%);
    border: 1.5px solid var(--color-dorado);
    border-radius: 16px;
    padding: 24px 20px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(241, 196, 15, 0.25);
}

.modal-icono {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px auto;
    display: block;
}

.modal-titulo {
    color: var(--color-dorado);
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-texto {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 19px;
    margin-bottom: 22px;
}

.btn-modal {
    display: block;
    width: 100%;
    padding: 13px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 10px;
    text-align: center;
    border: none;
    box-sizing: border-box;
    transition: transform 0.15s ease, background 0.2s ease;
}

.btn-modal:active {
    transform: scale(0.98);
}

.btn-modal-primario {
    background: var(--color-dorado-suave);
    color: #000000;
}

.btn-modal-primario:hover {
    background: var(--color-dorado);
}

.btn-modal-secundario {
    background: rgba(19, 56, 110, 0.9);
    color: var(--color-dorado);
    border: 1px solid var(--color-dorado);
}

.btn-modal-texto {
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    margin-bottom: 0;
    padding: 8px;
}

.btn-modal-texto:hover {
    color: #FFFFFF;
}

/* =============================================================================
   5. BANNER RGPD / COOKIES
   ============================================================================= */
#bannerCookies {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: rgba(7, 27, 54, 0.96);
    border-top: 1.5px solid var(--color-dorado);
    padding: 16px 24px;
    z-index: 1000;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.8);
}

.cookies-interior {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .cookies-interior {
        flex-direction: row;
    }
}

.cookies-texto {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 18px;
    text-align: left;
}

.cookies-texto a {
    color: var(--color-dorado);
    text-decoration: underline;
}

.cookies-botones {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .cookies-botones {
        width: auto;
    }
}

.btn-cookie {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    flex: 1;
    text-align: center;
}

.btn-cookie-aceptar {
    background: var(--color-dorado-suave);
    color: #000000;
}

.btn-cookie-rechazar {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* =============================================================================
   6. MODALES GLOBALES Y FORMULARIOS DE AUTENTICACIÓN
   ============================================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-auth-caja {
    background: linear-gradient(180deg, #092144 0%, #071B36 100%);
    border: 1.5px solid var(--color-dorado);
    border-radius: 16px;
    padding: 26px 22px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
}

.modal-auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(241, 196, 15, 0.3);
    padding-bottom: 10px;
}

.modal-auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    font-weight: 700;
    padding: 8px;
    cursor: pointer;
}

.modal-auth-tab.activo {
    color: var(--color-dorado);
    border-bottom: 2px solid var(--color-dorado);
}

.auth-form-grupo {
    margin-bottom: 14px;
    text-align: left;
}

.auth-form-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 5px;
    font-weight: 600;
}

.auth-form-input, .auth-form-select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    background: rgba(4, 15, 30, 0.8);
    border: 1px solid rgba(241, 196, 15, 0.4);
    color: #FFFFFF;
    font-size: 14px;
    box-sizing: border-box;
}

.auth-form-input:focus, .auth-form-select:focus {
    outline: none;
    border-color: var(--color-dorado);
}

/* CAMPO CONTRASEÑA CON VISOR INTERACTIVO (OJO) */
.password-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.password-wrapper .auth-form-input {
    padding-right: 44px;
}

.btn-toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: rgba(241, 196, 15, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.btn-toggle-pass:hover {
    color: var(--color-amarillo-vivo);
    background: rgba(241, 196, 15, 0.1);
}

.btn-toggle-pass svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* CAJA DE VERIFICACIÓN HUMANA / ANTI-BOTS */
.caja-captcha-humano {
    background: rgba(11, 45, 92, 0.65);
    border: 1px dashed var(--color-dorado);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
}

.captcha-pregunta {
    font-size: 12.5px;
    color: var(--color-amarillo-vivo);
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
}

/* CAMPO TRAMPA HONEYPOT (INVISIBLE) */
.campo-trampa-oculto {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

.auth-aviso-error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #E74C3C;
    color: #FF7675;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 14px;
    display: none;
}
