* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #1e3a8a, #22d3ee);
    overflow-x: hidden;
    color: white !important;
    min-height: 100vh;
}

#root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.splash-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle, #0d0d0d, #1a1a1a);
    overflow: hidden;
}

.splash-logo {
    width: 15vw;
    max-width: 100px;
    will-change: transform, opacity;
    animation: scaleFullScreen 3s ease-out forwards;
    transform: translateZ(0);
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

@keyframes scaleFullScreen {
    0% { transform: scale(0.2); opacity: 0; }
    70% { transform: scale(5); opacity: 1; }
    100% { transform: scale(5); opacity: 0; }
}

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    padding: 1rem;
    z-index: 2;
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.star-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: block !important;
    visibility: visible !important;
}

/* Contenedor para logo y elementos laterales - MEJORADO */
.logo-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 180px;
    margin: 0 auto 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4;
}

.luna-background {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-150%, -50%);
    width: 140px;
    height: 140px;
    z-index: 3;
    opacity: 1;
    object-fit: contain;
}

.auth-logo {
    width: 280px;
    max-width: 380px;
    z-index: 5;
    filter: drop-shadow(0 0 10px rgba(74, 154, 143, 0.7));
    will-change: transform;
    animation: heartbeat 2s infinite ease-in-out;
    animation-delay: 2s;
    transform: translateZ(0);
    backface-visibility: hidden;
    transform-style: preserve-3d;
    position: relative;
}

.jessica-background {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(50%, -50%);
    width: 120px;
    height: 180px;
    z-index: 3;
    opacity: 0.8;
    object-fit: contain;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.05); }
    50% { transform: scale(1); }
    75% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.slogan {
    font-size: 1.2rem;
    font-weight: bold;
    color: white !important;
    text-shadow: 0 0 10px rgba(74, 154, 143, 0.7);
    margin: 1rem 0 2rem;
    text-align: center;
    z-index: 5;
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    transform-style: preserve-3d;
    padding: 0 1rem;
    line-height: 1.4;
}

.slogan-word {
    display: inline-block;
    animation: zoomIn 1s ease-out forwards;
    animation-fill-mode: forwards;
    color: white !important;
}

.slogan-word:nth-child(1) { animation-delay: 0.2s; }
.slogan-word:nth-child(2) { animation-delay: 0.4s; }
.slogan-word:nth-child(3) { animation-delay: 0.6s; }
.slogan-word:nth-child(4) { animation-delay: 0.8s; }
.slogan-word:nth-child(5) { animation-delay: 1.0s; }
.slogan-word:nth-child(6) { animation-delay: 1.2s; }
.slogan-word:nth-child(7) { animation-delay: 1.4s; }
.slogan-word:nth-child(8) { animation-delay: 1.6s; }

@keyframes zoomIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.auth-message {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(74, 154, 143, 0.7);
    z-index: 5;
    color: white !important;
    text-align: center;
}

.auth-input-container {
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    margin-bottom: 1rem;
}

.auth-input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 2px solid #4ecdc4;
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    font-size: 1rem;
    z-index: 5;
    transition: border-color 0.3s, background-color 0.3s;
}

.auth-input:focus {
    outline: none;
    border-color: #ee2222;
    background: rgba(255, 255, 255, 0.15);
}

.auth-input.input-error {
    border-color: #4dff91 !important;
    background-color: rgba(255, 77, 77, 0.1) !important;
}

.auth-button {
    width: 100%;
    max-width: 350px;
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    background: #4ecdc4;
    color: white !important;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    margin-bottom: 0.5rem;
}

.auth-button:hover:not(:disabled) {
    background: #45b7a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.password-container {
    position: relative;
    width: 100%;
    max-width: 350px;
    margin-bottom: 1rem;
    z-index: 5;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #4ecdc4;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 6;
    padding: 5px;
}

.toggle-password:hover {
    color: #45b7a0;
}

.error-message {
    color: #f00f0f !important;
    background: rgba(255, 77, 77, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
    z-index: 5;
    width: 100%;
    max-width: 350px;
}

.success-message {
    color: #4CAF50 !important;
    background: rgba(76, 175, 80, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
    z-index: 5;
    width: 100%;
    max-width: 350px;
}

.admin-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 2rem;
    border-radius: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    width: 350px;
    border: 1px solid #4ecdc4;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.auth-toggle {
    color: white !important;
    margin-top: 1rem;
    text-align: center;
    cursor: pointer;
    text-decoration: underline;
    z-index: 5;
    font-size: 0.9rem;
}

.auth-toggle:hover {
    color: #f0f0f0 !important;
}

/* Media Queries para Responsividad - MEJORADAS */
@media (max-width: 1200px) {
    .logo-container {
        max-width: 800px;
        height: 160px;
    }
    
    .luna-background {
        width: 130px;
        height: 130px;
        transform: translate(-140%, -50%);
    }
    
    .auth-logo {
        width: 250px;
    }
    
    .jessica-background {
        width: 110px;
        height: 160px;
        transform: translate(40%, -50%);
    }
}

@media (max-width: 1024px) {
    .logo-container {
        max-width: 700px;
        height: 140px;
    }
    
    .luna-background {
        width: 110px;
        height: 110px;
        transform: translate(-130%, -50%);
    }
    
    .auth-logo {
        width: 220px;
    }
    
    .jessica-background {
        width: 90px;
        height: 140px;
        transform: translate(30%, -50%);
    }
    
    .slogan {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
        justify-content: flex-start;
        padding-top: 2vh;
    }

    .logo-container {
        height: 120px;
        max-width: 90%;
        margin: 1rem auto;
    }

    .luna-background {
        width: 90px;
        height: 90px;
        transform: translate(-120%, -50%);
    }
    
    .auth-logo {
        width: 180px;
    }
    
    .jessica-background {
        width: 70px;
        height: 110px;
        transform: translate(20%, -50%);
    }

    .slogan {
        font-size: 1rem;
        margin: 1rem 0;
        line-height: 1.3;
    }

    .auth-message {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }

    .auth-input-container {
        max-width: 300px;
    }

    .auth-input {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .auth-button {
        font-size: 0.9rem;
        padding: 0.6rem;
        max-width: 300px;
    }

    .auth-toggle {
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .logo-container {
        height: 100px;
    }

    .luna-background {
        width: 70px;
        height: 70px;
        transform: translate(-110%, -50%);
    }
    
    .auth-logo {
        width: 150px;
    }
    
    .jessica-background {
        width: 55px;
        height: 90px;
        transform: translate(10%, -50%);
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 0.5rem;
        padding-top: 1vh;
    }

    .logo-container {
        height: 90px;
        margin: 0.5rem auto 1rem;
    }

    .luna-background {
        width: 60px;
        height: 60px;
        transform: translate(-100%, -50%);
    }
    
    .auth-logo {
        width: 130px;
    }
    
    .jessica-background {
        width: 45px;
        height: 70px;
        transform: translate(0%, -50%);
    }

    .slogan {
        font-size: 0.85rem;
        margin: 0.8rem 0;
        padding: 0 0.5rem;
        line-height: 1.2;
    }

    .auth-message {
        font-size: 1.1rem;
        margin-bottom: 1.2rem;
    }

    .auth-input-container {
        max-width: 280px;
    }

    .auth-input {
        font-size: 0.8rem;
        padding: 0.5rem;
        margin-bottom: 0.8rem;
    }

    .auth-button {
        font-size: 0.8rem;
        padding: 0.5rem;
        max-width: 280px;
        margin-bottom: 0.4rem;
    }

    .toggle-password {
        font-size: 0.7rem;
        right: 8px;
    }

    .error-message, .success-message {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        max-width: 280px;
    }

    .auth-toggle {
        font-size: 0.75rem;
        margin-top: 0.8rem;
    }

    .admin-modal {
        padding: 1.2rem;
        width: 300px;
    }
}

@media (max-width: 360px) {
    .logo-container {
        height: 80px;
    }

    .luna-background {
        width: 50px;
        height: 50px;
        transform: translate(-90%, -50%);
    }
    
    .auth-logo {
        width: 110px;
    }
    
    .jessica-background {
        width: 40px;
        height: 60px;
        transform: translate(-5%, -50%);
    }

    .slogan {
        font-size: 0.8rem;
    }

    .auth-input-container {
        max-width: 260px;
    }
}

/* Asegurar que los elementos estén siempre visibles y en el orden correcto */
.auth-container > * {
    position: relative;
    z-index: 5;
}

/* Mejorar la legibilidad del texto */
.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Estilos para el botón de WhatsApp en móviles */
@media (max-width: 768px) {
    .whatsapp-button {
        bottom: 15px;
        right: 15px;
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Forzar consistencia en todos los navegadores */
.logo-container * {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* Prevenir flashes de estilos no cargados */
body.loading * {
    visibility: hidden;
}

/* Estilos específicos para Firebase Hosting para prevenir inconsistencias */
html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

/* Clearfix para contenedores */
.logo-container::after {
    content: "";
    display: table;
    clear: both;
}