/**
 * Archivo: app/seguridad/login/login.css
 * Versión: 2.0.0
 * Fecha: 2026-02-11
 * Descripción: Estilos para el Login con soporte dual theme (light/dark).
 *              Glassmorphism, Responsive y diseño profesional.
 * Proyecto: Portal IA Concar
 */

/* ============================================
   VARIABLES - LIGHT THEME (por defecto)
   ============================================ */
[data-theme="light"] {
    --accent: #6366f1;
    --accent-hover: #5558e3;
    --accent-soft: rgba(99, 102, 241, 0.2);
    --accent-purple: #a855f7;
    
    --bg-overlay: rgba(15, 23, 42, 0.75);
    --container-bg: rgba(255, 255, 255, 0.95);
    --container-border: rgba(255, 255, 255, 0.15);
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-bg-focus: rgba(255, 255, 255, 1);
    --input-border: rgba(0, 0, 0, 0.15);
    
    --tab-inactive-bg: rgba(0, 0, 0, 0.05);
    --tab-border: rgba(0, 0, 0, 0.1);
    
    --success: #10b981;
    --error: #ef4444;
    --info: #3b82f6;
    
    --shadow-deep: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-button: 0 8px 24px rgba(99, 102, 241, 0.4);
    --shadow-button-hover: 0 12px 32px rgba(99, 102, 241, 0.5);
    
    --radius: 20px;
    --radius-input: 14px;
    --radius-button: 14px;
}

/* ============================================
   VARIABLES - DARK THEME
   ============================================ */
[data-theme="dark"] {
    --accent: #6366f1;
    --accent-hover: #5558e3;
    --accent-soft: rgba(99, 102, 241, 0.2);
    --accent-purple: #a855f7;
    
    --bg-overlay: radial-gradient(circle at center, rgba(15, 23, 42, 0.4) 0%, #0f172a 100%);
    --container-bg: rgba(30, 41, 59, 0.75);
    --container-border: rgba(255, 255, 255, 0.1);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --input-bg: rgba(0, 0, 0, 0.25);
    --input-bg-focus: rgba(0, 0, 0, 0.35);
    --input-border: rgba(255, 255, 255, 0.1);
    
    --tab-inactive-bg: rgba(0, 0, 0, 0.25);
    --tab-border: rgba(255, 255, 255, 0.1);
    
    --success: #10b981;
    --error: #ef4444;
    --info: #3b82f6;
    
    --shadow-deep: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --shadow-button: 0 8px 24px rgba(99, 102, 241, 0.4);
    --shadow-button-hover: 0 12px 32px rgba(99, 102, 241, 0.5);
    
    --radius: 20px;
    --radius-input: 14px;
    --radius-button: 14px;
}

/* ============================================
   RESET Y BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   FONDO CON IMAGEN
   ============================================ */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../../../assets/img/fondo/fondo01.avif');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    z-index: -1;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ============================================
   CAJA DE LOGIN (GLASSMORPHISM)
   ============================================ */
.login-box {
    background: var(--container-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--container-border);
    border-radius: var(--radius);
    padding: 38px 30px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-deep);
    animation: fadeInUp 0.6s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   LOGOS SUPERIORES
   ============================================ */
.logos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
    margin-bottom: 0px;
}

.logo-img {
    max-height: 45px;
    max-width: 45%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* ============================================
   HEADER DEL LOGIN
   ============================================ */
.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.login-logo {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    user-select: none;
}

.login-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    user-select: none;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    user-select: none;
}

/* ============================================
   TABS DE ACCESO
   ============================================ */
.login-tabs {
    display: flex;
    gap: 12px;
    width: 100%;
    border-bottom: 2px solid var(--tab-border);
    padding-bottom: 8px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.tab-btn:hover {
    background: var(--tab-inactive-bg);
}

.tab-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ============================================
   CONTENIDO DE TABS
   ============================================ */
.tab-content {
    display: none;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FORMULARIOS
   ============================================ */
.login-form {
    display: none;
    width: 100%;
}

.login-form.active {
    display: block;
}

form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================
   INPUTS
   ============================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"], 
input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-input);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]::placeholder, 
input[type="password"]::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus, 
input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    background: var(--input-bg-focus);
}

/* ============================================
   CHECKBOX
   ============================================ */
.form-options {
    display: flex;
    align-items: center;
    gap: 8px;
	margin-bottom: 10px !important;
	margin-top: 10px !important;
}

.form-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.form-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   BOTONES
   ============================================ */
button[type="submit"], 
.btn-biometric {
    width: 100%;
    padding: 16px 0;
    border-radius: var(--radius-button);
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-button);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

button[type="submit"]:hover, 
.btn-biometric:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-button-hover);
}

button[type="submit"]:active, 
.btn-biometric:active {
    transform: translateY(0);
}

button[type="submit"]:disabled,
.btn-biometric:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   SECCIÓN BIOMÉTRICA
   ============================================ */
.biometric-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    padding: 20px 0;
}

.biometric-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    box-shadow: var(--shadow-button);
}

.biometric-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.biometric-text strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 8px;
}

/* ============================================
   MENSAJES DE ESTADO
   ============================================ */
.status-message {
    padding: 14px 18px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    display: block;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    display: block;
}

.status-message.info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
    display: block;
}

/* ============================================
   FOOTER
   ============================================ */
.login-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    user-select: none;
}

.login-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   LOADER INICIAL
   ============================================ */
.loader-init {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.loader-init i {
    font-size: 32px;
    margin-bottom: 16px;
    display: block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loader-init p {
    font-size: 14px;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 480px) {
    .login-box {
        width: 95%;
        padding: 32px 24px;
        border-radius: 16px;
        gap: 24px;
    }

    .logos-header {
        flex-direction: row;
        justify-content: space-around;
        gap: 16px;
    }

    .logo-img {
        max-height: 40px;
    }

    .login-logo {
        font-size: 24px;
    }

    .login-title {
        font-size: 18px;
    }

    .login-subtitle {
        font-size: 13px;
    }

    .login-tabs {
        flex-direction: row;
        gap: 8px;
    }

    .tab-btn {
        font-size: 13px;
        padding: 10px;
    }

    input[type="text"], 
    input[type="password"] {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 12px 16px;
    }

    button[type="submit"], 
    .btn-biometric {
        padding: 14px 0;
        font-size: 15px;
    }

    .biometric-icon {
        width: 70px;
        height: 70px;
        font-size: 35px;
    }
}

@media (max-width: 360px) {
    .login-container {
        padding: 10px;
    }

    .login-box {
        padding: 24px 18px;
        gap: 20px;
    }

    .logos-header {
        gap: 12px;
    }
}