/* styles.css - Versión Verde Olivo */
:root {
    --olive-green: #4A5D23;      /* Verde olivo principal */
    --olive-dark: #2C3E1E;       /* Verde olivo oscuro */
    --olive-light: #6B8E4C;      /* Verde olivo claro */
    --olive-soft: #E8F0E0;        /* Verde olivo muy suave para fondos */
    --text-dark: #2C3E1E;
    --text-light: #6B7280;
    --white: #FFFFFF;
    --gray-bg: #F9FAFB;
    --border-color: #E5E7EB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, var(--olive-dark) 0%, var(--olive-green) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 850px;  /* Tamaño máximo reducido */
    margin: 0 auto;
}

/* Tarjeta principal */
.login-card {
    display: flex;
    background: var(--white);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    height: 500px;  /* Altura fija más compacta */
}

/* Panel Izquierdo - Formulario */
.login-panel {
    flex: 1;  /* Proporción ajustada */
    padding: 30px;
    background: var(--white);
    display: flex;
    flex-direction: column;
}

.institution-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--olive-soft);
}

.header-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.header-title h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--olive-dark);
    line-height: 1.3;
}

.header-title span {
    font-size: 0.75rem;
    color: var(--olive-green);
    font-weight: 500;
}

.welcome-text {
    margin-bottom: 20px;
}

.welcome-text h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--olive-dark);
    margin-bottom: 5px;
}

.welcome-text p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.input-field {
    position: relative;
    display: flex;
    align-items: center;
}

.input-field i {
    position: absolute;
    left: 15px;
    color: var(--olive-green);
    font-size: 1rem;
    z-index: 1;
}

.input-field input {
    width: 100%;
    padding: 12px 40px 12px 45px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.3s;
    background: var(--gray-bg);
}

.input-field input:focus {
    outline: none;
    border-color: var(--olive-green);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(74, 93, 35, 0.1);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--olive-green);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
}

.toggle-password:hover {
    color: var(--olive-dark);
}

/* Opciones del formulario */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    margin: 5px 0;
}

.remember {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    cursor: pointer;
}

.remember input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--olive-green);
}

.forgot {
    color: var(--olive-green);
    text-decoration: none;
    font-weight: 500;
}

.forgot:hover {
    color: var(--olive-dark);
    text-decoration: underline;
}

/* Botón de login */
.login-btn {
    position: relative;
    padding: 12px;
    background: var(--olive-green);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.login-btn:hover {
    background: var(--olive-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(74, 93, 35, 0.2);
}

.login-btn:active {
    transform: translateY(0);
}

.loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.login-btn.loading span {
    visibility: hidden;
}

.login-btn.loading .loader {
    display: block;
}

/* Información del sistema */
.system-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    color: var(--olive-green);
    font-size: 0.8rem;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
}

.system-info i {
    font-size: 0.9rem;
}

/* Copyright */
.copyright {
    margin-top: auto;
    text-align: center;
    color: var(--text-light);
    font-size: 0.7rem;
    line-height: 1.5;
}

.copyright a {
    color: var(--olive-green);
    text-decoration: none;
    font-weight: 500;
}

.copyright a:hover {
    text-decoration: underline;
}

/* Panel Derecho - Imagen */
.image-panel {
    flex: 0.8;  /* Panel más pequeño */
    background: linear-gradient(145deg, var(--olive-green) 0%, var(--olive-dark) 100%);
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-panel::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    top: -25%;
    left: -25%;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.image-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.institutional-logo {
    width: 300px;
    height: 300px;
    margin-bottom: 20px;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    transition: all 0.3s ease;
}

.institutional-logo:hover {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.image-text h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.image-text p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 25px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-size: 0.9rem;
    border-left: 4px solid var(--olive-green);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: #10B981;
}

.notification.error {
    border-left-color: #EF4444;
}

/* Responsive */
@media (max-width: 768px) {
    .login-card {
        flex-direction: column;
        height: auto;
        max-width: 400px;
    }
    
    .image-panel {
        padding: 30px;
        min-height: 200px;
    }
    
    .institutional-logo {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .login-panel {
        padding: 25px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .welcome-text h3 {
        font-size: 1.2rem;
    }
}

/* Campo de contraseña - Corrección */
.input-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-field i {
    position: absolute;
    left: 15px;
    color: var(--olive-green);
    font-size: 1rem;
    z-index: 2;  /* Asegura que el ícono esté sobre el input */
}

.input-field input {
    width: 100%;
    padding: 12px 45px 12px 45px;  /* Ajustado: derecho 45px para el ojo, izquierdo 45px para el ícono */
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.3s;
    background: var(--gray-bg);
}

.input-field input:focus {
    outline: none;
    border-color: var(--olive-green);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(74, 93, 35, 0.1);
}

.toggle-password {
    position: absolute;
    right: 12px;  /* Posicionado dentro del input */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--olive-green);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;  /* Aumentado el área de clic */
    z-index: 2;  /* Por encima del input */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--olive-dark);
}

.toggle-password i {
    position: static;  /* Anula la posición absoluta del ícono genérico */
    font-size: 1.1rem;
}

/* Ajuste específico para el campo de contraseña */
.input-field input[type="password"],
.input-field input[type="text"] {
    padding-right: 45px;  /* Espacio para el botón del ojo */
}