/**
 * ESTILOS DEL LOGIN
 * Fundación INGENIUS - Sistema de Gestión de Pasantes
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 50%, #16a085 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Animación de fondo */
.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(circle, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.1) 2px, transparent 2px);
    background-size: 80px 80px;
    background-position: 0 0, 40px 40px;
    animation: moveBackground 20s linear infinite;
    z-index: 0;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(80px, 80px); }
}

/* Círculos decorativos flotantes */
.login-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(20px); }
}

/* Caja de login */
.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(46, 204, 113, 0.2);
    width: 100%;
    max-width: 450px;
    padding: 50px 40px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo y header */
.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 50%;
    padding: 15px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.3);
    animation: rotateLogo 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.logo-container img:hover {
    transform: scale(1.1);
}

@keyframes rotateLogo {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(5deg); }
}

.logo-container h1 {
    font-size: 26px;
    color: #2c3e50;
    margin: 15px 0 5px 0;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-container p {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

/* Formulario */
.login-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s;
}

.form-group label i {
    margin-right: 8px;
    color: #2ecc71;
    width: 18px;
    display: inline-block;
    text-align: center;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #2c3e50;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #2ecc71;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.1);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #bdc3c7;
}

/* Toggle password */
.toggle-password {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #95a5a6;
    font-size: 18px;
    transition: color 0.3s;
    z-index: 2;
    padding: 5px;
    margin-top: 12px;
}

.toggle-password:hover {
    color: #2ecc71;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #7f8c8d;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2ecc71;
}

.checkbox-label:hover {
    color: #2c3e50;
}

/* Botón de login */
.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
}

.btn-login:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-login:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-login i {
    margin-right: 8px;
}

/* Mensajes */
.mensaje {
    padding: 15px 18px;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

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

.mensaje.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.mensaje.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Footer del login */
.login-footer {
    margin-top: 35px;
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid #ecf0f1;
}

.login-footer p {
    color: #95a5a6;
    font-size: 12px;
    margin: 0;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 576px) {
    .login-box {
        padding: 40px 25px;
        max-width: 100%;
        border-radius: 15px;
    }

    .logo-container img {
        width: 80px;
        height: 80px;
    }

    .logo-container h1 {
        font-size: 22px;
    }

    .logo-container p {
        font-size: 13px;
    }

    .form-group input[type="text"],
    .form-group input[type="password"] {
        padding: 13px 16px;
        font-size: 14px;
    }

    .btn-login {
        padding: 14px;
        font-size: 15px;
    }
}

/* Estados de loading */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-login.loading i {
    animation: spin 1s linear infinite;
}

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

/* Efecto de brillo en inputs */
.form-group input[type="text"]:focus + label,
.form-group input[type="password"]:focus + label {
    color: #2ecc71;
}

/* Transiciones suaves */
* {
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}

/* Selección de texto personalizada */
::selection {
    background: #2ecc71;
    color: white;
}

::-moz-selection {
    background: #2ecc71;
    color: white;
}

/* Estilos para autofill de navegadores */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #f8f9fa inset !important;
    -webkit-text-fill-color: #2c3e50 !important;
}

/* Modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .login-box {
        background: rgba(44, 62, 80, 0.95);
    }

    .logo-container h1 {
        color: #ecf0f1;
    }

    .logo-container p {
        color: #bdc3c7;
    }

    .form-group label {
        color: #ecf0f1;
    }

    .form-group input[type="text"],
    .form-group input[type="password"] {
        background: #34495e;
        color: #ecf0f1;
        border-color: #34495e;
    }

    .form-group input[type="text"]:focus,
    .form-group input[type="password"]:focus {
        background: #2c3e50;
    }

    .checkbox-label {
        color: #bdc3c7;
    }

    .login-footer p {
        color: #7f8c8d;
    }
}