@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Modo Claro por defecto (Verde y Blanco Elegante) */
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(5, 150, 105, 0.2);
    --text-primary: #0f172a;
    --text-secondary: #047857;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-text: #0f172a;
    --input-placeholder: rgba(71, 85, 105, 0.5);
    --shadow: 0 20px 45px rgba(5, 150, 105, 0.12);
    --primary-green: #059669;
    --primary-green-hover: #047857;
    --card-accent-glow: radial-gradient(circle at 50% 0%, rgba(5, 150, 105, 0.1), transparent 70%);
}

body.dark-mode {
    /* Modo Oscuro (Tecnológico/Premium) */
    --bg-gradient: linear-gradient(135deg, #022c22 0%, #091315 100%);
    --card-bg: rgba(6, 78, 59, 0.2);
    --card-border: rgba(16, 185, 129, 0.25);
    --text-primary: #ffffff;
    --text-secondary: #a7f3d0;
    --input-bg: rgba(2, 44, 34, 0.4);
    --input-border: rgba(16, 185, 129, 0.3);
    --input-text: #ffffff;
    --input-placeholder: rgba(167, 243, 208, 0.5);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    --primary-green: #10b981;
    --primary-green-hover: #34d399;
    --card-accent-glow: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.2), transparent 70%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

body {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-gradient);
    overflow-x: hidden;
    padding: 20px;
}

/* Contenedor Principal (Tarjeta Centrada) */
.login-container {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    position: relative;
    padding: 45px 40px;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--card-accent-glow);
    pointer-events: none;
    z-index: 0;
}

/* Sección de Formulario y Contenido */
.form-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
    position: relative;
}

/* Header de Marca (Branding Integrado) */
.brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.brand-logo-container {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.brand-logo-icon {
    font-size: 24px;
    color: var(--primary-green);
}

.brand-header-text {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.brand-header-text span {
    color: var(--primary-green);
}

/* Header del Formulario */
.form-header {
    text-align: center;
    margin-bottom: 28px;
}

.form-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 350;
}

/* Formularios e Inputs Modernos */
.input-group-custom {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--input-placeholder);
    font-size: 16px;
    pointer-events: none;
}

.input-field {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 46px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    color: var(--input-text);
    font-size: 15px;
    outline: none;
}

.input-field::placeholder {
    color: var(--input-placeholder);
    font-weight: 300;
}

.input-field:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
    background: var(--input-bg);
}

/* Botón de Submit */
.btn-submit {
    width: 100%;
    height: 52px;
    background: var(--primary-green);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-submit:hover {
    background: var(--primary-green-hover);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(1px);
}

/* Alertas de Error y Advertencia */
.alert-container {
    margin-bottom: 20px;
}

.alert-custom {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid;
    animation: slideDown 0.3s ease-out;
}

.alert-warning-custom {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
}

.alert-danger-custom {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

/* Control de Cambio de Modo */
.mode-toggle-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 28px;
    margin-bottom: 12px;
}

.mode-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--input-border);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--primary-green);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: #ffffff;
}

input:checked + .slider {
    background-color: var(--primary-green);
}

/* Footer integrado en la tarjeta */
.form-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.6;
    font-weight: 300;
}

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

/* Ajustes Responsivos Básicos */
@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    .login-container {
        padding: 35px 24px;
        border-radius: 20px;
    }
}
