/* ==========================================================================
   Anatomía de la IA y Agentes - Estilos visuales
   ========================================================================== */

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

  /* Paleta Dark (por defecto) */
  --bg-page: #0b0f17;
  --bg-card: #111827;
  --bg-card-subtle: #1e293b;
  --bg-input: #0f172a;
  --border-color: #1e293b;
  --border-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Acentos de luz cibernéticos */
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-pink: #ec4899;

  --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.25);
  --glow-purple: 0 0 20px rgba(139, 92, 246, 0.25);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --glow-cyan: 0 4px 14px rgba(6, 182, 212, 0.15);
  --glow-purple: 0 4px 14px rgba(139, 92, 246, 0.15);
}

/* --- Layout general y contención estricta --- */
body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.hero-title,
.act-header-title,
.section-title {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  margin-top: 0;
}

code, .mono, .token-id, .candidate-pct {
  font-family: var(--font-mono);
}

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

.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%;
}

/* --- Hero Section & Brand Visual --- */
.ai-hero-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glow-cyan);
}

[data-theme="light"] .ai-hero-card {
  background: linear-gradient(135deg, #ffffff, #f1f5f9);
}

.ai-hero-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #f8fafc 40%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #0f172a 40%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* --- Menú de Navegación de Actos --- */
.act-nav-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  scrollbar-width: thin;
}

.act-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 44px;
}

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

.act-nav-btn.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.act-badge {
  display: inline-block;
  background: rgba(148, 163, 184, 0.15);
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.act-nav-btn.active .act-badge {
  background: var(--accent-cyan);
  color: #0b0f17;
}

/* --- Contenedor del Canvas Global --- */
.canvas-wrapper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1rem;
  margin-bottom: 2rem;
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.canvas-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

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

#neural-canvas {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.9) 100%);
}

[data-theme="light"] #neural-canvas {
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
}

/* --- Secciones de Actos --- */
.act-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

.act-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.act-header-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.act-header-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* --- Componentes Acto 1: Tokens --- */
.input-group-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.text-token-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: var(--text-main);
  font-family: var(--font-main);
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
  min-height: 48px;
}

.text-token-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.token-presets-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.preset-intro-text {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.token-preset-chip {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
}

.token-preset-chip:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.token-stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

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

.stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: lowercase;
}

.stat-label::first-letter {
  text-transform: uppercase;
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.token-pills-area {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--bg-input);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  min-height: 80px;
  align-content: flex-start;
  margin-bottom: 1.5rem;
}

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
}

.token-id {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.85;
}

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

.vector-math-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--accent-purple);
}

.vector-math-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.vector-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-vector {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 42px;
}

.btn-vector:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}

/* --- Componentes Acto 2: Self-Attention --- */
.attention-presets-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.attention-preset-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 42px;
}

.attention-preset-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

.attention-preset-btn.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.attention-explanation-box {
  background: rgba(6, 182, 212, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  color: var(--text-main);
}

.heatmap-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
}

.heatmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: center;
}

.heatmap-table th, .heatmap-table td {
  padding: 0.6rem 0.5rem;
  border: 1px solid var(--border-color);
}

.heatmap-table th {
  background: var(--bg-card-subtle);
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
}

.heatmap-table td {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #ffffff;
}

/* --- Componentes Acto 3: Temperatura y Predicción --- */
.temp-control-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.temp-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.temp-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-cold {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-medium {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-hot {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.slider-container {
  margin-bottom: 1rem;
}

.analog-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #334155;
  outline: none;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.prediction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.candidates-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.candidate-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.candidate-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
}

.candidate-token {
  color: var(--text-main);
  font-family: var(--font-mono);
}

.candidate-pct {
  color: var(--accent-cyan);
}

.candidate-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-card-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.candidate-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stream-output-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.stream-header {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  text-transform: lowercase;
}

.stream-header::first-letter {
  text-transform: uppercase;
}

.stream-content {
  font-size: 1rem;
  line-height: 1.6;
  min-height: 80px;
  color: var(--text-main);
}

.stream-token.new-token {
  animation: glowPop 0.5s ease;
  background: rgba(6, 182, 212, 0.25);
  border-radius: 3px;
}

@keyframes glowPop {
  0% { background: var(--accent-cyan); color: #0b0f17; }
  100% { background: transparent; }
}

.gen-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #0b0f17;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: opacity 0.2s;
  min-height: 44px;
}

.btn-primary-action:hover {
  opacity: 0.92;
}

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

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

.btn-secondary-action.btn-stop {
  border-color: #f43f5e;
  color: #f43f5e;
}

/* --- Componentes Acto 4: Agentes y Bucle ReAct --- */
.mission-selector-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.mission-select-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 42px;
}

.mission-select-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.mission-briefing {
  background: var(--bg-card-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.mission-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-bottom: 0.35rem;
}

.mission-goal {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.tools-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tool-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: all 0.25s ease;
}

.tool-card.tool-active {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
}

.tool-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.tool-card.tool-active .tool-icon-box {
  background: var(--accent-amber);
  color: #0b0f17;
}

.tool-name {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
}

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

.agent-execution-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 860px) {
  .agent-execution-grid {
    grid-template-columns: 1fr;
  }
}

.tree-thoughts-panel {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.panel-header-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tree-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tree-node {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.tree-node.active {
  color: var(--text-main);
  font-weight: 600;
}

.tree-node.active svg {
  color: var(--accent-emerald);
  flex-shrink: 0;
}

.agent-terminal {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 280px;
}

[data-theme="light"] .agent-terminal {
  background: #0f172a;
}

.terminal-header {
  background: #111827;
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #1e293b;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.25rem;
}

.terminal-logs {
  flex: 1;
  padding: 0.85rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.log-line {
  word-break: break-word;
}

.log-time { color: #64748b; margin-right: 0.35rem; }
.log-info { color: #94a3b8; }
.log-think { color: #38bdf8; }
.log-tool { color: #f59e0b; }
.log-result { color: #34d399; }
.log-recovery { color: #ec4899; font-weight: 700; }
.log-success { color: #10b981; font-weight: 700; }
.log-warn { color: #f43f5e; font-weight: 700; }

.agent-controls-bar {
  display: flex;
  gap: 0.75rem;
}

.spinner-dot {
  width: 14px;
  height: 14px;
  border: 2px solid #0b0f17;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* --- Componentes Acto 5: Laboratorio Sandbox --- */
.sandbox-switches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.switch-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.switch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch-name {
  font-size: 0.98rem;
  font-weight: 700;
}

.switch-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

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

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

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: 0.3s;
  border-radius: 34px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: #ffffff;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--accent-cyan);
}

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

/* --- Guía Didáctica y Acordeón FAQ --- */
.faq-section {
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.faq-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.faq-summary {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--accent-cyan);
  transition: transform 0.2s;
}

details[open] .faq-summary::after {
  content: '−';
}

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

/* --- Modales Accesibles --- */
.app-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(11, 15, 23, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.app-modal.modal-visible {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalScale 0.25s ease;
}

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

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

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

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

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