/* =========================================================
   DengueCare - Estilos Principales
   Basado en algoritmos OPS/PAHO 2024
   ========================================================= */

/* --- Variables y Tema — Modo Claro (default) --- */
:root,
[data-theme="light"] {
  /* Fondos */
  --color-bg: #ffffff;
  --color-bg-2: #fdf5f5;
  --color-surface: #ffffff;
  --color-surface-2: #fdf5f5;
  --color-surface-3: #faeaea;
  --color-border: rgba(180, 30, 30, 0.12);
  --color-border-hover: rgba(180, 30, 30, 0.28);

  /* Texto */
  --color-text: #1a0505;
  --color-text-muted: #6b3030;
  --color-text-dim: #b07070;

  /* Acento principal — rojo médico */
  --color-accent: #c0182a;
  --color-accent-dark: #8f0f1e;
  --color-accent-glow: rgba(192, 24, 42, 0.08);

  /* Semáforo clínico */
  --color-green: #1a7a3c;
  --color-green-bg: rgba(26, 122, 60, 0.07);
  --color-green-border: rgba(26, 122, 60, 0.25);
  --color-green-glow: rgba(26, 122, 60, 0.15);

  --color-yellow: #b06000;
  --color-yellow-bg: rgba(176, 96, 0, 0.07);
  --color-yellow-border: rgba(176, 96, 0, 0.25);
  --color-yellow-glow: rgba(176, 96, 0, 0.15);

  --color-red: #c0182a;
  --color-red-bg: rgba(192, 24, 42, 0.06);
  --color-red-border: rgba(192, 24, 42, 0.22);
  --color-red-glow: rgba(192, 24, 42, 0.15);

  --color-orange: #c04a00;
  --color-orange-bg: rgba(192, 74, 0, 0.07);

  /* Tipografía */
  --font-display: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Espaciado */
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 20px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;

  /* Sombras — suaves sobre blanco */
  --shadow-sm: 0 2px 8px rgba(192,24,42,0.08);
  --shadow-md: 0 4px 20px rgba(192,24,42,0.10);
  --shadow-lg: 0 8px 40px rgba(192,24,42,0.12);
  --shadow-accent: 0 0 30px rgba(192,24,42,0.10);

  /* Transiciones */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Modo Oscuro --- */
[data-theme="dark"] {
  --color-bg: #0d0d14;
  --color-bg-2: #111118;
  --color-surface: #16161f;
  --color-surface-2: #1c1c28;
  --color-surface-3: #222232;
  --color-border: rgba(192, 24, 42, 0.18);
  --color-border-hover: rgba(192, 24, 42, 0.38);

  --color-text: #f0e8e8;
  --color-text-muted: #b89090;
  --color-text-dim: #6b4040;

  --color-accent: #e8334a;
  --color-accent-dark: #c0182a;
  --color-accent-glow: rgba(232, 51, 74, 0.12);

  --color-green: #3dba70;
  --color-green-bg: rgba(61, 186, 112, 0.10);
  --color-green-border: rgba(61, 186, 112, 0.30);
  --color-green-glow: rgba(61, 186, 112, 0.18);

  --color-yellow: #e09030;
  --color-yellow-bg: rgba(224, 144, 48, 0.10);
  --color-yellow-border: rgba(224, 144, 48, 0.30);
  --color-yellow-glow: rgba(224, 144, 48, 0.18);

  --color-red: #e8334a;
  --color-red-bg: rgba(232, 51, 74, 0.10);
  --color-red-border: rgba(232, 51, 74, 0.30);
  --color-red-glow: rgba(232, 51, 74, 0.18);

  --color-orange: #e06020;
  --color-orange-bg: rgba(224, 96, 32, 0.10);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.30);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.40);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.50);
  --shadow-accent: 0 0 30px rgba(232,51,74,0.20);
}

/* Dark mode body background override */
[data-theme="dark"] body {
  background-color: var(--color-bg);
  color: var(--color-text);
}
[data-theme="dark"] body::before {
  opacity: 0.04;
}

/* --- Reset & Base --- */
*, *::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-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Tipografía --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* --- Fondo con patrón suave --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(192,24,42,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(192,24,42,0.03) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c0182a' fill-opacity='0.025'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* --- Layout Principal --- */
.app-wrapper { position: relative; z-index: 1; }

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-accent), #8f0f1e);
  box-shadow: 0 0 20px rgba(192,24,42,0.25);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.logo-text span { color: var(--color-accent); }

.header-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  letter-spacing: 0.05em;
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 60px;
  text-align: center;
  position: relative;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-glow);
  border: 1px solid rgba(192,24,42,0.2);
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 28px;
  animation: fadeInDown 0.8s ease both;
}

.hero-kicker::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-title .accent { color: var(--color-accent); }
.hero-title .highlight {
  background: linear-gradient(135deg, #c0182a, #8f0f1e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.7;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-source {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-text-dim);
  margin-bottom: 56px;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-source a {
  color: var(--color-accent);
  text-decoration: none;
  opacity: 0.7;
}

/* --- Selector de Perfil --- */
.profile-selector {
  width: 100%;
  max-width: 760px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.profile-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.profile-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: var(--transition);
  border-radius: var(--radius-xl);
}

.profile-card.medical::before {
  background: radial-gradient(circle at 30% 30%, rgba(192,24,42,0.08) 0%, transparent 70%);
}

.profile-card.patient::before {
  background: radial-gradient(circle at 30% 30%, rgba(143,15,30,0.07) 0%, transparent 70%);
}

.profile-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.profile-card.medical:hover {
  border-color: rgba(192,24,42,0.35);
  box-shadow: 0 20px 60px rgba(192,24,42,0.10);
}

.profile-card.patient:hover {
  border-color: rgba(143,15,30,0.30);
  box-shadow: 0 20px 60px rgba(143,15,30,0.09);
}

.profile-card:hover::before { opacity: 1; }

.profile-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 24px;
  position: relative;
}

.medical .profile-icon {
  background: rgba(192,24,42,0.08);
  border: 1px solid rgba(192,24,42,0.18);
}

.patient .profile-icon {
  background: rgba(143,15,30,0.07);
  border: 1px solid rgba(143,15,30,0.16);
}

.profile-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.medical .profile-label { color: var(--color-accent); }
.patient .profile-label { color: var(--color-accent-dark); }

.profile-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.2;
}

.profile-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.profile-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.profile-features li {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-features li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

.medical .profile-features li::before { background: var(--color-accent); }
.patient .profile-features li::before { background: var(--color-accent-dark); }

.profile-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  transition: var(--transition);
}

.medical .profile-cta {
  background: rgba(192,24,42,0.08);
  color: var(--color-accent);
  border: 1px solid rgba(192,24,42,0.18);
}

.patient .profile-cta {
  background: rgba(143,15,30,0.07);
  color: var(--color-accent-dark);
  border: 1px solid rgba(143,15,30,0.16);
}

.profile-card:hover .profile-cta {
  background: rgba(192,24,42,0.12);
}

/* --- Sección de Flujo --- */
.flow-section {
  display: none;
  min-height: 100vh;
  padding: 80px 20px 60px;
}

.flow-section.active { display: block; }

.flow-container {
  max-width: 800px;
  margin: 0 auto;
}

/* --- Header del Flujo --- */
.flow-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.flow-back-btn {
  width: 40px;
  height: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--color-text-muted);
  font-size: 18px;
  flex-shrink: 0;
}

.flow-back-btn:hover {
  background: var(--color-surface-2);
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.flow-title-group { flex: 1; }

.flow-mode-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 4px;
  display: inline-block;
}

.mode-medical .flow-mode-badge {
  color: var(--color-accent);
  background: var(--color-accent-glow);
  border: 1px solid rgba(192,24,42,0.2);
}

.mode-patient .flow-mode-badge {
  color: var(--color-accent-dark);
  background: rgba(143,15,30,0.07);
  border: 1px solid rgba(143,15,30,0.18);
}

.flow-main-title {
  font-size: 1.5rem;
  color: var(--color-text);
}

/* --- Progress Bar --- */
.progress-bar-wrapper {
  margin-bottom: 40px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-step-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.progress-pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent);
}

.progress-track {
  height: 3px;
  background: var(--color-surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), #8f0f1e);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* --- Tarjeta de Pregunta --- */
.question-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  margin-bottom: 24px;
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.question-card.exit { animation: slideOutLeft 0.3s ease both; }

.question-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.question-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
  color: var(--color-text);
}

.question-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* --- Opciones de Respuesta --- */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.options-grid.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.option-btn {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.option-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: var(--transition);
}

.option-btn:hover {
  background: var(--color-surface-3);
  border-color: var(--color-border-hover);
  transform: translateX(4px);
}

.option-btn.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-glow);
}

.option-btn.selected::before { background: var(--color-accent); }

.option-btn.danger:hover, .option-btn.danger.selected {
  border-color: var(--color-red);
  background: var(--color-red-bg);
}
.option-btn.danger.selected::before { background: var(--color-red); }

.option-btn.warning:hover, .option-btn.warning.selected {
  border-color: var(--color-yellow);
  background: var(--color-yellow-bg);
}
.option-btn.warning.selected::before { background: var(--color-yellow); }

.option-btn.success:hover, .option-btn.success.selected {
  border-color: var(--color-green);
  background: var(--color-green-bg);
}
.option-btn.success.selected::before { background: var(--color-green); }

.option-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--color-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.option-label { flex: 1; }
.option-title { font-weight: 500; margin-bottom: 2px; }
.option-sub {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* --- Checkbox Multi-select --- */
.checkbox-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.checkbox-item:hover {
  background: var(--color-surface-3);
  border-color: var(--color-border-hover);
}

.checkbox-item.checked {
  border-color: var(--color-accent);
  background: var(--color-accent-glow);
}

.checkbox-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border-hover);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.checkbox-item.checked .checkbox-box {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  font-size: 12px;
}

/* --- Botones de navegación --- */
.nav-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: -0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), #8f0f1e);
  color: #fff;
  box-shadow: 0 4px 20px rgba(192,24,42,0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(192,24,42,0.35);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
  border-color: var(--color-border-hover);
}

/* --- Tarjetas de Alerta clínica --- */
.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid;
  margin-top: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.alert-card.info {
  background: var(--color-accent-glow);
  border-color: rgba(0,196,255,0.2);
  color: var(--color-accent);
}

.alert-card.warning {
  background: var(--color-yellow-bg);
  border-color: var(--color-yellow-border);
  color: var(--color-yellow);
}

.alert-card.danger {
  background: var(--color-red-bg);
  border-color: var(--color-red-border);
  color: var(--color-red);
}

.alert-card.success {
  background: var(--color-green-bg);
  border-color: var(--color-green-border);
  color: var(--color-green);
}

/* --- Panel de Resultado --- */
.result-panel {
  animation: fadeInUp 0.6s ease both;
}

.result-hero {
  text-align: center;
  padding: 48px 32px;
  border-radius: var(--radius-xl);
  border: 1px solid;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.result-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.05;
}

.result-hero.green {
  background: var(--color-green-bg);
  border-color: var(--color-green-border);
  box-shadow: 0 0 60px var(--color-green-glow);
}

.result-hero.green::before { background: var(--color-green); }

.result-hero.yellow {
  background: var(--color-yellow-bg);
  border-color: var(--color-yellow-border);
  box-shadow: 0 0 60px var(--color-yellow-glow);
}

.result-hero.red {
  background: var(--color-red-bg);
  border-color: var(--color-red-border);
  box-shadow: 0 0 60px var(--color-red-glow);
}

.result-icon {
  font-size: 64px;
  margin-bottom: 16px;
  display: block;
  animation: bounceIn 0.6s ease 0.3s both;
}

.result-classification {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 8px;
}

.result-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.result-hero.green .result-title { color: var(--color-green); }
.result-hero.yellow .result-title { color: var(--color-yellow); }
.result-hero.red .result-title { color: var(--color-red); }

.result-subtitle {
  font-size: 1rem;
  opacity: 0.8;
  max-width: 480px;
  margin: 0 auto;
}

/* --- Secciones del resultado --- */
.result-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 16px;
}

.result-section-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-section-title span {
  width: 18px;
  height: 18px;
  background: var(--color-surface-2);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.result-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text);
}

.result-list li::before {
  content: '→';
  color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 0.8rem;
}

.result-list.bullets li::before { content: '•'; }
.result-list.danger li::before { content: '⚠'; color: var(--color-red); }
.result-list.green li::before { content: '✓'; color: var(--color-green); }

/* --- Chips de medicamento --- */
.drug-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.drug-chip {
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid;
}

.drug-chip.ok {
  background: var(--color-green-bg);
  border-color: var(--color-green-border);
  color: var(--color-green);
}

.drug-chip.avoid {
  background: var(--color-red-bg);
  border-color: var(--color-red-border);
  color: var(--color-red);
}

/* --- Resumen Clínico (para médicos) --- */
.clinical-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.clinical-summary-header {
  background: var(--color-surface-2);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}

.clinical-summary-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--color-surface-3);
  color: var(--color-text);
}

.clinical-summary-body {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  white-space: pre-wrap;
}

.clinical-summary-body .label {
  color: var(--color-accent);
  font-weight: 600;
}

/* --- Señales de alarma visual (paciente) --- */
.alarm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.alarm-item {
  background: var(--color-red-bg);
  border: 1px solid var(--color-red-border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.alarm-emoji {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
}

.alarm-text {
  font-size: 0.78rem;
  color: var(--color-red);
  line-height: 1.4;
  font-weight: 500;
}

/* --- Botones de acción final --- */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn-restart {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 12px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-restart:hover {
  background: var(--color-surface-3);
  color: var(--color-text);
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--color-border);
  margin-top: 60px;
}

.footer-text {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

.footer-text a {
  color: var(--color-accent);
  text-decoration: none;
  opacity: 0.7;
}

.footer-disclaimer {
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--color-text-dim);
  opacity: 0.7;
}

/* --- Utilidades --- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* --- Animaciones --- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-40px); }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

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

/* =========================================================
   FORMULARIO DE REGISTRO DE PACIENTE
   ========================================================= */
.patient-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.form-field label .req {
  color: var(--color-accent);
  margin-left: 2px;
}

.form-field input,
.form-field select {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  transition: var(--transition);
  outline: none;
  width: 100%;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--color-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-field input.error,
.form-field select.error {
  border-color: var(--color-red);
  background: var(--color-red-bg);
}

.form-field input::placeholder {
  color: var(--color-text-dim);
  opacity: 0.7;
}

.form-field select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b3030'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}

@media (max-width: 680px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
