/*-------------------------
    Autor: David Uzcategui
    Mail: daviduzcategui160276@gmail.com
    creacion: 08.08.2025
    descripcion: Estilos para el login (Diseño en dos columnas con temas claro/oscuro)
    última modificación: 07-08-2026
---------------------------*/

:root {
    /* ----- TEMA CLARO (Por defecto) ----- */
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --text-primary: #0b1830;
    --text-secondary: #4a5a6a;
    --border-color: #d5dbe3;
    --input-bg: #f8f9fc;
    --shadow-color: rgba(11, 24, 48, 0.12);
    --primary-dark: #0b1830;
    --primary-blue: #1d3866;
    --accent-cyan: #00a8ff;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --radius: 12px;
}

/* ----- TEMA OSCURO (Se activa automáticamente) ----- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0b1320;
        --bg-card: #1c293f;
        --text-primary: #e5e9f0;
        --text-secondary: #8a9bb5;
        --border-color: #2a3d5c;
        --input-bg: #162033;
        --shadow-color: rgba(0, 0, 0, 0.6);
        --accent-cyan: #4db8ff;
    }
}

/* ===== ESTILOS GLOBALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ===== CONTENEDOR PRINCIPAL EN DOS COLUMNAS ===== */
.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: stretch;
}

/* ===== COLUMNA IZQUIERDA (INFORMACIÓN) ===== */
.login-left {
    flex: 0 0 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 60px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.login-brand-left {
    margin-bottom: 25px;
    max-width: 350px;
}

.login-brand-left img {
    max-width: 140px;
    height: auto;
    margin-bottom: 15px;
}

.login-brand-left h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 5px 0;
}

.login-brand-left p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.left-content h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.left-content > p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* ===== CUADRÍCULA DE ICONOS Y FUNCIONES ===== */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.feature-item {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent-cyan);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.feature-item i {
    font-size: 1.8rem;
    color: var(--accent-cyan);
    margin-bottom: 10px;
}

.feature-item span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== COLUMNA DERECHA (LOGIN) ===== */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ===== TARJETA DEL FORMULARIO ===== */
.login-wrapper {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 15px 35px var(--shadow-color);
    padding: 40px 35px;
    position: relative;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.6s ease;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-dark), var(--accent-cyan));
    border-radius: var(--radius) var(--radius) 0 0;
}

.login-brand-right {
    text-align: center;
    margin-bottom: 25px;
}

.login-brand-right img {
    max-width: 100px;
    height: auto;
    margin-bottom: 10px;
}

.login-brand-right h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.login-brand-right p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== FORMULARIO ===== */
.input-group {
    margin-bottom: 18px;
    position: relative;
}

.input-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 1rem;
    z-index: 1;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-primary);
    height: 46px;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.input-wrapper input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 4px rgba(0, 168, 255, 0.12);
}

.input-wrapper input:focus + .input-icon {
    color: var(--accent-cyan);
}

.input-wrapper input.error {
    border-color: var(--error-color);
    animation: shake 0.4s;
}

.password-group .password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
    z-index: 2;
}

.password-group .password-toggle:hover {
    color: var(--accent-cyan);
}

/* ===== OPCIONES Y BOTÓN ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.85rem;
}

.form-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-options label input[type="checkbox"] {
    accent-color: var(--accent-cyan);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-options a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 500;
}

.form-options a:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(11, 24, 48, 0.3);
}

.btn-login:active {
    transform: scale(0.98);
}

.btn-login.loading .btn-text { opacity: 0; }
.btn-login.loading .btn-loader { display: block; }
.btn-loader {
    position: absolute;
    display: none;
}

/* ===== PIE DE PÁGINA Y CREDENCIALES ===== */
.demo-credentials {
    margin-top: 20px;
    padding: 14px;
    background: var(--input-bg);
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.demo-credentials p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.cred-box {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.cred-box strong {
    color: var(--text-primary);
}

.form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.form-footer a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ===== MODALES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal.show { display: flex; }

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 35px var(--shadow-color);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-header h3 i { color: var(--accent-cyan); }

.modal-close {
    background: none; border: none; font-size: 1.5rem;
    cursor: pointer; color: var(--text-secondary);
    transition: color 0.2s ease, transform 0.2s ease;
}
.modal-close:hover {
    color: var(--error-color); transform: rotate(90deg);
}

.modal-body { padding: 22px; }
.modal-body p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 15px; }

.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border-color);
    display: flex; justify-content: flex-end; gap: 12px;
}
.modal-btn {
    padding: 10px 20px; border: none; border-radius: 8px;
    font-size: 0.85rem; font-weight: 500; cursor: pointer;
    transition: 0.2s ease;
}
.modal-btn.cancel { background: #f1f3f5; color: var(--text-primary); }
.modal-btn.cancel:hover { background: #e9ecef; }
.modal-btn.send { background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue)); color: #fff; }
.modal-btn.send:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(11, 24, 48, 0.3); }

.modal-message {
    padding: 10px 14px; border-radius: 8px; margin-bottom: 15px;
    font-size: 0.85rem; display: flex; align-items: center; gap: 8px;
}
.modal-message.success { background: rgba(46, 204, 113, 0.1); border-left: 4px solid var(--success-color); color: #27ae60; }
.modal-message.error { background: rgba(231, 76, 60, 0.1); border-left: 4px solid var(--error-color); color: #c0392b; }

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .login-left {
        flex: 0 0 45%;
        padding: 30px 40px;
    }
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        min-height: 100vh;
    }
    
    .login-left {
        display: none; /* En móviles se oculta la columna izquierda */
    }
    
    .login-right {
        width: 100%;
        padding: 20px;
        min-height: 100vh;
        align-items: flex-start; /* En móviles muy pequeños se alinea arriba */
        padding-top: 40px;
    }

    .login-wrapper {
        max-width: 100%;
        padding: 35px 25px;
    }
}

@media (max-width: 480px) {
    .login-wrapper { padding: 25px 20px; }
    .login-brand-right h1 { font-size: 1.2rem; }
    .form-options { flex-direction: column; align-items: flex-start; gap: 10px; }
    .cred-box { flex-direction: column; gap: 5px; align-items: center; }
    .modal-footer { flex-direction: column; }
    .modal-btn { width: 100%; justify-content: center; }
}