/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --bg-dark: #0f172a;       /* Slate 900 */
    --bg-panel: #1e293b;      /* Slate 800 */
    --primary: #3b82f6;       /* Blue 500 */
    --primary-hover: #2563eb; /* Blue 600 */
    --text-main: #f8fafc;     /* Slate 50 */
    --text-muted: #94a3b8;    /* Slate 400 */
    --border: #334155;        /* Slate 700 */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: "Inter", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden; /* Evita scroll doble en el body principal */
}

/* =========================================
   2. SPLIT LAYOUT (IZQUIERDA SCROLL / DERECHA FIJA)
   ========================================= */
.split-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* --- Panel Izquierdo (Brand - Scrolleable) --- */
.split-brand-panel {
    flex: 1.3;
    height: 100vh;
    overflow-y: auto; /* Habilita el scroll */
    display: block; 
    
    background: radial-gradient(circle at top right, #1e293b, #020617);
    position: relative;
    padding: 0;
    
    /* Ocultar barra de scroll (Estética limpia) */
    scrollbar-width: thin; 
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.split-brand-panel::-webkit-scrollbar {
    width: 8px; /* Ancho de la barra */
    display: block; /* Asegurar que se muestre */
}

.split-brand-panel::-webkit-scrollbar-track {
    background: transparent; /* Fondo transparente */
}

.split-brand-panel::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2); /* Color de la barra (blanco sutil) */
    border-radius: 4px;       /* Bordes redondeados */
    border: 2px solid transparent; /* Espacio interno */
    background-clip: content-box;
}

.split-brand-panel::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4); /* Más visible al pasar el mouse */
}

/* Patrón de fondo sutil (se mantiene igual) */
.split-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}
/* Contenedor interno para centrar contenido */
.brand-container {
    padding: 60px 50px;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.brand-section {
    margin-bottom: 80px;
}

/* --- Panel Derecho (Formulario - Fijo) --- */
.split-form-panel {
    flex: 1;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-left: 1px solid var(--border);
    position: relative;
    height: 100vh;
}

/* =========================================
   3. BRANDING & HERO (IZQUIERDA)
   ========================================= */
.brand-header {
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: white;
    background: linear-gradient(to bottom, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.logo-text span {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary); 
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.5));
}

.hero-title {
    font-size: 2.8rem;
    line-height: 1.1;
    margin: 0 0 1.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 90%;
}

.hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.pill {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-main);
}

/* =========================================
   4. TECH CARDS / FEATURES GRID
   ========================================= */
.section-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 600;
    opacity: 0.8;
}

.features-grid-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.tech-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.tech-card:hover {
    transform: translateY(-4px);
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.tech-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.icon-blue    { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); color: #60a5fa; }
.icon-purple  { background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.3); color: #c084fc; }
.icon-emerald { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #34d399; }
.icon-orange  { background: rgba(249, 115, 22, 0.15); border: 1px solid rgba(249, 115, 22, 0.3); color: #fb923c; }

.tech-content h3 { margin: 0 0 6px 0; font-size: 0.95rem; font-weight: 600; color: var(--text-main); }
.tech-content p { margin: 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* =========================================
   5. VISUALS & STATS
   ========================================= */
.dashboard-preview-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
    transition: transform 0.4s ease;
}
.dashboard-preview-card:hover { transform: perspective(1000px) rotateY(0deg) rotateX(0deg); }

.card-header-dots { display: flex; gap: 6px; margin-bottom: 20px; }
.card-header-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.2); }

.card-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; }

.mini-card {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}
.mini-card h5 { margin: 0 0 10px; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

.chart-container { position: relative; display: flex; align-items: center; justify-content: center; }
.donut-inner-text { position: absolute; text-align: center; }
.donut-inner-text .big-num { display: block; font-size: 1.2rem; font-weight: 700; color: white; }
.donut-inner-text .label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }

.stat-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; }
.stat-row span { font-size: 1.2rem; font-weight: 700; color: white; }
.stat-row small { font-size: 0.75rem; color: #22c55e; }

/* =========================================
   6. FOOTER (IZQUIERDA)
   ========================================= */
.brand-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 40px;
    padding-bottom: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 30px;
    margin-bottom: 30px;
}
.footer-col h4 { color: white; margin-top: 0; margin-bottom: 15px; font-size: 1rem; }
.footer-col p { margin: 0 0 10px; line-height: 1.5; font-size: 0.85rem; }
.footer-col a { display: block; color: var(--text-muted); text-decoration: none; margin-bottom: 8px; font-size: 0.9rem; }
.footer-col a:hover { color: var(--primary); }

.footer-form { display: flex; gap: 8px; }
.footer-form input { 
    flex: 1; padding: 10px; border-radius: 8px; 
    border: 1px solid var(--border); background: var(--bg-dark); color: white; 
}
.footer-form button { 
    padding: 10px 16px; background: var(--primary); color: white; 
    border: none; border-radius: 8px; cursor: pointer; font-weight: 600;
}
.footer-copy { font-size: 0.8rem; opacity: 0.6; text-align: center; margin-top: 20px; }

/* =========================================
   7. FORMULARIOS (LOGIN & MODAL)
   ========================================= */
.login-wrapper { width: 100%; max-width: 400px; }

.form-header { margin-bottom: 2rem; text-align: center; }
.form-header h2 { font-size: 1.75rem; margin: 0 0 0.5rem; }
.form-header p { color: var(--text-muted); margin: 0; font-size: 0.95rem; }

.input-group { margin-bottom: 1.25rem; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.4rem; }

.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.link-sm { font-size: 0.8rem; color: var(--primary); text-decoration: none; }
.link-sm:hover { text-decoration: underline; }

.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 1rem; opacity: 0.6; pointer-events: none; }

.modern-form input,
.modern-form select {
    width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px 10px 40px; /* Padding para icono */
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

/* Flecha para Selects */
.modern-form select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3f%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.modern-form input:focus, .modern-form select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.toggle-password {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px;
}

.btn-primary-block {
    width: 100%; background: var(--primary); color: white; border: none;
    padding: 12px; border-radius: 8px; font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: background 0.2s; margin-top: 0.5rem;
}
.btn-primary-block:hover { background: var(--primary-hover); }

.form-footer-cta { margin-top: 1.5rem; text-align: center; font-size: 0.9rem; color: var(--text-muted); }
.form-footer-cta a { color: var(--primary); text-decoration: none; font-weight: 500; }

.alert-box {
    padding: 10px; border-radius: 6px; background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; font-size: 0.85rem; margin-bottom: 1.5rem;
}
.field-error { color: #fca5a5; font-size: 0.8rem; display: block; margin-top: 4px; }

/* =========================================
   8. MODAL DE REGISTRO (FIXED)
   ========================================= */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center;
    z-index: 50; opacity: 0; transition: opacity 0.2s; padding: 1rem;
}
.modal.is-visible { display: flex; opacity: 1; }

.modal-dialog {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%; max-width: 680px;
    /* Límite de altura y scroll interno */
    max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.modal-header {
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: flex-start; flex-shrink: 0;
}
.modal-header h2 { margin: 0 0 4px; font-size: 1.4rem; }
.modal-header p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

.modal-close-btn { background: none; border: none; color: var(--text-muted); font-size: 2rem; line-height: 1; cursor: pointer; padding: 0; }
.modal-close-btn:hover { color: var(--text-main); }

.modal-body { 
    padding: 24px; 
    overflow-y: auto; /* Scroll interno */
    scrollbar-width: thin; scrollbar-color: var(--border) var(--bg-dark);
}

/* Ajustes inputs en modal (sin iconos izquierdos) */
.modal-body .modern-form input, 
.modal-body .modern-form select { padding-left: 12px; }
.modal-body .input-wrapper input { padding-right: 40px; }

/* Grid 2 Columnas */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 0; }

.modal-actions {
    margin-top: 24px; display: flex; justify-content: flex-end; gap: 12px;
    padding-top: 10px; border-top: 1px solid transparent;
}
.btn-ghost {
    background: transparent; color: var(--text-muted); border: 1px solid transparent;
    padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 0.95rem;
}
.btn-ghost:hover { color: var(--text-main); background: rgba(255,255,255,0.05); }

/* Scrollbar Modal Chrome */
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 20px; }

/* =========================================
   9. RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
    .split-layout { flex-direction: column; overflow-y: auto; }
    body { overflow: auto; }
    .split-brand-panel { flex: none; padding: 40px 20px; height: auto; overflow: visible; }
    .hero-title { font-size: 2.2rem; }
    .split-form-panel { flex: none; min-height: 100vh; border-left: none; border-top: 1px solid var(--border); }
}

@media (max-width: 640px) {
    .form-row-2 { grid-template-columns: 1fr; gap: 0; }
    .features-grid-cards { grid-template-columns: 1fr; }
    .modal-dialog { max-height: 95vh; }
    .footer-content { grid-template-columns: 1fr; gap: 20px; }
}