/**
 * Estilos canónicos para la Calculadora y Simulador del Baremo de Dependencia
 * Ley 39/2006 (LAPAD), BVD (RD 174/2011) y Cuantías SAAD (RD 675/2023)
 * Fijate Tools (fijate.com)
 */

/* ==========================================================================
   1. VARIABLES DE TEMA Y PALETA ACCESIBLE
   ========================================================================== */
:root {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;

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

  /* Grados de dependencia */
  --grade-0: #10b981;
  --grade-0-light: #ecfdf5;
  --grade-0-border: #a7f3d0;
  --grade-0-text: #065f46;

  --grade-1: #eab308;
  --grade-1-light: #fefce8;
  --grade-1-border: #fef08a;
  --grade-1-text: #854d0e;

  --grade-2: #f97316;
  --grade-2-light: #fff7ed;
  --grade-2-border: #fed7aa;
  --grade-2-text: #9a3412;

  --grade-3: #dc2626;
  --grade-3-light: #fef2f2;
  --grade-3-border: #fecaca;
  --grade-3-text: #991b1b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

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

[data-theme="dark"] {
  --bg-app: #0a0e17;
  --bg-card: #111827;
  --bg-card-subtle: #1e293b;
  --bg-card-hover: #273549;
  --border-color: #273549;
  --border-focus: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;

  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --primary-light: #082f49;
  --primary-text: #0a0e17;

  /* Grados en oscuro con contraste garantizado */
  --grade-0: #34d399;
  --grade-0-light: #064e3b;
  --grade-0-border: #047857;
  --grade-0-text: #a7f3d0;

  --grade-1: #facc15;
  --grade-1-light: #422006;
  --grade-1-border: #713f12;
  --grade-1-text: #fef08a;

  --grade-2: #fb923c;
  --grade-2-light: #431407;
  --grade-2-border: #7c2d12;
  --grade-2-text: #fed7aa;

  --grade-3: #f87171;
  --grade-3-light: #450a0a;
  --grade-3-border: #7f1d1d;
  --grade-3-text: #fca5a5;
}

/* ==========================================================================
   2. REINICIO Y CONTENCIÓN PRINCIPAL
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
  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%;
}

/* ==========================================================================
   3. BARRA DE PRESETS Y BANNER INFORMATIVO
   ========================================================================== */
.hero-intro {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.hero-titles h2 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.hero-titles p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 760px;
}

.hero-badge-law {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid currentColor;
}

.presets-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

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

.presets-list {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-preset {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  min-height: 40px;
}

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

.btn-preset.active {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

/* ==========================================================================
   4. PANEL SUPERIOR HERO: MEDIDOR DEL BAREMO Y RESUMEN EN TIEMPO REAL
   ========================================================================== */
.score-dashboard {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.75rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

@media (max-width: 900px) {
  .score-dashboard {
    grid-template-columns: 1fr;
  }
}

.gauge-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.gauge-svg-wrapper {
  position: relative;
  width: 240px;
  height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gauge-center-text {
  position: absolute;
  bottom: 0px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-points-num {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.gauge-points-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}

.gauge-legend-ticks {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 240px;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.result-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-badge-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge-grade {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.02em;
}

.badge-grade-0 {
  background: var(--grade-0-light);
  color: var(--grade-0-text);
  border: 1px solid var(--grade-0-border);
}

.badge-grade-1 {
  background: var(--grade-1-light);
  color: var(--grade-1-text);
  border: 1px solid var(--grade-1-border);
}

.badge-grade-2 {
  background: var(--grade-2-light);
  color: var(--grade-2-text);
  border: 1px solid var(--grade-2-border);
}

.badge-grade-3 {
  background: var(--grade-3-light);
  color: var(--grade-3-text);
  border: 1px solid var(--grade-3-border);
}

.result-title {
  font-size: 1.35rem;
  color: var(--text-main);
  margin-top: 0.2rem;
}

.result-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.result-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.kpi-card {
  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.2rem;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

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

/* ==========================================================================
   5. NAVEGACIÓN POR PESTAÑAS
   ========================================================================== */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.85rem 1.25rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  min-height: 44px;
}

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

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ==========================================================================
   6. PESTAÑA 1: CUESTIONARIO BVD (ACTIVIDADES DE LA VIDA DIARIA)
   ========================================================================== */
.cognitive-callout {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.cognitive-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cognitive-title-group h3 {
  font-size: 1.05rem;
  margin: 0;
}

.switch-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.switch-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-slider {
  position: relative;
  width: 46px;
  height: 24px;
  background-color: var(--border-color);
  border-radius: 999px;
  transition: 0.25s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-input:checked + .switch-slider {
  background-color: var(--primary);
}

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

.cognitive-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.activities-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.activity-card:hover {
  border-color: var(--border-focus);
}

.activity-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.activity-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.activity-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.activity-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.activity-tasks-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.activity-weight-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  color: var(--text-dim);
  border: 1px solid var(--border-color);
}

/* Opciones de respuesta */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.6rem;
}

.option-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.2s ease;
  min-height: 44px;
  width: 100%;
}

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

.option-btn.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.option-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.option-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.option-radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.option-btn.selected .option-radio-dot {
  border-color: var(--primary);
}

.option-btn.selected .option-radio-dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.option-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ==========================================================================
   7. PESTAÑA 2: SIMULADOR DE AYUDAS ECONÓMICAS (RD 675/2023)
   ========================================================================== */
.simulator-config-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.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;
  align-items: center;
  justify-content: space-between;
}

.input-with-suffix {
  display: flex;
  align-items: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 0.85rem;
  height: 44px;
}

.input-with-suffix input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
}

.input-suffix {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dim);
  padding-left: 0.5rem;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.select-custom {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 44px;
  padding: 0 40px 0 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  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%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

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

.aid-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.aid-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
}

.aid-card-highlight {
  border-top: 4px solid var(--primary);
}

.aid-badge-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  width: fit-content;
}

.aid-card-title {
  font-size: 1.15rem;
  line-height: 1.3;
}

.aid-amount-box {
  margin: 0.25rem 0;
}

.aid-amount-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.aid-amount-period {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
}

.aid-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1 0 auto;
}

.aid-conditions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.aid-conditions-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

/* ==========================================================================
   8. PESTAÑA 3: GUÍA DE TRÁMITES Y DOCUMENTACIÓN POR CCAA
   ========================================================================== */
.ccaa-selector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ccaa-info-banner {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.ccaa-info-content h4 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.ccaa-info-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.ccaa-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-link-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-link-action:hover {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.steps-flow {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.step-body h4 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.step-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.docs-checklist-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.checklist-item:hover {
  background: var(--bg-card-hover);
}

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.checklist-text h5 {
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.checklist-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   9. BOTONES DE ACCIÓN PRINCIPALES
   ========================================================================== */
.actions-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.btn-action-main {
  background: var(--primary);
  color: var(--primary-text);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.4rem;
  font-size: 0.96rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  min-height: 44px;
}

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

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

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

@media (max-width: 640px) {
  .actions-bar button {
    width: 100%;
  }
}

/* ==========================================================================
   10. MODAL ACCESIBLE (SIN ALERT)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-card {
  transform: scale(1);
}

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

.modal-header h3 {
  font-size: 1.25rem;
  margin: 0;
}

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

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

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

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

/* ==========================================================================
   11. SECCIÓN EDUCATIVA Y FAQ (SEO & AYUDA)
   ========================================================================== */
.educational-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

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

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.edu-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.edu-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.faq-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item details {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
}

.faq-item summary {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text-main);
  outline: none;
}

.faq-item p {
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   12. ESTILOS DE IMPRESIÓN PERICIAL A4 (@media print)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }

  .app-header,
  .fijate-footer,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .tabs-nav,
  .actions-bar,
  .presets-container,
  .educational-section,
  .modal-backdrop,
  .btn-link-action {
    display: none !important;
  }

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

  .score-dashboard {
    border: 2px solid #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 1.5rem !important;
  }

  .activity-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 0.75rem !important;
  }

  .tab-panel {
    display: block !important;
  }

  .print-only-header {
    display: block !important;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #000;
  }
}

.print-only-header {
  display: none;
}
