/* ==========================================================================
   Enciclopedia y herramientas de donación de sangre y hemodonación
   Estilos corporativos canónicos con soporte integral de tema claro y oscuro
   ========================================================================== */

:root {
  --blood-red: #e11d48;
  --blood-red-hover: #f43f5e;
  --blood-light: rgba(225, 29, 72, 0.15);
  --blood-border: rgba(225, 29, 72, 0.35);
  --blood-glow: rgba(225, 29, 72, 0.25);

  --plasma-amber: #f59e0b;
  --plasma-light: rgba(245, 158, 11, 0.15);
  --plasma-border: rgba(245, 158, 11, 0.35);

  --platelet-cyan: #06b6d4;
  --platelet-light: rgba(6, 182, 212, 0.15);
  --platelet-border: rgba(6, 182, 212, 0.35);

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', var(--font-main);
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema oscuro por defecto (Midnight Slate corporativo Fijate) */
  --bg-page: #0b0f17;
  --bg-card: #111827;
  --bg-card-subtle: #182234;
  --border-card: #1f2937;
  --border-subtle: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --input-bg: #1e293b;
  --input-border: #334155;
  --tab-bg: #1e293b;
  --tab-hover: #334155;
  --hero-gradient: linear-gradient(135deg, rgba(225, 29, 72, 0.18) 0%, rgba(245, 158, 11, 0.08) 50%, rgba(6, 182, 212, 0.08) 100%);
  --cta-gradient: linear-gradient(135deg, rgba(225, 29, 72, 0.16) 0%, rgba(244, 63, 94, 0.08) 100%);
  --toggle-group-bg: #0f172a;
  --toggle-btn-selected: #334155;
}

/* Selector corporativo de tema oscuro (inyectado por theme.js) */
[data-theme="dark"],
body.dark-mode {
  --bg-page: #0b0f17;
  --bg-card: #111827;
  --bg-card-subtle: #182234;
  --border-card: #1f2937;
  --border-subtle: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --input-bg: #1e293b;
  --input-border: #334155;
  --tab-bg: #1e293b;
  --tab-hover: #334155;
  --hero-gradient: linear-gradient(135deg, rgba(225, 29, 72, 0.18) 0%, rgba(245, 158, 11, 0.08) 50%, rgba(6, 182, 212, 0.08) 100%);
  --cta-gradient: linear-gradient(135deg, rgba(225, 29, 72, 0.16) 0%, rgba(244, 63, 94, 0.08) 100%);
  --toggle-group-bg: #0f172a;
  --toggle-btn-selected: #334155;
}

/* Selector corporativo de tema claro (inyectado por theme.js) */
[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --border-card: #e2e8f0;
  --border-subtle: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --tab-bg: #f1f5f9;
  --tab-hover: #e2e8f0;
  --hero-gradient: linear-gradient(135deg, rgba(225, 29, 72, 0.08) 0%, rgba(245, 158, 11, 0.04) 50%, rgba(6, 182, 212, 0.04) 100%);
  --cta-gradient: linear-gradient(135deg, rgba(225, 29, 72, 0.1) 0%, rgba(244, 63, 94, 0.04) 100%);
  --toggle-group-bg: #e2e8f0;
  --toggle-btn-selected: #ffffff;
}

/* Base de layout */
body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Héroe temático */
.enc-hero {
  background: var(--hero-gradient);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.enc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(225, 29, 72, 0.15);
  color: var(--blood-red);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: 1px solid var(--blood-border);
}

.enc-hero-title {
  font-family: var(--font-heading);
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 0.75rem 0;
  color: var(--text-main);
}

.enc-hero-desc {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 820px;
  margin: 0 0 1.5rem 0;
}

.enc-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-card);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--blood-red);
  line-height: 1.1;
}

.stat-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.45;
}

/* Barra de pestañas y accesos rápidos */
.enc-nav-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-card);
  scrollbar-width: thin;
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--tab-bg);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 40px;
}

.nav-tab-btn:hover {
  background: var(--tab-hover);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.nav-tab-btn.active {
  background: var(--blood-red);
  color: #ffffff;
  border-color: var(--blood-red-hover);
  box-shadow: 0 4px 14px var(--blood-glow);
}

/* Secciones y tarjetas */
.enc-section {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.enc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.enc-card-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.enc-card-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.5;
}

/* Formularios y controles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label-hint {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-control,
.form-select {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--blood-red);
  box-shadow: 0 0 0 3px var(--blood-glow);
}

.form-select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px;
  appearance: none;
  -webkit-appearance: none;
}

/* Triaje de preguntas interactivas */
.triage-questions-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.triage-question-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s ease;
}

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

.triage-q-info {
  flex: 1 1 auto;
}

.triage-q-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.triage-q-sub {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.triage-toggle-group {
  display: inline-flex;
  border-radius: 8px;
  padding: 3px;
  background: var(--toggle-group-bg);
  border: 1px solid var(--border-card);
  flex-shrink: 0;
}

.triage-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.triage-toggle-btn:hover {
  color: var(--text-main);
}

.triage-toggle-btn.selected {
  background: var(--toggle-btn-selected);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .triage-toggle-btn.selected {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.triage-toggle-btn.selected-danger {
  background: var(--blood-red);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--blood-glow);
}

/* Panel de veredicto del triaje */
.triage-verdict-box {
  border-radius: 14px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: all 0.3s ease;
}

.verdict-success {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

[data-theme="light"] .verdict-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.verdict-warning {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

[data-theme="light"] .verdict-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.verdict-danger {
  background: rgba(225, 29, 72, 0.14);
  border: 1px solid rgba(225, 29, 72, 0.4);
  color: #fecdd3;
}

[data-theme="light"] .verdict-danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.verdict-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .verdict-icon-box {
  background: rgba(255, 255, 255, 0.8);
}

.verdict-body {
  flex: 1 1 auto;
}

.verdict-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.4rem 0;
}

.verdict-text {
  font-size: 0.93rem;
  line-height: 1.5;
  margin: 0 0 0.85rem 0;
}

.verdict-reasons-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.55;
}

/* Calculadora de próximas fechas e intervalos */
.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

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

.calc-kpi-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.calc-kpi-value {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.calc-kpi-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.calc-actions-bar {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Botones principales y acciones */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--blood-red);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px var(--blood-glow);
}

.btn-primary:hover {
  background: var(--blood-red-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--tab-bg);
  color: var(--text-main);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 0.75rem 1.3rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--tab-hover);
  border-color: var(--border-subtle);
}

/* Matriz de compatibilidad sanguínea */
.blood-group-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.group-btn {
  background: var(--bg-card-subtle);
  border: 2px solid var(--border-card);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 64px;
}

.group-btn:hover {
  border-color: var(--border-subtle);
  transform: translateY(-2px);
}

.group-btn.selected {
  border-color: var(--blood-red);
  background: rgba(225, 29, 72, 0.18);
  box-shadow: 0 4px 14px var(--blood-glow);
}

[data-theme="light"] .group-btn.selected {
  background: rgba(225, 29, 72, 0.08);
}

.group-label {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.group-freq {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Caja de detalle de grupo */
.group-detail-box {
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid var(--blood-border);
  border-radius: 14px;
  padding: 1.35rem;
  margin-bottom: 1.5rem;
}

.group-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.group-title-highlight {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin: 0 0 0.25rem 0;
  color: var(--blood-red);
}

.group-role-badge {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.group-advice-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.group-freq-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--blood-red);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px var(--blood-glow);
}

.group-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(225, 29, 72, 0.3);
}

.group-meta-label {
  font-size: 0.8rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.group-meta-val {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-top: 0.2rem;
}

/* Cuadrícula de compatibilidad */
.compat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.compat-card {
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.4rem;
  background: var(--bg-card-subtle);
}

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

.compat-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.85rem 0;
  line-height: 1.4;
}

.compat-section-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.35rem;
}

.compat-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.blood-pill {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.pill-give {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="light"] .pill-give {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

.pill-receive {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="light"] .pill-receive {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.3);
}

.pill-neutral {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
  border-color: rgba(100, 116, 139, 0.3);
}

[data-theme="light"] .pill-neutral {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.2);
}

/* Atlas de componentes fraccionados */
.components-tri-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.component-card {
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border-card);
  background: var(--bg-card-subtle);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.component-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  border-color: var(--border-subtle);
}

.component-card.comp-rbc {
  border-top: 4px solid var(--blood-red);
}

.component-card.comp-platelets {
  border-top: 4px solid var(--platelet-cyan);
}

.component-card.comp-plasma {
  border-top: 4px solid var(--plasma-amber);
}

.comp-icon-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.comp-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comp-rbc .comp-icon-box {
  background: rgba(225, 29, 72, 0.2);
  color: var(--blood-red);
}

[data-theme="light"] .comp-rbc .comp-icon-box {
  background: #ffe4e6;
  color: var(--blood-red);
}

.comp-platelets .comp-icon-box {
  background: rgba(6, 182, 212, 0.2);
  color: var(--platelet-cyan);
}

[data-theme="light"] .comp-platelets .comp-icon-box {
  background: #cffafe;
  color: var(--platelet-cyan);
}

.comp-plasma .comp-icon-box {
  background: rgba(245, 158, 11, 0.2);
  color: var(--plasma-amber);
}

[data-theme="light"] .comp-plasma .comp-icon-box {
  background: #fef3c7;
  color: var(--plasma-amber);
}

.comp-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.comp-specs-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.comp-spec-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-card);
  padding-bottom: 0.35rem;
}

.comp-spec-name {
  color: var(--text-muted);
}

.comp-spec-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.comp-clinical-target {
  margin-top: auto;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-card);
}

.comp-clinical-target strong {
  color: var(--text-main);
}

/* Directorio de Centros de Transfusión */
.ccaa-search-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.ccaa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
}

.ccaa-card {
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.25rem;
  background: var(--bg-card-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.ccaa-card:hover {
  border-color: var(--border-subtle);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ccaa-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--text-main);
}

.ccaa-entity {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.ccaa-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--blood-red);
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid var(--blood-border);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  min-height: 38px;
}

.ccaa-link-btn:hover {
  background: var(--blood-red);
  color: #ffffff;
}

.ccaa-phone-pill {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Pasos cronológicos de la donación */
.donation-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.donation-step-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blood-red);
}

.step-title {
  margin: 0.35rem 0;
  font-size: 1rem;
  font-family: var(--font-heading);
  color: var(--text-main);
}

.step-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Acordeón de mitos y dudas frecuentes */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  border: 1px solid var(--border-card);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card-subtle);
  transition: border-color 0.2s;
}

.faq-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  min-height: 44px;
}

.faq-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.faq-icon-arrow {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.75rem;
  color: var(--text-muted);
}

.faq-item.open .faq-icon-arrow {
  transform: rotate(180deg);
  color: var(--blood-red);
}

.faq-content {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.faq-content strong {
  color: var(--text-main);
}

.faq-item.open .faq-content {
  display: block;
}

/* Módulo de Carnet Compartible */
.card-preview-cta {
  background: var(--cta-gradient);
  border: 1px solid var(--blood-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.card-cta-text h4 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  color: var(--text-main);
}

.card-cta-text p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

/* Modal accesible nativo para avisos */
.info-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  box-sizing: border-box;
}

.info-modal-backdrop.active {
  display: flex;
}

.info-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  max-width: 520px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  position: relative;
  box-sizing: border-box;
  color: var(--text-main);
}

.info-modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-modal-close-btn:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

/* Responsividad en móvil */
@media (max-width: 768px) {
  .enc-hero {
    padding: 1.5rem 1.25rem;
  }

  .enc-hero-title {
    font-size: 1.65rem;
  }

  .enc-card {
    padding: 1.25rem;
  }

  .triage-question-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .triage-toggle-group {
    width: 100%;
    justify-content: stretch;
  }

  .triage-toggle-btn {
    flex: 1 1 0%;
  }

  .card-preview-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .card-preview-cta .btn-primary {
    width: 100%;
  }
}