/* ==========================================================================
   Brújula política y test de afinidad electoral - fijate.com
   Estándares de diseño corporativo: Outfit, Inter, JetBrains Mono
   Paleta: Midnight Slate, acentos cyan/azul eléctrico, contrastes WCAG AAA
   ========================================================================== */

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

  /* Colores de partidos políticos oficiales */
  --party-psoe: #e30613;
  --party-pp: #0bb2ff;
  --party-vox: #63be21;
  --party-sumar: #e51c55;
  --party-podemos: #6b2d82;

  /* Escala Likert */
  --likert-strong-disagree: #ef4444;
  --likert-disagree: #f97316;
  --likert-neutral: #94a3b8;
  --likert-agree: #10b981;
  --likert-strong-agree: #059669;

  /* Tema claro por defecto */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --compass-grid: #cbd5e1;
  --compass-axis: #475569;
  --compass-bg: #f8fafc;
}

[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #131b2a;
  --bg-card-subtle: #1c273a;
  --bg-card-hover: #24324a;
  --border-color: #26354d;
  --border-focus: #60a5fa;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #3b82f6;
  --accent-light: rgba(59, 130, 246, 0.15);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  --compass-grid: #1e293b;
  --compass-axis: #64748b;
  --compass-bg: #0f172a;
}

/* Reset y estructura global canónica */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* Layout canónico */
.main-wrapper.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  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 informativo */
.tool-hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-subtle) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.tool-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981, #3b82f6, #8b5cf6);
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

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

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.hero-stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.hero-stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Controles de vista y barra de progreso */
.progress-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.progress-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.progress-tag {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 6px;
}

.progress-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.view-mode-tabs {
  display: inline-flex;
  background: var(--bg-card-subtle);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.btn-view-mode {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-view-mode.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.progress-bar-wrapper {
  height: 8px;
  background: var(--bg-card-subtle);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

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

/* Tarjeta de pregunta */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.question-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
}

.question-card.answered {
  border-left: 4px solid var(--accent);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.question-category-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-cat-eco { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.badge-cat-soc { background: rgba(168, 85, 247, 0.12); color: #9333ea; }
.badge-cat-sec { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.badge-cat-ter { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.badge-cat-eco-env { background: rgba(16, 185, 129, 0.12); color: #059669; }

[data-theme="dark"] .badge-cat-eco { color: #60a5fa; }
[data-theme="dark"] .badge-cat-soc { color: #c084fc; }
[data-theme="dark"] .badge-cat-sec { color: #f87171; }
[data-theme="dark"] .badge-cat-ter { color: #fbbf24; }
[data-theme="dark"] .badge-cat-eco-env { color: #34d399; }

.question-number {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
}

.question-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

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

/* Opciones Likert */
.likert-options-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.likert-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 64px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.likert-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  transition: transform 0.2s ease, background 0.2s ease;
}

.likert-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

/* Variantes de selección Likert */
.likert-btn[data-val="-2"].selected {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--likert-strong-disagree);
  color: #ef4444;
}
.likert-btn[data-val="-2"].selected .likert-indicator {
  background: #ef4444;
  transform: scale(1.3);
}

.likert-btn[data-val="-1"].selected {
  background: rgba(249, 115, 22, 0.15);
  border-color: var(--likert-disagree);
  color: #f97316;
}
.likert-btn[data-val="-1"].selected .likert-indicator {
  background: #f97316;
  transform: scale(1.3);
}

.likert-btn[data-val="0"].selected {
  background: rgba(148, 163, 184, 0.2);
  border-color: var(--likert-neutral);
  color: var(--text-main);
}
.likert-btn[data-val="0"].selected .likert-indicator {
  background: var(--likert-neutral);
  transform: scale(1.3);
}

.likert-btn[data-val="1"].selected {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--likert-agree);
  color: #10b981;
}
.likert-btn[data-val="1"].selected .likert-indicator {
  background: #10b981;
  transform: scale(1.3);
}

.likert-btn[data-val="2"].selected {
  background: rgba(5, 150, 105, 0.2);
  border-color: var(--likert-strong-agree);
  color: #059669;
}
.likert-btn[data-val="2"].selected .likert-indicator {
  background: #059669;
  transform: scale(1.3);
}

/* Selector de importancia */
.question-footer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.importance-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.importance-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.importance-pills {
  display: inline-flex;
  background: var(--bg-card-subtle);
  border-radius: 6px;
  padding: 2px;
}

.btn-importance {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.btn-importance.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Navegación paso a paso */
.step-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.btn-nav:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.btn-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-nav-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-nav-primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* Panel de Resultados */
.results-container {
  display: none;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 0.4s ease;
}

.results-container.visible {
  display: flex;
}

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

.results-summary-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-subtle) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
}

.result-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.result-main-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.result-main-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 860px;
  margin-bottom: 1.5rem;
}

.coords-pills-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.coord-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.coord-pill strong {
  color: var(--accent);
}

/* Visualizador de la Brújula Cartesiana (SVG Interactivo) */
.compass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

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

.compass-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.compass-legend-toggles {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.legend-party-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.legend-party-toggle:hover {
  background: var(--bg-card-hover);
}

.party-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.party-dot-user { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }
.party-dot-psoe { background: var(--party-psoe); }
.party-dot-pp { background: var(--party-pp); }
.party-dot-vox { background: var(--party-vox); }
.party-dot-sumar { background: var(--party-sumar); }
.party-dot-podemos { background: var(--party-podemos); }

.compass-viewport {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  background: var(--compass-bg);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.compass-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Tooltip interactivo de la brújula */
.compass-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-size: 0.82rem;
  color: var(--text-main);
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.2s ease;
  white-space: nowrap;
  z-index: 20;
}

.compass-tooltip.active {
  opacity: 1;
}

/* Ranking de afinidad con partidos */
.affinity-ranking-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.affinity-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.affinity-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

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

.affinity-party-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.affinity-party-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.affinity-party-names {
  display: flex;
  flex-direction: column;
}

.affinity-party-sigla {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
}

.affinity-party-full {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.affinity-percent-badge {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.affinity-percent-badge small {
  font-size: 1rem;
  color: var(--text-muted);
}

.affinity-bar-track {
  height: 12px;
  background: var(--bg-card-subtle);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.affinity-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Minibarritas temáticas dentro de la tarjeta de partido */
.affinity-topics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.topic-mini-item {
  background: var(--bg-card-subtle);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.topic-mini-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.topic-mini-score {
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.affinity-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

.btn-show-differences {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: background 0.2s ease;
  min-height: 40px;
}

.btn-show-differences:hover {
  background: var(--accent-light);
}

/* Barra de acciones finales (imprimir, compartir, reiniciar) */
.actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

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

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

.btn-action-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-action-primary:hover {
  background: #1d4ed8;
}

/* Modales canónicos HTML/CSS/JS (cero alerts) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.modal-backdrop.active .modal-box {
  transform: scale(1);
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-btn-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

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

/* Lista de comparativa cara a cara en modal */
.comparison-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comparison-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
}

.comparison-q-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.comparison-answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.comparison-ans-box {
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--bg-card);
}

.comparison-ans-box span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

/* Acordeón FAQ y Guía SEO */
.faq-section {
  margin-top: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

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

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

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

.faq-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

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

/* ==========================================================================
   Adaptaciones Responsivas y Mobile First
   ========================================================================== */

@media (max-width: 768px) {
  .tool-hero {
    padding: 1.5rem;
  }

  .likert-options-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .likert-btn {
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    min-height: 48px;
    text-align: left;
    width: 100%;
  }

  .likert-indicator {
    margin-right: 0.75rem;
    flex-shrink: 0;
  }

  .btn-nav, .btn-action {
    width: 100%;
    min-height: 44px;
  }

  .step-nav-bar, .actions-bar {
    flex-direction: column;
  }

  .comparison-answers-grid {
    grid-template-columns: 1fr;
  }

  .compass-legend-toggles {
    justify-content: center;
  }
}

/* Modo de impresión limpio */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header, .fijate-footer, .tool-ad-sidebar, .tools-ad-banner-section,
  .step-nav-bar, .actions-bar, .view-mode-tabs, .faq-section {
    display: none !important;
  }

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

  .results-container {
    display: flex !important;
  }

  .compass-viewport {
    border: 1px solid #000000 !important;
    background: #ffffff !important;
  }

  .affinity-card {
    break-inside: avoid;
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
  }
}
