/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap');

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin:0;
    padding:0;
    font-family: 'Inter', sans-serif;
    background: white;
    height:100vh;
    display:flex;
    justify-content:center;
    align-items:flex-start;
    padding-top: 3rem;
    background-image: url('/fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;  /* La imagen permanece fija al hacer scroll */
    min-height: 100vh;
}

.cuerpo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== FORMULARIO PRINCIPAL ===== */
form {
    background:white;
    color: #03355b;
    padding:40px;
    width:400px;
    border-radius:7px;
    box-shadow:0 10px 30px rgba(0,0,0,0.2);
    text-align:center;
    align-items:center;
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#logo_principal {
    display: block;
    margin: 0 auto 25px auto;
    width: 150px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
    animation: logoPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes logoPop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

#titulo_principal {
    text-align: center;
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: #ebebeb;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
}

#subtitulos {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: #013f51;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
}

form p {
    text-align: center;
    color: #0c4571;
    margin-bottom: 25px;
    font-size: 1rem;
    font-weight: 400;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-acceso {
    display: inline-block;
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-acceso:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-acceso:active {
    transform: translateY(0);
}



/* ===== MODO OSCURO ===== */
@media (prefers-color-scheme: dark) {
    body {
        background-image: url('/fondoB.jpg');
    }
    
    form {
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    #titulo_principal{
        background: linear-gradient(135deg, #ffffff, #e0e7ff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        }

        #subtitulos {
        background: linear-gradient(135deg, #ffffff, #e0e7ff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        }

    form p {
        color: #49a1fa;
        }

    label {
        color: #49a1fa;
        }
        
     #logo_principal {
        content: url('/logoB.png'); /* Tu logo para modo oscuro */
    }
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 480px) {
    form {
        padding: 30px 20px;
    }
    
    #titulo1 {
        font-size: 1.8rem;
    }
    
    .toast-container {
        top: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
    
    .toast {
        max-width: none;
    }
    
    #logo1 {
        width: 100px;
    }
}


/* Título */
#titulo2 {
    margin-bottom: 25px;
    color: #333;
}

/* Contenedor input + icono */
.input-container {
    position: relative;
}

.input-container i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
}

/* Botón */
button {
    width: 100%;
    padding: 12px;
    background: #49a1fa;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    background: #3d8cdc;
}

/* Mensaje error */
#mensaje-error {
    color: red;
    font-size: 14px;
    margin-bottom: 10px;
}

input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 12px 40px 12px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 16px;
    transition: 0.3s;
    background: white;
    color: #333;
}

input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 5px rgba(42,82,152,0.3);
}