/**
 * Laboratorio ESP: Test científico de cartas Zener
 * Hoja de estilos canónica - Fijate Tools
 * Tipografías corporativas: Inter, Outfit, JetBrains Mono
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta cromática científica / laboratorio */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;

  --accent-esp: #7c3aed;
  --accent-esp-light: #ede9fe;

  --success: #059669;
  --success-light: #d1fae5;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;

  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --card-zener-shadow: 0 14px 28px rgba(15, 23, 42, 0.12), 0 10px 10px rgba(15, 23, 42, 0.08);

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

/* Modo oscuro corporativo (data-theme="dark") */
[data-theme="dark"] {
  --bg-page: #0b1120;
  --bg-card: #131c31;
  --bg-card-subtle: #1e293b;
  --border-color: #24344d;
  --border-focus: #38bdf8;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-light: rgba(56, 189, 248, 0.15);

  --accent-esp: #a78bfa;
  --accent-esp-light: rgba(167, 139, 250, 0.15);

  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.15);
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.15);

  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --card-zener-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
}

/* Contención global y layout canónico */
body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.hero-title,
.section-title,
.faq-section-title {
  font-family: var(--font-heading);
}

.mono,
.stat-mono,
code {
  font-family: var(--font-mono);
}

/* Layout con sidebar para AdSense */
.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%;
}

/* Tarjeta principal del experimento */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
  .card-main {
    padding: 2.25rem;
  }
}

/* Barra de configuración superior de la prueba */
.test-config-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
}

.config-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

/* Segmented button controls */
.segmented-control {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.segmented-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  min-height: 36px;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.segmented-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Selector desplegable estilizado */
.custom-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 40px;
  padding: 0 40px 0 0.85rem;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  appearance: none;
  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='%2364748b' 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 12px center;
  cursor: pointer;
}

.custom-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.custom-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* Botones de acción auxiliares */
.config-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-utility {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  transition: all 0.15s ease;
}

.btn-utility:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.btn-utility.is-active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Resumen superior en tiempo real (HUD de telemetría) */
.experiment-hud {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .experiment-hud {
    grid-template-columns: repeat(4, 1fr);
  }
}

.hud-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hud-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-muted);
}

.hud-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.hud-val {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.hud-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hud-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  display: inline-block;
  margin-top: 0.25rem;
  width: fit-content;
}

.hud-badge.positive {
  background: var(--success-light);
  color: var(--success);
}

.hud-badge.neutral {
  background: var(--border-color);
  color: var(--text-muted);
}

.hud-badge.negative {
  background: var(--danger-light);
  color: var(--danger);
}

/* Barra de progreso de la serie */
.progress-container {
  width: 100%;
  height: 6px;
  background: var(--bg-card-subtle);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-esp) 100%);
  border-radius: 9999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Área central de experimentación: Carta Zener 3D */
.stage-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2.25rem;
  position: relative;
}

/* Modo telepatía: ondas de concentración de fondo */
.telepathy-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stage-area.is-telepathy-active .telepathy-pulse {
  opacity: 1;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.25) 0%, rgba(124, 58, 237, 0) 70%);
  animation: pulseRings 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes pulseRings {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
}

/* Indicador de estado de la carta */
.stage-instruction {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 1.5rem;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.stage-instruction-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
  text-align: center;
  margin-top: 0.2rem;
}

/* Contenedor 3D de la carta Zener */
.zener-card-container {
  width: 170px;
  height: 250px;
  perspective: 1000px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .zener-card-container {
    width: 200px;
    height: 290px;
  }
}

.zener-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: var(--radius-lg);
  cursor: default;
}

.zener-card.is-flipped {
  transform: rotateY(180deg);
}

/* Caras de la carta (reverso y anverso) */
.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-zener-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
}

/* Reverso de la carta: diseño clásico Duke University 1930 */
.card-back {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #94a3b8;
  position: relative;
  overflow: hidden;
  border: 4px solid #334155;
}

.card-back::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none;
}

.card-back-pattern {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.card-back-emblem {
  width: 58px;
  height: 58px;
  border: 2px solid rgba(148, 163, 184, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
}

.card-back-title {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cbd5e1;
  font-weight: 700;
}

.card-back-sub {
  font-size: 0.6875rem;
  color: #64748b;
  letter-spacing: 0.05em;
}

/* Anverso de la carta: símbolo revelado */
.card-front {
  background: #ffffff;
  color: #0f172a;
  transform: rotateY(180deg);
  border: 4px solid #cbd5e1;
  position: relative;
}

[data-theme="dark"] .card-front {
  background: #f8fafc;
  color: #0f172a;
  border-color: #475569;
}

.card-symbol-svg {
  width: 110px;
  height: 110px;
  display: block;
}

@media (min-width: 640px) {
  .card-symbol-svg {
    width: 130px;
    height: 130px;
  }
}

.card-symbol-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.75rem;
  color: #1e293b;
  text-transform: capitalize;
}

.card-result-badge {
  position: absolute;
  bottom: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-result-badge.hit {
  background: #dcfce7;
  color: #15803d;
}

.card-result-badge.miss {
  background: #fee2e2;
  color: #b91c1c;
}

/* Fila de retroalimentación de último ensayo */
.trial-feedback {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  min-height: 32px;
}

.feedback-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.feedback-tag.hit {
  background: var(--success-light);
  color: var(--success);
}

.feedback-tag.miss {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Panel de selección táctil de los 5 símbolos Zener */
.symbol-selection-panel {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.75rem;
}

.selection-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.25rem;
}

.symbols-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .symbols-grid {
    gap: 1rem;
  }
}

.btn-zener-symbol {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 84px;
  color: var(--text-main);
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  .btn-zener-symbol {
    min-height: 104px;
    padding: 1rem 0.5rem;
  }
}

.btn-zener-symbol:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.btn-zener-symbol:active:not(:disabled) {
  transform: translateY(0);
}

.btn-zener-symbol:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.symbol-icon-wrapper {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) {
  .symbol-icon-wrapper {
    width: 48px;
    height: 48px;
  }
}

.symbol-icon-wrapper svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.symbol-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

@media (min-width: 640px) {
  .symbol-label {
    font-size: 0.875rem;
  }
}

.symbol-key-hint {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  display: none;
}

@media (min-width: 768px) {
  .symbol-key-hint {
    display: inline-block;
  }
}

/* Tira de historial de ensayos recientes */
.trial-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  min-height: 42px;
}

.strip-item {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.strip-item.hit {
  background: var(--success);
  color: #ffffff;
}

.strip-item.miss {
  background: var(--border-color);
  color: var(--text-muted);
}

/* ========================================================
   SECCIÓN DE RESULTADOS ANALÍTICOS Y GRÁFICAS DE LABORATORIO
   ======================================================== */
.results-section {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.results-section.is-visible {
  display: block;
}

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

/* Veredicto científico principal */
.verdict-banner {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.verdict-banner.chance {
  background: var(--bg-card-subtle);
  border-color: var(--border-color);
}

.verdict-banner.moderate-positive {
  background: var(--primary-light);
  border-color: var(--primary);
}

.verdict-banner.high-positive,
.verdict-banner.extreme-positive {
  background: var(--success-light);
  border-color: var(--success);
}

.verdict-banner.psi-missing {
  background: var(--accent-esp-light);
  border-color: var(--accent-esp);
}

.verdict-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.verdict-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  color: var(--primary);
}

.verdict-titles {
  flex: 1;
}

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

.verdict-desc {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* Matriz de KPIs estadísticos */
.stats-grid-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .stats-grid-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kpi-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-main);
}

.kpi-detail {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Contenedores de gráficas Canvas */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 900px) {
  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

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

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.chart-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.canvas-container {
  width: 100%;
  height: 240px;
  position: relative;
}

.canvas-chart {
  width: 100%;
  height: 100%;
  display: block;
}

/* Tabla de matriz de confusión de símbolos */
.matrix-container {
  overflow-x: auto;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

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

.matrix-table th,
.matrix-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.matrix-table th {
  background: var(--bg-card-subtle);
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.matrix-table td.mono {
  font-family: var(--font-mono);
}

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

/* Botones de acción final de sesión */
.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.btn-primary-action {
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-family: var(--font-main);
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

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

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

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

/* ========================================================
   SECCIONES DIDÁCTICAS Y ACORDEONES FAQ (SEO CANÓNICO)
   ======================================================== */
.faq-section {
  margin-top: 3rem;
  margin-bottom: 2.5rem;
}

.faq-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.faq-accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  padding: 1.25rem;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  min-height: 48px;
  transition: background-color 0.15s ease;
}

.faq-question:hover {
  background: var(--bg-card-subtle);
}

.faq-icon-chevron {
  transition: transform 0.25s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}

.faq-item.is-open .faq-icon-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.faq-item.is-open .faq-answer {
  display: block;
}

.faq-formula-box {
  background: var(--bg-card-subtle);
  border-left: 3px solid var(--primary);
  padding: 0.85rem 1.15rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-main);
}

/* ========================================================
   MODALES ACCESIBLES SIN ALERTS
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 500px;
  padding: 1.75rem;
  box-sizing: border-box;
  animation: modalScale 0.2s ease-out;
}

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

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast flotante de notificación */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast-notice.is-visible {
  transform: translateX(-50%) translateY(0);
}
