/* ====================================
   RESET Y CONFIGURACIÓN GENERAL
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0078d4;
    --primary-hover: #005a9e;
    --primary-light: #e8f4f8;
    --bg-color: #f5f5f5;
    --white: #ffffff;
    --text-dark: #323130;
    --text-gray: #605e5c;
    --text-light: #8a8886;
    --border-color: #edebe9;
    --success-color: #107c10;
    --error-color: #d13438;
    --warning-color: #ffb900;
    --shadow-sm: 0 1.6px 3.6px rgba(0, 0, 0, 0.13), 0 0.3px 0.9px rgba(0, 0, 0, 0.11);
    --shadow-md: 0 3.2px 7.2px rgba(0, 0, 0, 0.13), 0 0.6px 1.8px rgba(0, 0, 0, 0.11);
    --shadow-lg: 0 6.4px 14.4px rgba(0, 0, 0, 0.13), 0 1.2px 3.6px rgba(0, 0, 0, 0.11);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow: hidden;
}

/* ====================================
   CONTENEDOR PRINCIPAL
   ==================================== */
.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ====================================
   PANEL IZQUIERDO (Información)
   ==================================== */
.login-left-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.left-panel-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
    text-align: center;
}

.logo-container {
    margin-bottom: 60px;
}

.logo-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: var(--shadow-lg);
}

.logo-icon {
    font-size: 60px;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    padding: 10px;
}

.system-name {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.system-subtitle {
    font-size: 18px;
    opacity: 0.9;
    font-weight: 300;
}

.welcome-message {
    margin-bottom: 40px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
}

.welcome-text {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.8;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-icon {
    font-size: 24px;
}

.feature-text {
    font-size: 15px;
    font-weight: 500;
}

/* ====================================
   PANEL DERECHO (Formulario)
   ==================================== */
.login-right-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--white);
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 15px;
    color: var(--text-gray);
}

/* ====================================
   MENSAJES DE ALERTA
   ==================================== */
.alert-message {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.alert-message.error {
    background: #fef6f6;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

.alert-message.success {
    background: #f0fdf4;
    color: var(--success-color);
    border: 1px solid #bbf7d0;
}

.alert-message.warning {
    background: #fffbeb;
    color: var(--warning-color);
    border: 1px solid #fef3c7;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================================
   FORMULARIO
   ==================================== */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.label-icon {
    font-size: 18px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-dark);
    background: var(--white);
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: var(--error-color);
}

.form-input:valid:not(:placeholder-shown) {
    border-color: var(--success-color);
}

.form-input::placeholder {
    color: var(--text-light);
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23605e5c' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ====================================
   INPUT DE CONTRASEÑA CON TOGGLE
   ==================================== */
.password-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.password-toggle-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
    margin: 0;
}

.password-toggle-label {
    font-size: 14px;
    color: var(--text-gray);
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-weight: 400;
    transition: var(--transition);
}

.password-toggle-label:hover {
    color: var(--primary-color);
}

.password-toggle-checkbox:checked + .password-toggle-label {
    color: var(--text-dark);
}

.form-error {
    display: block;
    font-size: 12px;
    color: var(--error-color);
    margin-top: 6px;
    min-height: 18px;
}

/* ====================================
   BOTÓN DE LOGIN
   ==================================== */
.btn-login {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    position: relative;
}

.btn-login:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ====================================
   FOOTER DEL FORMULARIO
   ==================================== */
.form-footer {
    margin-top: 32px;
    text-align: center;
}

.footer-text {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.footer-link {
    font-size: 14px;
}

.admin-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.admin-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (max-width: 1024px) {
    .login-left-panel {
        display: none;
    }

    .login-right-panel {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .login-right-panel {
        padding: 20px;
    }

    .login-form-container {
        max-width: 100%;
    }

    .form-title {
        font-size: 28px;
    }

    .system-name {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .form-title {
        font-size: 24px;
    }

    .form-subtitle {
        font-size: 14px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .btn-login {
        padding: 14px;
        font-size: 15px;
    }
}

/* ====================================
   OCULTAR ICONOS DE NAVEGADOR
   ==================================== */
input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none !important;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none !important;
}

