*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Superficie & Fondos Tech */
    --bg-base: #f1f5f9;
    --bg-grad-1: #f8fafc;
    --bg-grad-2: #e2e8f0;
    --bg-grad-3: #dbeafe;

    /* Vidrio Claro Multi-capa (Glassmorphism) */
    --glass-card-bg: rgba(255, 255, 255, 0.72);
    --glass-sidebar-bg: rgba(248, 250, 252, 0.65);
    --glass-form-bg: rgba(255, 255, 255, 0.88);
    --glass-border-light: rgba(255, 255, 255, 0.95);
    --glass-border-subtle: rgba(203, 213, 225, 0.45);
    --glass-border-focus: rgba(37, 99, 235, 0.3);

    /* Sombras Elevadas */
    --shadow-glass: 0 30px 60px -12px rgba(15, 23, 42, 0.12),
        0 12px 28px -8px rgba(15, 23, 42, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 1);

    /* Textos Compactos Técnicos */
    --text-primary: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    /* Paleta Institucional Tech */
    --brand-blue: #1d4ed8;
    --brand-blue-hover: #1e40af;
    --brand-cyan: #0284c7;
    --brand-cyan-light: rgba(2, 132, 199, 0.08);
    --brand-cyan-border: rgba(2, 132, 199, 0.22);
    --brand-indigo: #4f46e5;

    /* Inputs */
    --input-bg: rgba(255, 255, 255, 0.85);
    --input-border: #cbd5e1;
    --input-focus-border: #2563eb;
    --input-glow: rgba(37, 99, 235, 0.14);

    /* Métricas */
    --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-container: 24px;
    --radius-card: 12px;
    --radius-input: 8px;

    --transition-smooth: 0.2s cubic-bezier(0.16, 1, 0.3, 1);


}

/* Base Body */
html,
body {
    height: 100%;
}

body.tech-body-root {
    font-family: var(--font-sans);
    font-size: 13px;
    /* Tamaño reducido para estética técnica */
    color: var(--text-body);
    background-color: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

.tech-canvas-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(135deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 50%, var(--bg-grad-3) 100%);
    overflow: hidden;
}

.bg-grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
    background-size: 32px 32px;
}

.bg-dots-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(37, 99, 235, 0.1) 1.2px, transparent 1.2px);
    background-size: 16px 16px;
    opacity: 0.7;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.6;
    animation: floatGlow 12s infinite alternate ease-in-out;
}

.orb-primary {
    top: -12%;
    left: 8%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
}

.orb-cyan {
    bottom: -15%;
    right: 5%;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
    animation-delay: -4s;
}

.orb-violet {
    top: 30%;
    left: 40%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(255, 255, 255, 0) 70%);
    animation-delay: -8s;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 20px) scale(1.05);
    }
}

/* ==========================================================================
LAYOUT PRINCIPAL Y TARJETA GLASSMORPHISM
========================================================================== */
.auth-viewport {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.glass-split-card {
    display: flex;
    width: 100%;
    max-width: 960px;
    background: var(--glass-card-bg);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius-container);
    box-shadow: var(--shadow-glass);
    overflow: hidden;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

/* ==========================================================================
SIDEBAR IZQUIERDO: INFORMACIÓN INSTITUCIONAL
========================================================================== */
.panel-info-sidebar {
    flex: 1.15;
    background: var(--glass-sidebar-bg);
    padding: 2.25rem 2.25rem;
    border-right: 1px solid var(--glass-border-subtle);
    display: flex;
    flex-direction: column;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Header & Breadcrumb */
.brand-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.brand-logo-wrap {
    display: inline-block;
    align-self: center;
    transition: transform var(--transition-smooth);
}

.brand-logo-wrap:hover {
    transform: translateY(-1px);
}

.dre-brand-logo {
    max-width: 310px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.hierarchy-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(222, 226, 230, 0.6);
}

.hp-tag {
    color: var(--text-muted);
}

.hp-tag.hp-highlight {
    color: var(--brand-blue);
    font-weight: 700;
}

.hp-tag.hp-sub {
    color: var(--brand-cyan);
    font-weight: 700;
}

.hp-sep {
    color: var(--text-subtle);
    opacity: 0.6;
}

/* Status Badge y Titular */
.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--brand-cyan);
    background: var(--brand-cyan-light);
    border: 1px solid var(--brand-cyan-border);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.6rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #0284c7;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.6);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(2, 132, 199, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(2, 132, 199, 0);
    }
}

.system-main-title {
    font-size: clamp(1.15rem, 1.8vw, 1.35rem);
        font-family: Oswald, sans-serif !important;

    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.025em;
    margin-bottom: 0.4rem;
}

.system-description {
        font-family: Oswald, sans-serif !important;
    font-size: clamp(0.72rem, 1vw, 0.76rem);
    color: var(--text-muted);
    line-height: 1.45;
}

/* Pilares / Módulos */
.infrastructure-pillars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.pillar-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius-card);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
    transition: all var(--transition-smooth);
}

.pillar-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.pillar-icon-box {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: var(--brand-cyan-light);
    border: 1px solid rgba(2, 132, 199, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-cyan);
}

.pillar-icon-box svg {
    width: 16px;
    height: 16px;
}

.pillar-title {
        font-family: Oswald, sans-serif !important;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.pillar-desc {
        font-family: Oswald, sans-serif !important;

    font-size: 0.67rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Sidebar Footer */
.security-badge {
        font-family: Oswald, sans-serif !important;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.66rem;
    font-weight: 500;
    color: var(--text-subtle);
}

.shield-icon {
    width: 14px;
    height: 14px;
    color: var(--brand-blue);
    flex-shrink: 0;
}

/* ==========================================================================
PANEL DERECHO: FORMULARIO DE ACCESO
========================================================================== */
.panel-auth-form {
    flex: 0.85;
    background: var(--glass-form-bg);
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-container {
    max-width: 330px;
    margin: 0 auto;
    width: 100%;
}

/* Encabezado */
.form-title-group {
    margin-bottom: 1.25rem;
}

.form-chip {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--brand-blue);
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
}

.form-heading {
        font-family: Oswald, sans-serif !important;
    font-size: clamp(1.1rem, 1.6vw, 1.25rem);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.015em;
}

.form-subheading {
        font-family: Oswald, sans-serif !important;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Session Status */
.auth-session-status {
    background: rgba(240, 253, 244, 0.9);
    border: 1px solid #bbf7d0;
    color: #15803d;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-input);
    font-size: 0.7rem;
    margin-bottom: 1rem;
}

/* Campos de entrada */
.form-field-group {
    margin-bottom: 0.95rem;
}

.tech-label {
        font-family: Oswald, sans-serif !important;
    display: block;
    font-size: 0.71rem;
    font-weight: 600;
    color: var(--text-body);
    margin-bottom: 0.3rem;
}

.input-glow-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: color var(--transition-smooth);
}

.input-icon svg {
    width: 15px;
    height: 15px;
}

.tech-input {
    width: 100%;
    height: 38px;
    padding: 0 2.2rem 0 2.2rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-input);
    font-size: 0.78rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-smooth);
}

.tech-input::placeholder {
    color: var(--text-subtle);
    font-size: 0.74rem;
}

.tech-input:hover {
    border-color: #94a3b8;
}

.tech-input:focus {
    border-color: var(--input-focus-border);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--input-glow);
}

.input-glow-wrapper:focus-within .input-icon {
    color: var(--brand-blue);
}

/* Botón toggle contraseña */
.password-toggle-btn {
    position: absolute;
    right: 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color var(--transition-smooth);
}

.password-toggle-btn:hover {
    color: var(--brand-blue);
}

.eye-icon {
    width: 15px;
    height: 15px;
}

.eye-icon.hidden {
    display: none;
}

.tech-error-message {
    color: #dc2626;
    font-size: 0.67rem;
    margin-top: 0.2rem;
    display: block;
}

/* Utilidades: Checkbox & Link */
.form-utilities {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.2rem;
    margin-bottom: 1.15rem;
}

.custom-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.tech-checkbox {
    width: 14px;
    height: 14px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    accent-color: var(--brand-blue);
    cursor: pointer;
}

.checkbox-label-text {
        font-family: Oswald, sans-serif !important;
    font-size: 0.7rem;
    color: var(--text-muted);
    user-select: none;
}

.tech-link-forgot {
        font-family: Oswald, sans-serif !important;
    font-size: 0.7rem;
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-smooth);
}

.tech-link-forgot:hover {
    color: var(--brand-blue-hover);
    text-decoration: underline;
}

/* Botón Iniciar Sesión */
.form-action-wrap {
    margin-top: 0.2rem;
}

.btn-tech-submit {
    width: 100%;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-input);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-tech-submit:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-tech-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn-arrow-icon {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-smooth);
}

.btn-tech-submit:hover .btn-arrow-icon {
    transform: translateX(3px);
}

/* Footer Legal */
.form-legal-footer {
    margin-top: 1.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--glass-border-subtle);
    text-align: center;
}

.copyright-text {
        font-family: Oswald, sans-serif !important;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.meta-version {
        font-family: Oswald, sans-serif !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: 0.6rem;
    color: var(--text-subtle);
    margin-top: 0.2rem;
}

.dot-sep {
    opacity: 0.5;
}

.v-tag {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--brand-blue);
}

/* ==========================================================================
ADAPTATIVIDAD RESPONSIVA (MOBILE & TABLET)
========================================================================== */
@media (max-width: 850px) {
    .glass-split-card {
        flex-direction: column;
        max-width: 450px;
        border-radius: 20px;
    }

    .panel-info-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--glass-border-subtle);
        padding: 1.5rem 1.25rem;
    }

    .panel-auth-form {
        padding: 1.5rem 1.25rem;
    }

    .infrastructure-pillars {
        display: none;
        /* Se oculta la lista detallada en móviles para prevenir scroll excesivo */
    }

    .sidebar-footer {
        display: none;
    }


}

@media (max-width: 480px) {
    .auth-viewport {
        padding: 0.75rem;
    }

    .form-utilities {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .dre-brand-logo {
        max-width: 180px;
    }


}