/* ==========================================================================
   TEST DE CRIBADO DE ALZHEIMER Y MEMORIA - FIJATE TOOLS
   Estilos visuales, temas claro/oscuro, componentes interactivos e informe impreso
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema oscuro por defecto (corporativo fijate) */
  --bg-app: #080c14;
  --bg-card: #0f172a;
  --bg-card-elevated: #1e293b;
  --bg-input: #131d31;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-focus: #ff8507;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --brand-primary: #ff8507;
  --brand-primary-hover: #e07300;
  --brand-glow: rgba(255, 133, 7, 0.25);

  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.12);
  --color-info: #38bdf8;
  --color-info-bg: rgba(56, 189, 248, 0.12);
  --color-purple: #a855f7;
  --color-purple-bg: rgba(168, 85, 247, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-elevated: #f8fafc;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --border-hover: #94a3b8;
  --border-focus: #ff8507;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --brand-glow: rgba(255, 133, 7, 0.2);

  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-info-bg: rgba(56, 189, 248, 0.1);
  --color-purple-bg: rgba(168, 85, 247, 0.1);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

/* Cabecera de la aplicación */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

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

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-back-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-back-tools:hover {
  background: var(--brand-primary);
  color: #0b0f17 !important;
  border-color: var(--brand-primary);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ff8507 0%, #d946ef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px var(--brand-glow);
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  display: block;
}

.brand-subtitle {
  font-size: 0.775rem;
  color: var(--text-muted);
  display: block;
}

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

.badge-privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: var(--color-success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-success);
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-icon,
.btn-theme-toggle,
.btn-icon-nav {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.btn-icon:hover,
.btn-theme-toggle:hover,
.btn-icon-nav:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
}

/* Layout Principal */
.alzheimer-layout {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
}

/* Aviso médico superior */
.clinical-disclaimer-banner {
  background: var(--color-info-bg);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-main);
}

.clinical-disclaimer-banner svg {
  color: var(--color-info);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.clinical-disclaimer-banner strong {
  color: var(--color-info);
}

/* Contenedor de pasos (Wizard Card) */
.wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

/* Barra de progreso superior del asistente */
.wizard-progress-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card-elevated);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.progress-step-title {
  font-weight: 600;
  color: var(--text-main);
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8507, #d946ef);
  border-radius: 9999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* Contenido de cada paso */
.step-content-pane {
  padding: 2rem 1.75rem;
  display: none;
  animation: fadeInStep 0.3s ease forwards;
}

.step-content-pane.active {
  display: block;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Encabezados de paso */
.step-heading {
  margin-bottom: 1.75rem;
  text-align: center;
}

.step-heading-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--brand-glow);
  color: var(--brand-primary);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.step-heading h2 {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.step-heading p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 680px;
  margin: 0 auto;
}

/* Selector de Modalidad Inicial (Bento Grid) */
.mode-selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

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

.mode-card {
  background: var(--bg-card-elevated);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  text-align: left;
}

.mode-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--brand-glow);
}

.mode-card.selected {
  border-color: var(--brand-primary);
  background: rgba(255, 133, 7, 0.05);
  box-shadow: 0 0 0 1px var(--brand-primary);
}

.mode-card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--brand-primary);
  color: #0b0f17 !important;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
}

.mode-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--brand-glow);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.mode-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.mode-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.mode-features {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.mode-features li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.mode-features li svg {
  color: var(--color-success);
  flex-shrink: 0;
}

/* Opciones complementarias (Checkbox Lancet) */
.extra-options-box {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.extra-options-box input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brand-primary);
  margin-top: 0.2rem;
  cursor: pointer;
}

.extra-options-box label {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-main);
}

.extra-options-box label small {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

/* Tarjetas de Preguntas (AD8 / Lancet / Subjetivas) */
.question-item-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.question-item-card.answered {
  border-color: rgba(16, 185, 129, 0.4);
}

.question-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.question-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-glow);
  color: var(--brand-primary);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.question-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
}

.question-hint {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: normal;
  margin-top: 0.25rem;
}

/* Botones de opción de respuesta (Radio group visual) */
.answer-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.btn-answer-option {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-answer-option:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
}

.btn-answer-option.selected {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #0b0f17 !important;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--brand-glow);
}

/* Fase de Memorización de 3 Palabras */
.word-memory-display {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

@media (max-width: 600px) {
  .word-memory-display {
    grid-template-columns: 1fr;
  }
}

.word-card {
  background: var(--bg-card-elevated);
  border: 2px dashed var(--brand-primary);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1rem;
  text-align: center;
}

.word-card-icon {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.word-card-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  text-transform: uppercase;
}

/* Pestañas de modo del Test del Reloj */
.clock-mode-selector {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-input);
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  max-width: 540px;
  margin: 0 auto 1.5rem;
}

.btn-clock-tab {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.btn-clock-tab:hover {
  color: var(--text-main);
}

.btn-clock-tab.active {
  background: var(--brand-primary);
  color: #0b0f17 !important;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--brand-glow);
}

.clock-tab-pane {
  display: none;
}

.clock-tab-pane.active {
  display: block;
}

/* Visor y Controles del Reloj Interactivo */
.interactive-clock-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.75rem;
  align-items: center;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .interactive-clock-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.live-clock-wrapper {
  width: 260px;
  height: 260px;
  background: #ffffff;
  border: 4px solid var(--border-color);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-clock-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.clock-controls-area {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.clock-picker-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
}

.clock-picker-title {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.clock-picker-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.numbers-grid-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
}

@media (max-width: 480px) {
  .numbers-grid-picker {
    grid-template-columns: repeat(4, 1fr);
  }
}

.btn-num-pick {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.btn-num-pick small {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: normal;
}

.btn-num-pick:hover {
  border-color: var(--brand-primary);
  background: var(--bg-card-elevated);
}

.btn-num-pick.selected {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #0b0f17 !important;
  font-weight: 800;
  box-shadow: 0 2px 8px var(--brand-glow);
}

.btn-num-pick.selected small {
  color: #0b0f17 !important;
  font-weight: 700;
}

.clock-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  align-self: flex-start;
}

/* Canvas del Test del Reloj (Modo dibujo táctil) */
.clock-test-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin: 1rem 0;
}

.clock-canvas-wrapper {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-md);
  position: relative;
  touch-action: none;
  cursor: crosshair;
}

#clock-canvas {
  display: block;
  border-radius: var(--radius-xl);
  background-color: #ffffff;
  touch-action: none;
}

.clock-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-clock-tool {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-clock-tool:hover {
  background: var(--bg-input);
  border-color: var(--border-hover);
}

.clock-checklist {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  width: 100%;
  max-width: 500px;
}

.clock-checklist h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.clock-check-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
}

.clock-check-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-primary);
}

/* Recuerdo diferido de palabras */
.word-recall-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
}

@media (max-width: 600px) {
  .word-recall-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.word-recall-option {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.word-recall-option:hover {
  border-color: var(--border-hover);
}

.word-recall-option.selected {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #0b0f17 !important;
  font-weight: 700;
}

/* Pie de controles del asistente (Wizard Actions) */
.wizard-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card-elevated);
}

.btn-wizard-nav {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-wizard-prev {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-wizard-prev:hover {
  background: var(--bg-card);
  border-color: var(--border-hover);
}

.btn-wizard-next,
.btn-primary-action {
  background: var(--brand-primary);
  color: #0b0f17 !important;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--brand-glow);
}

.btn-wizard-next:hover,
.btn-primary-action:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
}

.btn-wizard-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   VISTA DE RESULTADOS E INFORME CLÍNICO
   ========================================================================== */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-hero-card {
  background: var(--bg-card-elevated);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  border: 2px solid var(--border-color);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.result-hero-card.level-low {
  border-color: var(--color-success);
  background: linear-gradient(180deg, var(--color-success-bg) 0%, var(--bg-card-elevated) 100%);
}

.result-hero-card.level-moderate {
  border-color: var(--color-warning);
  background: linear-gradient(180deg, var(--color-warning-bg) 0%, var(--bg-card-elevated) 100%);
}

.result-hero-card.level-high {
  border-color: var(--color-danger);
  background: linear-gradient(180deg, var(--color-danger-bg) 0%, var(--bg-card-elevated) 100%);
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.result-hero-card.level-low .result-badge {
  background: var(--color-success);
  color: #ffffff;
}

.result-hero-card.level-moderate .result-badge {
  background: var(--color-warning);
  color: #0b0f17;
}

.result-hero-card.level-high .result-badge {
  background: var(--color-danger);
  color: #ffffff;
}

.result-hero-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.result-hero-summary {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 1.25rem;
  line-height: 1.55;
}

/* Desglose de Dominios Cognitivos */
.domains-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.domain-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.domain-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.domain-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-main);
}

.domain-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

.domain-status.status-ok {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.domain-status.status-alert {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.domain-status.status-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.domain-bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 9999px;
  overflow: hidden;
  margin: 0.4rem 0;
}

.domain-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

.domain-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Señales de alarma y guía para el médico */
.alert-items-section,
.doctor-guide-section {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-list,
.doctor-questions-list {
  list-style: none;
}

.alert-list li,
.doctor-questions-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.alert-list li::before {
  content: "⚠️";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.85rem;
}

.doctor-questions-list li::before {
  content: "💬";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.85rem;
}

/* Botones de acción del informe */
.report-actions-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.btn-secondary-action {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover {
  background: var(--bg-input);
  border-color: var(--border-hover);
}

/* Modales accesibles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

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

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.25s ease forwards;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.modal-body {
  padding: 1.5rem;
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   ESTILOS DE IMPRESIÓN DEL INFORME MÉDICO (@media print)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 11pt !important;
  }

  .app-header,
  .fijate-footer,
  .btn-wizard-nav,
  .report-actions-bar,
  .clinical-disclaimer-banner,
  .wizard-progress-header,
  .btn-clock-tool,
  .btn-back-tools,
  .header-actions {
    display: none !important;
  }

  .alzheimer-layout {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .wizard-card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .step-content-pane {
    display: none !important;
  }

  .step-content-pane#step-results {
    display: block !important;
    padding: 0 !important;
  }

  .result-hero-card {
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    padding: 1.25rem !important;
    page-break-inside: avoid;
  }

  .result-hero-title {
    color: #0f172a !important;
    font-size: 16pt !important;
  }

  .result-hero-summary {
    color: #334155 !important;
  }

  .domains-breakdown-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
    page-break-inside: avoid;
  }

  .domain-card,
  .alert-items-section,
  .doctor-guide-section {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    page-break-inside: avoid;
  }

  .section-title {
    color: #0f172a !important;
    font-size: 12pt !important;
  }

  .alert-list li,
  .doctor-questions-list li {
    color: #334155 !important;
  }

  /* Encabezado formal impreso */
  .print-header {
    display: block !important;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .print-header h1 {
    font-size: 18pt;
    font-weight: bold;
    color: #0f172a;
  }

  .print-header p {
    font-size: 9pt;
    color: #64748b;
  }
}

.print-header {
  display: none;
}
