@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800&display=swap');

:root {
    /* Colores Modo Oscuro (Predeterminado) */
    --background-color: #121212; /* Fondo muy oscuro */
    --container-color: #1f1f1f; /* Contenedor oscuro */
    --primary-color: #5c67f2; /* Azul vibrante (como acento principal) */
    --secondary-color: #6a0dad; /* Púrpura/Violeta para detalles */
    --text-color: #e0e0e0; /* Texto claro */
    --input-bg-color: #2c2c2c; /* Fondo de inputs */
    --border-color: #383838; /* Borde sutil */
    --glow-color: rgba(92, 103, 242, 0.4); /* Sombra de brillo azul */
    --footer-bg-color: #0d0d0d;
    --error-color: #ff4d4d; /* Rojo para errores */
}

body.light-mode {
    /* Colores Modo Claro (Opcional) */
    --background-color: #f0f2f5;
    --container-color: #ffffff;
    --primary-color: #5c67f2;
    --secondary-color: #a45ee5;
    --text-color: #333333;
    --input-bg-color: #f7f7f7;
    --border-color: #dddddd;
    --glow-color: rgba(92, 103, 242, 0.2);
    --footer-bg-color: #e9ebee;
    --error-color: #cc0000;
}

/* Base y Animación */
html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.5s ease-in-out, color 0.5s ease-in-out;
    opacity: 0;
    animation: fadeInPage 1s 0.5s ease-in-out forwards;
}

@keyframes fadeInPage { to { opacity: 1; } }

main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 15px;
}

/* Contenedor Principal */
.container {
    background-color: var(--container-color);
    border: 1px solid var(--border-color);
    padding: 3em 3.5em;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 900px;
    margin-top: 2em;
    margin-bottom: 2em;
    transition: background-color 0.5s, box-shadow 0.5s, border-color 0.5s;
    position: relative;
    overflow: hidden;
}

/* Header (Logo y Título) */
.header { 
    text-align: center; 
    margin-bottom: 3em; 
}
.header img {
    max-width: 200px;
    margin-bottom: 1em;
    filter: drop-shadow(0 0 10px var(--glow-color));
    transition: transform 0.4s ease-in-out, filter 0.4s;
}
.header img:hover { 
    transform: scale(1.05) rotate(-1deg); 
    filter: drop-shadow(0 0 15px var(--primary-color));
}
.header h1 { 
    margin: 0; 
    font-size: 2.8em; 
    font-weight: 800; 
    color: var(--primary-color); 
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

/* Sección de Requisitos (Estilo de tarjeta) - CORREGIDO */
.requirements { 
    background-color: var(--input-bg-color); 
    padding: 2em; 
    border-radius: 10px; 
    margin-bottom: 2.5em; 
    border-left: 5px solid var(--secondary-color); 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.requirements h2 { 
    margin-top: 0; 
    font-size: 1.8em; 
    font-weight: 700; 
    color: var(--primary-color); 
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5em;
    margin-bottom: 1em;
}
.requirements h3 { 
    margin-top: 1.5em; 
    margin-bottom: 0.8em; 
    font-size: 1.2em; 
    color: var(--secondary-color);
    font-weight: 600;
}
.requirements ul { 
    list-style-type: none; 
    padding-left: 0; 
    display: block;
    margin-top: 0.5em;
    column-count: 2; /* Divide la lista en 2 columnas */
    column-gap: 30px;
}
@media (max-width: 768px) {
    .requirements ul {
        column-count: 1; /* En móviles, vuelve a una columna */
    }
}
.requirements li { 
    margin-bottom: 1em; 
    color: var(--text-color); 
    position: relative;
    padding-left: 30px; 
    font-weight: 400;
    line-height: 1.4;
    break-inside: avoid; /* Evita que los ítems se corten al cambiar de columna */
}
.requirements li::before {
    content: '★'; 
    color: var(--primary-color);
    font-size: 1.2em; 
    position: absolute;
    left: 0;
    top: 0;
    line-height: 1.4;
}

/* Formulario */
.form-group { 
    margin-bottom: 2em; 
    position: relative;
}
.form-group label { 
    display: block; 
    margin-bottom: 0.5em; 
    font-weight: 600; 
    color: var(--text-color);
    font-size: 1.1em;
}
.form-group small { 
    display: block; 
    font-size: 0.85em; 
    color: #a0a0a0; 
    margin-top: 0.3em; 
    transition: color 0.5s;
}
.form-group input[type="text"], 
.form-group input[type="number"], 
.form-group textarea { 
    width: 100%; 
    padding: 1em 1.2em; 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    background-color: var(--input-bg-color); 
    color: var(--text-color); 
    font-size: 1em; 
    box-sizing: border-box; 
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.form-group input:focus, 
.form-group textarea:focus { 
    outline: none; 
    border-color: var(--primary-color); 
    box-shadow: 0 0 10px var(--glow-color);
}
textarea { 
    resize: vertical; 
    min-height: 150px; 
}
.required-star { 
    color: var(--error-color); 
    margin-left: 4px;
    font-size: 1.2em;
}

/* Estilos de Autenticación de Google - MEJORADO */
.google-btn {
    width: 100%;
    padding: 1.1em; 
    border: none;
    border-radius: 8px; /* Bordes más suaves */
    background-color: #4285F4; /* Color de Google */
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8em; 
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); 
}
.google-btn i {
    margin-right: 12px; 
    font-size: 1.3em; 
}
.google-btn:hover:not(:disabled) {
    background-color: #357ae8; 
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); 
    transform: translateY(-2px); 
}
.google-btn:active:not(:disabled) {
    transform: translateY(0); 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); 
}
.google-btn:disabled {
    background-color: #a0a0a0; 
    color: #e0e0e0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

/* Estilo específico para el botón de Cerrar Sesión */
.signout-btn {
    background-color: #CC2222; /* Rojo vibrante */
}
.signout-btn:hover:not(:disabled) {
    background-color: #A31B1B; /* Rojo más oscuro al pasar el ratón */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); 
}

.auth-status-text {
    text-align: center;
    font-size: 0.98em;
    font-weight: 500;
    color: var(--primary-color);
    margin-top: 0.5em; 
    margin-bottom: 2em;
    padding: 0 1em;
    line-height: 1.5;
}

/* Radio Buttons */
.radio-group label { 
    display: inline-block; 
    margin-right: 25px; 
    cursor: pointer; 
    color: var(--text-color);
    position: relative;
    padding-left: 25px;
    line-height: 20px;
}
.radio-group input[type="radio"] { 
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.radio-group label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    background-color: var(--input-bg-color);
    transition: all 0.2s;
}
.radio-group input[type="radio"]:checked + label::before {
    background-color: var(--primary-color);
    box-shadow: 0 0 5px var(--glow-color);
    border-color: var(--primary-color);
}
.radio-group input[type="radio"]:checked + label::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 10px;
    height: 10px;
    background: var(--input-bg-color); 
    border-radius: 50%;
}
.radio-group input[type="radio"]:checked + label {
    font-weight: 600;
    color: var(--primary-color);
}

/* Botón de Enviar */
.submit-btn { 
    width: 100%; 
    padding: 1.2em; 
    border: none; 
    border-radius: 8px; 
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white; 
    font-size: 1.3em; 
    font-weight: 700; 
    cursor: pointer; 
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s; 
    letter-spacing: 1px;
    box-shadow: 0 4px 15px var(--glow-color);
    margin-bottom: 2em; 
}
.submit-btn:hover:not(:disabled) { 
    transform: translateY(-3px); 
    box-shadow: 0 8px 25px rgba(92, 103, 242, 0.6);
    opacity: 0.95;
}
.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--input-bg-color);
    color: var(--text-color);
    box-shadow: none;
}

#success-message { 
    display: none; 
    text-align: center; 
    padding: 2em; 
    margin-top: 2em; 
    border-radius: 10px; 
    background-color: #43b581; 
    color: white;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(67, 181, 129, 0.7);
    animation: successPop 0.5s ease-out forwards;
}
@keyframes successPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
#success-message h2 { margin-top: 0; }

/* ESTILOS PARA EL WIDGET DE DISCORD */
#discord-widget {
    margin-top: 3em;
    padding-top: 1.5em;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.widget-title {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1em;
}
.widget-title i {
    margin-right: 10px;
}
#discord-widget iframe {
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.3s;
}
#discord-widget iframe:hover {
    box-shadow: 0 5px 30px var(--glow-color);
}
.widget-note {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-top: 1em;
}
/* FIN ESTILOS WIDGET DE DISCORD */

/* Footer */
footer { 
    background-color: var(--footer-bg-color); 
    color: var(--text-color); 
    padding: 50px 20px 20px 20px; 
    border-top: 1px solid var(--border-color); 
    width: 100%; 
    box-sizing: border-box; 
    transition: background-color 0.5s, border-top-color 0.5s;
}
.footer-content { 
    max-width: 1100px; 
    margin: 0 auto; 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    gap: 3em; 
}
.footer-section { 
    flex: 1; 
    min-width: 200px; 
}
.footer-logo img { 
    max-width: 100px; 
    margin-bottom: 1em; 
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}
.footer-section p { 
    font-size: 0.9em; 
    line-height: 1.8; 
    color: #b0b0b0; 
}
.footer-section h3 { 
    color: var(--primary-color); 
    font-size: 1.3em; 
    margin-bottom: 1.5em; 
    font-weight: 700; 
}
.footer-section ul { 
    list-style: none; 
    padding: 0; 
}
.footer-section ul li { 
    margin-bottom: 0.7em; 
}
.footer-section ul li a { 
    color: var(--text-color); 
    text-decoration: none; 
    font-size: 0.95em;
    opacity: 0.8;
    transition: color 0.3s, opacity 0.3s; 
}
.footer-section ul li a:hover { 
    color: var(--primary-color); 
    opacity: 1;
}

/* Botón de Discord */
.discord-button { 
    display: inline-flex; 
    align-items: center; 
    background-color: #5865F2; 
    color: white; 
    padding: 1em 2em; 
    border-radius: 8px; 
    text-decoration: none; 
    font-weight: 600; 
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
}
.discord-button i { 
    margin-right: 0.8em; 
    font-size: 1.4em; 
}
.discord-button:hover { 
    background-color: #4752c4; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.6);
}

.footer-bottom { 
    text-align: center; 
    margin-top: 50px; 
    padding-top: 20px; 
    border-top: 1px solid var(--border-color); 
    font-size: 0.8em; 
    color: #888; 
}
.footer-bottom i { 
    color: var(--error-color); 
    margin: 0 5px; 
}

/* Toggle del Tema */
#theme-toggle { 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    background-color: var(--primary-color); 
    color: white; 
    border: 3px solid var(--secondary-color); 
    border-radius: 50%; 
    width: 60px; 
    height: 60px; 
    font-size: 1.8em; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); 
    transition: background-color 0.3s, transform 0.3s, border-color 0.3s; 
    z-index: 1000; 
}
#theme-toggle:hover { 
    background-color: var(--secondary-color); 
    border-color: var(--primary-color);
    transform: scale(1.1) rotate(5deg); 
}

/* --- FIX PARA EVITAR EL PARPADEO (FOUC) --- */
/* Oculta el contenido del formulario si el cuerpo aún no ha sido manejado por JS */
body.auth-pending #form-content-wrapper {
    display: none !important;
}

/* Oculta el botón de cerrar sesión por defecto */
body.auth-pending #google-signout-btn {
    display: none !important;
}

/* Muestra el botón de iniciar sesión por defecto */
body.auth-pending #google-auth-btn {
    display: block !important;
}
/* --- FIN FIX FOUC --- */

/* Media Queries (Responsive) */
@media (max-width: 950px) {
    .container {
        max-width: 95%;
        padding: 2em;
    }
}

@media (max-width: 768px) { 
    .footer-content { 
        flex-direction: column; 
        text-align: center; 
        align-items: center; 
        gap: 2em;
    } 
    .footer-section { 
        width: 100%; 
        min-width: unset; 
    } 
    .discord-button { 
        margin-top: 0.5em; 
    } 
    main { 
        padding: 15px; 
    } 
    .header h1 {
        font-size: 2em;
    }
    .container {
        padding: 1.5em;
    }
    #theme-toggle {
        width: 45px;
        height: 45px;
        font-size: 1.4em;
    }
}