/**
 * ENAE MASTER PERÚ — DESIGN SYSTEM & UI ARCHITECTURE (v3.0)
 * Built with user:frontend-ui-engineering (Addy Osmani Agent Skills)
 * Aesthetic: Clinical Editorial Precision (AMBOSS / UWorld / Linear Medical Reference)
 * Compliance: WCAG 2.1 AA+, Tabular Numerals, 4px Token Grid, Semantic Light/Dark Themes
 */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: local('Plus Jakarta Sans'), local('PlusJakartaSans-Regular'), url('../fonts/PlusJakartaSans-Variable.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: local('Space Grotesk'), local('SpaceGrotesk-Bold'), url('../fonts/SpaceGrotesk-Variable.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: local('JetBrains Mono'), local('JetBrainsMono-Regular'), url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root,
[data-theme="light"] {
  /* Surface Hierarchy — Crisp Clinical Daylight (Default) */
  --bg-canvas: #F8FAFC;
  --bg-primary: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-secondary: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --bg-subtle: #F1F5F9;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-inverse: #0F172A;

  /* Typography Hierarchy — WCAG AAA/AA Verified */
  --text-primary: #0F172A;     /* 15.8:1 on #FFFFFF */
  --text-secondary: #334155;   /* 9.3:1 on #FFFFFF */
  --text-muted: #475569;       /* 7.0:1 on #FFFFFF */
  --text-on-brand: #FFFFFF;

  /* Brand & Clinical Semantic Tokens */
  --brand-primary: #0F766E;        /* Turquesa Enfermería Peruana (CEP) */
  --brand-primary-hover: #115E59;
  --brand-primary-soft: #F0FDFA;
  --brand-primary-border: #99F6E4;

  --accent-emerald: #059669;       /* Clave Correcta / Dominio Óptimo */
  --accent-emerald-soft: #ECFDF5;
  --accent-emerald-border: #A7F3D0;

  --accent-cyan: #0284C7;          /* Norma Técnica MINSA / Info Clínica */
  --accent-cyan-soft: #F0F9FF;
  --accent-cyan-border: #BAE6FD;

  --accent-amber: #B45309;         /* Alerta Normativa / Prioridad Repaso */
  --accent-amber-soft: #FFFBEB;
  --accent-amber-border: #FDE68A;

  --accent-coral: #DC2626;         /* Error Clínico / Contraindicación */
  --accent-coral-soft: #FEF2F2;
  --accent-coral-border: #FECACA;

  --accent-yape: #742384;          /* Yape Oficial Perú */
  --accent-yape-soft: #FAF5FF;
  --accent-yape-border: #E9D5FF;

  /* Borders & Dividers */
  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;
  --border-focus: #0F766E;

  /* Elevation — Crisp Architectural Shadows (Zero Neon Glow) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.10), 0 4px 8px -2px rgba(15, 23, 42, 0.05);

  /* 4px Spacing Scale */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */

  /* Border Radius Scale */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-canvas: #0B1120;
  --bg-primary: #0B1120;
  --bg-surface: #111827;
  --bg-secondary: #111827;
  --bg-elevated: #1E293B;
  --bg-subtle: #1E293B;
  --bg-glass: rgba(17, 24, 39, 0.92);
  --bg-inverse: #F8FAFC;

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-on-brand: #FFFFFF;

  --brand-primary: #14B8A6;
  --brand-primary-hover: #0D9488;
  --brand-primary-soft: rgba(20, 184, 166, 0.12);
  --brand-primary-border: rgba(20, 184, 166, 0.35);

  --accent-emerald: #10B981;
  --accent-emerald-soft: rgba(16, 185, 129, 0.12);
  --accent-emerald-border: rgba(16, 185, 129, 0.35);

  --accent-cyan: #38BDF8;
  --accent-cyan-soft: rgba(56, 189, 248, 0.12);
  --accent-cyan-border: rgba(56, 189, 248, 0.35);

  --accent-amber: #F59E0B;
  --accent-amber-soft: rgba(245, 158, 11, 0.12);
  --accent-amber-border: rgba(245, 158, 11, 0.35);

  --accent-coral: #F87171;
  --accent-coral-soft: rgba(248, 113, 113, 0.12);
  --accent-coral-border: rgba(248, 113, 113, 0.35);

  --accent-yape: #A855F7;
  --accent-yape-soft: rgba(168, 85, 247, 0.15);
  --accent-yape-border: rgba(168, 85, 247, 0.4);

  --border-subtle: #1E293B;
  --border-strong: #334155;
  --border-focus: #14B8A6;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   BASE RESET & ACCESSIBILITY GUARDRAILS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--brand-primary);
  color: #FFFFFF;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 700;
  z-index: 9999;
  transition: top 0.15s ease-out;
}
.skip-link:focus {
  top: var(--space-3);
}

/* Keyboard Focus Visibility (Rule 2 of frontend-ui-engineering) */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease-out, background-color 0.15s ease-out, border-color 0.15s ease-out;
}

img, video, svg, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Tabular Numbers for Timers, Scores, Metrics, and Prices */
.tabular-nums,
.timer-box,
.stat-val,
.q-cell,
.price-amount,
code,
pre,
.data-table td {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   LAYOUT CONTAINERS & GRID SYSTEM
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-compact {
  padding: var(--space-8) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
}

.stack-sm > * + * { margin-top: var(--space-2); }
.stack-md > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.flex-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ==========================================================================
   TYPOGRAPHY HIERARCHY
   ========================================================================== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-primary);
  background: var(--brand-primary-soft);
  border: 1px solid var(--brand-primary-border);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.eyebrow.amber {
  color: var(--accent-amber);
  background: var(--accent-amber-soft);
  border-color: var(--accent-amber-border);
}

.eyebrow.cyan {
  color: var(--accent-cyan);
  background: var(--accent-cyan-soft);
  border-color: var(--accent-cyan-border);
}

.eyebrow.yape {
  color: var(--accent-yape);
  background: var(--accent-yape-soft);
  border-color: var(--accent-yape-border);
}

.h1-hero {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw + 0.5rem, 3.1rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.h1-hero .highlight {
  color: var(--brand-primary);
}

.h2-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.2vw + 0.4rem, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.h3-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 65ch;
  line-height: 1.65;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* ==========================================================================
   INSTITUTIONAL TOP BAR & NAVIGATION HEADER
   ========================================================================== */
.top-utility-bar {
  background: var(--bg-inverse);
  color: #F8FAFC;
  font-size: 0.78rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-utility-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.utility-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #CBD5E1;
}

.utility-meta strong {
  color: #FFFFFF;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.03em;
}

.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.nav-link.active {
  color: var(--brand-primary);
  background: var(--brand-primary-soft);
  font-weight: 700;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.mobile-nav-toggle { display: none; }
.nav-panel { display: contents; }

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  min-height: 40px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.role-pill:hover {
  border-color: var(--brand-primary);
  color: var(--text-primary);
}

.role-pill.is-premium {
  border-color: var(--accent-emerald-border);
  color: var(--accent-emerald);
  background: var(--accent-emerald-soft);
}

/* ==========================================================================
   BUTTONS & INTERACTIVE CONTROLS (44px Min Touch Target)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1.125rem;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out, transform 0.1s ease-out;
  text-align: center;
  line-height: 1.2;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-amber {
  background: var(--accent-amber);
  color: #FFFFFF;
  border-color: var(--accent-amber);
}

.btn-amber:hover {
  filter: brightness(0.95);
}

.btn-yape {
  background: var(--accent-yape);
  color: #FFFFFF;
  border-color: var(--accent-yape);
}

.btn-yape:hover {
  filter: brightness(1.08);
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

/* ==========================================================================
   CARDS, SURFACES & BADGES
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-elevated {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.card-subtle {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-3);
}

.card-badge.teal {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  border-color: var(--brand-primary-border);
}

.card-badge.amber {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border-color: var(--accent-amber-border);
}

.card-badge.yape {
  background: var(--accent-yape-soft);
  color: var(--accent-yape);
  border-color: var(--accent-yape-border);
}

.spec-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  min-height: 34px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.spec-chip:hover {
  border-color: var(--brand-primary);
  color: var(--text-primary);
}

.spec-chip.active {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  border-color: var(--brand-primary-border);
  font-weight: 700;
}

/* ==========================================================================
   HERO WORKSPACE & CLINICAL MONITOR
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: var(--space-8);
  align-items: start;
  padding: var(--space-10) 0 var(--space-8);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.stat-item {
  padding-right: var(--space-4);
  border-right: 1px solid var(--border-subtle);
}

.stat-item:last-child {
  border-right: none;
  padding-right: 0;
}

.stat-val {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-lbl {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.clinical-stage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  isolation: isolate;
}

.clinical-stage-card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-primary) 0 32%, var(--accent-cyan) 32% 66%, var(--accent-amber) 66% 100%);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.045em;
}

.stage-body {
  padding: var(--space-4);
}

.stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   SIMULACRO & QUESTION WORKSPACE (CLINICAL EXAM INTERFACE)
   ========================================================================== */
.exam-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.exam-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: sticky;
  top: 84px;
  box-shadow: var(--shadow-xs);
}

.timer-box {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-align: center;
  padding: var(--space-3);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
  letter-spacing: 0.04em;
}

.timer-box.warning {
  color: var(--accent-coral);
  background: var(--accent-coral-soft);
  border-color: var(--accent-coral-border);
}

.q-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.375rem;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.q-cell {
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.12s ease-out;
}

.q-cell:hover {
  border-color: var(--brand-primary);
  color: var(--text-primary);
}

.q-cell.current {
  border: 2px solid var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-primary-soft);
  font-weight: 800;
}

.q-cell.answered {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

.q-cell.flagged {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

.q-cell.correct {
  background: var(--accent-emerald);
  color: #FFFFFF;
  border-color: var(--accent-emerald);
}

.q-cell.wrong {
  background: var(--accent-coral);
  color: #FFFFFF;
  border-color: var(--accent-coral);
}

.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
}

.q-stem {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.6;
  margin: var(--space-4) 0 var(--space-5);
  color: var(--text-primary);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.12s ease-out, border-color 0.12s ease-out;
  font-size: 0.95rem;
  line-height: 1.5;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--brand-primary);
  background: var(--bg-subtle);
}

.option-btn.selected {
  border-color: var(--brand-primary);
  border-width: 2px;
  background: var(--brand-primary-soft);
}

.option-btn.correct {
  border-color: var(--accent-emerald);
  border-width: 2px;
  background: var(--accent-emerald-soft);
}

.option-btn.wrong {
  border-color: var(--accent-coral);
  border-width: 2px;
  background: var(--accent-coral-soft);
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.option-btn.selected .option-letter {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

.option-btn.correct .option-letter {
  background: var(--accent-emerald);
  color: #FFFFFF;
  border-color: var(--accent-emerald);
}

.option-btn.wrong .option-letter {
  background: var(--accent-coral);
  color: #FFFFFF;
  border-color: var(--accent-coral);
}

.feedback-panel {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-emerald);
  background: var(--accent-emerald-soft);
  border-top: 1px solid var(--accent-emerald-border);
  border-right: 1px solid var(--accent-emerald-border);
  border-bottom: 1px solid var(--accent-emerald-border);
}

.feedback-panel.wrong {
  border-left-color: var(--accent-coral);
  background: var(--accent-coral-soft);
  border-top-color: var(--accent-coral-border);
  border-right-color: var(--accent-coral-border);
  border-bottom-color: var(--accent-coral-border);
}

/* ==========================================================================
   FORMS, INPUTS & TABLES
   ========================================================================== */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.input-field,
.select-field {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}

.input-field:focus,
.select-field:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-subtle);
}

/* ==========================================================================
   PRICING CARDS & YAPE QR SHOWCASE
   ========================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
  align-items: stretch;
}

.pricing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.pricing-card.featured {
  border: 2px solid var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.popular-ribbon {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--brand-primary);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: var(--space-2) 0;
  line-height: 1.1;
}

.price-amount span {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.feature-list {
  list-style: none;
  margin: var(--space-4) 0 var(--space-6);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.feature-list li::before {
  content: "✓";
  color: var(--accent-emerald);
  font-weight: 800;
  flex-shrink: 0;
}

.feature-list li.disabled {
  color: var(--text-muted);
  text-decoration: line-through;
}

.feature-list li.disabled::before {
  content: "—";
  color: var(--text-muted);
}

/* ==========================================================================
   MODAL DIALOG (ACCESSIBLE FOCUS-MANAGED OVERLAY)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  z-index: 200;
  padding: var(--space-4);
  overflow-y: auto;
}

.modal-backdrop.open {
  display: grid;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

/* ==========================================================================
   FOOTER & FLOATING CONTACT BAR
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-12) 0 var(--space-8);
  margin-top: var(--space-12);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.floating-contact-bar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 95;
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* ==========================================================================
   REDUCED MOTION & PRINT MEDIA
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1080px) {
  .hero-grid,
  .exam-layout,
  .pricing-grid,
  .grid-4,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .exam-sidebar {
    position: static;
  }
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav-inner { flex-wrap: wrap; padding-top: var(--space-2); padding-bottom: var(--space-2); }
  .nav-panel { display: flex; flex: 1 0 100%; flex-direction: column; align-items: stretch; gap: var(--space-2); }
  .nav-links { justify-content: center; }
  .nav-actions { justify-content: center; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 76px; }
  .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .nav-inner { min-height: 62px; flex-wrap: nowrap; justify-content: space-between; }
  .brand { min-width: 0; font-size: 0.96rem; }
  .brand-sub { font-size: 0.58rem; letter-spacing: 0.02em; }
  .brand-mark { width: 34px; height: 34px; }
  .mobile-nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    min-height: 44px; padding: 0 0.8rem; border: 1px solid var(--border-strong);
    border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary);
    font-size: 0.84rem; font-weight: 700; cursor: pointer;
  }
  .nav-panel {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 110;
    padding: 0.75rem 16px 1rem; background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md); max-height: calc(100dvh - 62px); overflow-y: auto;
  }
  .nav-panel.is-open { display: flex; }
  .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; width: 100%; }
  .nav-link { min-height: 44px; padding: 0.55rem 0.65rem; font-size: 0.84rem; }
  .nav-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 0.5rem; }
  .nav-actions .role-pill { min-height: 44px; justify-content: center; padding: 0.45rem 0.55rem; font-size: 0.68rem; }
  .nav-actions .role-pill:last-child { grid-column: 1 / -1; }
  .section { padding: 2.25rem 0; }
  .hero-grid { gap: 1.5rem; padding: 1rem 0 0.5rem; }
  .h1-hero { font-size: clamp(2.2rem, 10vw, 3.4rem); line-height: 1.04; letter-spacing: -0.055em; }
  .h2-title { font-size: clamp(1.55rem, 7vw, 2.2rem); line-height: 1.14; }
  .lead { font-size: 1rem; }
  .privacy-shield-bar { align-items: flex-start; font-size: 0.72rem; }
  .privacy-shield-bar > .flex-row { width: 100%; }
  .stats-strip { gap: 0; padding: 1rem; }
  .stat-item { padding: 0.8rem 0; }
  .stat-val { font-size: 1.45rem; }
  .bento-grid { grid-template-columns: minmax(0, 1fr); }
  .bento-8, .bento-7, .bento-6, .bento-5, .bento-4, .bento-12 { grid-column: 1; }
  .stage-header, .stage-footer { align-items: flex-start; flex-direction: column; gap: 0.25rem; font-size: 0.68rem; }
  .stage-body { padding: 0.9rem; }
  .stage-body > .flex-between { align-items: flex-start; flex-direction: column; }
  .stage-body .flex-row { gap: 0.4rem; }
  .stage-body .spec-chip { min-height: 40px; }
  .btn-sm, .spec-chip { min-height: 44px; }
  .clinical-stage-card .card-subtle { grid-template-columns: 1fr !important; }
  .clinical-stage-card .qr-interactive-box { max-width: 190px; margin-inline: auto; }
  .option-btn { min-height: 52px; padding: 0.8rem; }
  .exam-layout { grid-template-columns: minmax(0, 1fr); }
  .exam-sidebar { position: static; padding: 1rem; }
  .q-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); max-height: 170px; }
  .q-cell { min-height: 44px; }
  .question-card { padding: 1rem; }
  .question-card > .flex-between { align-items: flex-start; flex-direction: column; }
  .question-card .flex-row { width: 100%; }
  .question-card .flex-between:last-child { align-items: stretch; }
  .question-card .flex-between:last-child .flex-row { display: grid; grid-template-columns: 1fr 1fr; }
  .question-card #btn-flag-question { grid-column: 1 / -1; grid-row: 1; }
  .question-card #btn-prev-q { grid-column: 1; }
  .question-card #btn-next-q { grid-column: 2; }
  .question-card #sim-norma-hint { overflow-wrap: anywhere; }
  .flex-row > .btn, .flex-between > .btn { max-width: 100%; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal-card { width: 100%; max-height: 92dvh; overflow-y: auto; padding: 1.15rem; border-radius: 18px 18px 0 0; padding-bottom: calc(1.15rem + env(safe-area-inset-bottom)); }
  .site-footer { padding: 2.5rem 0 2rem; }
  .footer-grid { gap: 1.75rem; }
  .top-utility-inner, .utility-meta { align-items: flex-start; flex-direction: column; gap: 0.45rem; }
  .floating-contact-bar { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); gap: 0.4rem; }
  .floating-contact-bar .privacy-pill { display: none; }
  .floating-contact-bar .btn { flex: 1; padding-inline: 0.45rem; font-size: 0.7rem; }
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-4);
  }
  .grid-2,
  .grid-3,
  .stats-strip {
    grid-template-columns: 1fr;
  }
  .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-3);
  }
  .stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .floating-contact-bar {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    justify-content: space-between;
  }
  .card, .bento-card, .pricing-card { padding: 1rem; }
  .pricing-card { min-width: 0; }
  .data-table { min-width: 620px; }
  .btn { max-width: 100%; white-space: normal; }
  .qr-interactive-box { width: min(100%, 220px); }
  input, select, textarea { font-size: 16px !important; }
  video { max-height: 56vw; }
}

@media print {
  .site-header,
  .top-utility-bar,
  .exam-sidebar,
  .no-print,
  .floating-contact-bar {
    display: none !important;
  }
  body {
    background: #FFFFFF;
    color: #000000;
  }
  .card,
  .question-card {
    border: 1px solid #CBD5E1;
    box-shadow: none;
    break-inside: avoid;
  }
}


/* ==========================================================================
   AWWWARDS SOTD v4.0 — EDITORIAL BENTO, FIRST-CONTACT AUTH & CULQI PASARELA
   ========================================================================== */
.serif-italic {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--brand-primary);
}

.awwwards-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 4px var(--accent-emerald-soft);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-5);
}

.bento-8 { grid-column: span 8; }
.bento-7 { grid-column: span 7; }
.bento-6 { grid-column: span 6; }
.bento-5 { grid-column: span 5; }
.bento-4 { grid-column: span 4; }
.bento-12 { grid-column: span 12; }

.bento-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
}

.bento-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.bento-card.dark-editorial {
  background: #0F172A;
  color: #F8FAFC;
  border-color: #1E293B;
}

.bento-card.dark-editorial .text-muted {
  color: #CBD5E1;
}

.bento-card.dark-editorial .h3-title,
.bento-card.dark-editorial .h2-title {
  color: #FFFFFF;
}

/* Social & Phone First-Contact Auth Buttons */
.auth-provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 46px;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.btn-social:hover {
  border-color: var(--brand-primary);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.divider-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  margin: var(--space-4) 0;
}

.divider-label::before,
.divider-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Interactive QR Trigger Card */
.qr-interactive-box {
  background: #FFFFFF;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 2px solid var(--accent-yape);
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
  display: block;
}

.qr-interactive-box:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.culqi-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #00A19B;
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
}

@media (max-width: 1024px) {
  .bento-8, .bento-7, .bento-6, .bento-5, .bento-4 {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .auth-provider-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   AWWWARDS SOTD v5.0 — PRIVACY SHIELD, AUTO-RENEW SWITCH, BAJA & TRIAGE WHEEL
   ========================================================================== */
.privacy-shield-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  background: var(--brand-primary-soft);
  border: 1px solid var(--brand-primary-border);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--brand-primary);
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.privacy-pill.rec-off {
  color: var(--accent-emerald);
  border-color: var(--accent-emerald-border);
  background: var(--accent-emerald-soft);
}

/* Toggle Switch for Auto-Renewal & Session Recording */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-strong);
  transition: 0.2s ease-out;
  border-radius: 999px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  transition: 0.2s ease-out;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--brand-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Unconventional Awwwards Interactive Clinical Triage & Glasgow Matrix */
.triage-matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.triage-btn {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.triage-btn.active {
  border-color: var(--brand-primary);
  border-width: 2px;
  background: var(--brand-primary-soft);
}

.postal-box {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border-left: 4px solid var(--brand-primary);
  font-size: 0.84rem;
}

@media (max-width: 768px) {
  .triage-matrix-grid {
    grid-template-columns: 1fr;
  }
}
