/**
 * Estilos Modernos Dark Tech Executive — Plataforma Psicométrica ITN
 * CEVC-ARN (Consumo de Video Corto y Rendimiento Neurocognitivo)
 */

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

:root {
    --bg-main: #060911;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #1e293b;
    --bg-glass: rgba(15, 23, 42, 0.75);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.3);
    --accent-emerald: #10b981;
    --accent-purple: #8b5cf6;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-bright: rgba(6, 182, 212, 0.4);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
}

/* ==============================================================================
   CABECERA GLOBAL
============================================================================== */
.app-header {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
}

.header-logo {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.header-titles h1 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.header-titles p {
    font-size: 0.72rem;
    color: var(--accent-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==============================================================================
   BOTONES Y ELEMENTOS DE ACCIÓN
============================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-cyan-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}
.btn-secondary:hover {
    background: #334155;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-accent {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #ffffff;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

/* ==============================================================================
   BADGES Y CHIPS
============================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-demographic {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-independent {
    background: rgba(6, 182, 212, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-dependent {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==============================================================================
   CONTENEDOR DE VISTAS (APP VIEWS)
============================================================================== */
.app-view {
    display: none;
    opacity: 0;
    transition: opacity var(--transition-smooth);
    flex: 1;
    padding: 2rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.app-view.active {
    display: block;
    opacity: 1;
}

/* ==============================================================================
   VISTA 1: PORTADA Y BIENVENIDA (#view-welcome)
============================================================================== */
.welcome-hero {
    text-align: center;
    max-width: 720px;
    margin: 2rem auto;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: var(--radius-full);
    color: var(--accent-cyan);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title span {
    color: var(--accent-cyan);
    -webkit-text-fill-color: var(--accent-cyan);
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.meta-counter-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1.5rem auto 2.5rem;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.counter-stats {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.counter-num {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-cyan);
}

.counter-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.counter-bar-wrapper {
    height: 8px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.counter-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #10b981);
    width: 0%;
    transition: width 0.6s ease;
}

.hero-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 3rem;
    text-align: left;
}

.feature-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition-fast);
}
.feature-box:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.feature-box i {
    color: var(--accent-cyan);
    margin-bottom: 0.75rem;
}

.feature-box h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.feature-box p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==============================================================================
   VISTA 2: ENCUESTA INTERACTIVA (#view-survey)
============================================================================== */
.survey-wizard-container {
    max-width: 680px;
    margin: 0 auto;
}

.survey-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.survey-progress-track {
    height: 6px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.survey-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #8b5cf6);
    width: 5%;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.survey-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.question-header {
    margin-bottom: 1.5rem;
}

.question-number-tag {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.q-code {
    background: var(--bg-surface-elevated);
    color: var(--accent-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.q-dim {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.question-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.question-context {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Opciones Demográficas */
.demographic-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.demo-option-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
}

.demo-option-card:hover {
    border-color: rgba(6, 182, 212, 0.5);
    background: #253349;
}

.demo-option-card.selected {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.15);
    box-shadow: 0 0 16px var(--accent-cyan-glow);
}

.demo-bullet {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.demo-option-card.selected .demo-bullet {
    background: var(--accent-cyan);
    color: #ffffff;
}

.demo-text {
    flex: 1;
}

/* Escala Likert de 5 opciones */
.likert-shortcuts-hint {
    margin: 0.5rem 0 1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.likert-options-container {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.likert-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
    font-family: inherit;
}

.likert-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(3px);
}

.likert-btn.selected {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.18);
    box-shadow: 0 0 18px var(--accent-cyan-glow);
}

.likert-btn-num {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.likert-btn-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.likert-label {
    font-size: 0.98rem;
    font-weight: 600;
}

.likert-sublabel {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.likert-check-badge {
    color: var(--text-muted);
}
.likert-btn.selected .likert-check-badge {
    color: var(--accent-cyan);
}

.survey-nav-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.submitting-spinner-box {
    text-align: center;
    padding: 3rem 1rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(6, 182, 212, 0.2);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==============================================================================
   VISTA 3: DIAGNÓSTICO INDIVIDUAL (#view-result)
============================================================================== */
.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.result-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.score-metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.score-metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}
.card-ica::before { background: var(--accent-cyan); }
.card-idc::before { background: var(--accent-rose); }

.score-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.score-title-row h3 {
    font-size: 1rem;
    font-weight: 700;
}

.score-value {
    font-size: 2.6rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.score-status {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.score-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.radar-chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.radar-chart-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.radar-chart-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.radar-canvas-container {
    height: 380px;
    position: relative;
}

.tips-section {
    margin-bottom: 2.5rem;
}

.tips-section h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.tip-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.tip-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tip-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.tip-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ==============================================================================
   VISTA 4: PANEL DE INVESTIGADOR (UNIDAD 3) (#view-dashboard)
============================================================================== */
.dash-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.dash-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.dash-stat-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.dash-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.dash-stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.dash-stat-sub {
    font-size: 0.8rem;
    color: var(--accent-cyan);
}

.dash-hypothesis-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.6) 100%);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.dash-hypothesis-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-hypothesis-card p {
    font-size: 0.95rem;
    color: #e2e8f0;
    line-height: 1.55;
}

/* Bento Grid de 12 Gráficas */
.charts-bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.chart-card.col-span-2 {
    grid-column: span 2;
}

.chart-card-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.chart-card-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.chart-card-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.btn-dl-chart {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition-fast);
    flex-shrink: 0;
}
.btn-dl-chart:hover {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border-color: var(--border-bright);
}

.chart-canvas-wrapper {
    height: 290px;
    position: relative;
}

.chart-card.col-span-2 .chart-canvas-wrapper {
    height: 340px;
}

/* Tabla de Respuestas (Responsive Table con Sticky Headers) */
.dash-table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 3rem;
}

.dash-table-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.table-wrapper {
    overflow: auto;
    max-inline-size: 100%;
    max-block-size: min(520px, 75vh);
    container-type: inline-size;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.table-wrapper:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}

caption {
    text-align: left;
    padding: 0.65rem 1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--border-subtle);
}

thead {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
}

thead th {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    text-align: left;
    padding: 0.75rem 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

tbody th {
    position: sticky;
    inset-inline-start: 0;
    z-index: 1;
    background: var(--bg-surface);
    color: var(--accent-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-right: 1px solid var(--border-subtle);
}

td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

tr:hover td,
tr:hover tbody th {
    background: #17223b;
}

/* ==============================================================================
   MODALES (QR Y CONFIGURACIÓN)
============================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    position: relative;
}

.modal-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.qr-box {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem auto 1.5rem;
    width: 280px;
    height: 280px;
}

.qr-img-render {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    transition: var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan-glow);
}

/* ==============================================================================
   FOOTER GLOBAL
============================================================================== */
.app-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* ==============================================================================
   RESPONSIVIDAD Y MÓVIL (MOBILE-FIRST)
============================================================================== */
@media (max-width: 768px) {
    .charts-bento-grid {
        grid-template-columns: 1fr;
    }
    .chart-card.col-span-2 {
        grid-column: span 1;
    }
    .survey-card {
        padding: 1.25rem;
        min-height: auto;
    }
    .question-title {
        font-size: 1.15rem;
    }
    .header-titles p {
        display: none;
    }
}

/* ==============================================================================
   PANTALLA DE LOGIN DE INVESTIGADOR (ADMIN)
============================================================================== */
.admin-login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
    padding: 2rem 1rem;
}

.admin-login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-bright);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px var(--accent-cyan-glow);
    border-radius: var(--radius-lg);
    max-width: 440px;
    width: 100%;
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.admin-login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
}

.admin-login-icon {
    width: 54px;
    height: 54px;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 50%;
    color: var(--accent-cyan);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.admin-login-card h2 {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.admin-login-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    line-height: 1.45;
}

.admin-login-form {
    text-align: left;
}

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

.input-with-icon > i:first-child {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon .form-input {
    padding-left: 2.8rem;
    padding-right: 2.8rem;
    width: 100%;
}

.btn-toggle-pass {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.btn-toggle-pass:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.login-error-msg {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fb7185;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

.admin-login-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.btn-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.btn-link:hover {
    color: var(--accent-cyan);
}
