/**
 * Estilos para la página de Login del Portal AMCAD
 * Mantiene coherencia con el diseño principal del portal
 */

/* Página de Login */
.login-page {
    min-height: calc(100vh - 400px);
    padding: 60px 0 80px;
    background: #fff;
}

.login-page + .main-footer {
    margin-top: 0;
}

.login-container {
    max-width: 500px;
    margin: 0 auto;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    margin-bottom: 30px;
}

.login-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
}

.login-context-logo {
    order: 2;
    width: 120px;
    height: 120px;
    flex: 0 0 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-context-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-header-text {
    order: 1;
    flex: 1;
    text-align: left;
}

.login-header.no-logo .login-header-text {
    margin: 0 auto;
    text-align: center;
}

.login-header h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}

.login-subtitle {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
}

/* Alertas */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1565c0;
    border: none;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: none;
    box-shadow: none;
    outline: none;
}

/* Selector de Contexto */
.context-selector {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #84ac74 0%, #6d9460 100%);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(132, 172, 116, 0.3);
}

.context-selector label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.context-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    background: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.context-select:hover {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.context-select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.context-select option {
    padding: 10px;
    font-weight: 500;
}

.context-select option:first-child {
    font-weight: 600;
    color: #84ac74;
}

.context-error {
    display: none;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 4px;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input:hover {
    border-color: #bdc3c7;
}

.forgot-password-link {
    font-size: 13px;
    color: #3498db;
    text-decoration: none;
    margin-top: 4px;
    align-self: flex-end;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Checkbox personalizado */
.checkbox-group {
    margin: 8px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
}

.checkbox-label span {
    font-size: 14px;
    color: #34495e;
}

/* Botón de Login */
.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-login:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* Enlace de registro */
.register-link {
    text-align: center;
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 10px;
}

.register-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Header activo */
.main-nav li.active a {
    color: #84ac74;
    font-weight: 600;
}

.header-logo-link {
    text-decoration: none;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .context-selector {
        padding: 15px;
        margin-bottom: 20px;
    }

    .context-selector label {
        font-size: 13px;
    }

    .context-select {
        padding: 10px 12px;
        font-size: 14px;
    }

    .login-page {
        padding: 30px 0;
    }

    .login-card {
        padding: 30px 20px;
        margin: 0 15px;
        border-radius: 8px;
    }

    .login-header-content {
        flex-direction: column;
        text-align: center;
    }

    .login-header-text {
        margin-left: 0;
        text-align: center;
    }

    .login-header h2 {
        font-size: 24px;
    }

    .login-subtitle {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 25px 15px;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 14px;
    }

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

/* Estados de carga */
.btn-login:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-login:disabled:hover {
    transform: none;
}

/* Animación de entrada para las alertas */
.alert {
    animation: slideInDown 0.3s ease-out;
}

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