/**
 * Fijate Tools - Calculadora de Baremo de Méritos de Oposiciones
 * Estilos canónicos corporativos, tema Midnight Slate, diseño responsive y estilos print
 */

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

  /* Colores Corporativos Tema Oscuro (Midnight Slate) */
  --bg-page: #0b0f17;
  --bg-surface: #111723;
  --bg-card: #151e2e;
  --bg-card-hover: #1b263b;
  --bg-input: #0e1420;
  --border-color: #233047;
  --border-color-focus: #3b82f6;

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

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-emerald: #059669;
  --accent-gold: #f59e0b;
  --accent-amber: #d97706;
  --accent-purple: #8b5cf6;
  --accent-red: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.45);
}

/* Tema Claro */
html[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-color-focus: #2563eb;

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

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

/* Reset y base */
*, *::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.5;
  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-heading,
.cockpit-title,
.block-title,
.guide-main-title,
.faq-section-title {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
  font-weight: 700;
}

.mono,
.score-val,
.score-max,
.final-grade-badge,
.pill-val,
.kpi-mini-val,
.block-bar-val,
.tfoot-score,
code {
  font-family: var(--font-mono);
}

/* Layout y Contenedor Principal */
.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%;
}

.card-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

/* 1. Selector de Presets / Convocatoria */
.preset-selector-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.preset-header {
  margin-bottom: 1.25rem;
}

.preset-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.badge-accent {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border-radius: var(--radius-full);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.section-heading {
  font-size: 1.35rem;
  color: var(--text-main);
}

.section-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  min-height: 80px;
  position: relative;
}

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

.preset-btn.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.preset-icon {
  font-size: 1.3rem;
  margin-bottom: 0.35rem;
}

.preset-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

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

/* Panel Personalizado */
.custom-limits-panel {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px dashed var(--accent-blue);
  border-radius: var(--radius-md);
}

.custom-panel-title {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--accent-blue);
}

.custom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

/* 2. Cockpit de Resultados */
.results-cockpit {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.results-cockpit::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan), var(--accent-emerald));
}

.cockpit-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.cockpit-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border-radius: var(--radius-full);
}

.cockpit-title {
  font-size: 1.15rem;
  color: var(--text-main);
}

.cockpit-main-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

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

.kpi-score-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.score-number-box {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.score-val {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-blue);
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}

.score-max {
  font-size: 1.25rem;
  color: var(--text-dim);
  font-weight: 600;
}

.score-progress-track {
  width: 100%;
  height: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
}

.score-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  border-radius: var(--radius-full);
  transition: width 0.35s ease, background 0.35s ease;
}

.score-progress-bar.saturated {
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-gold));
}

.score-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.score-percent {
  font-weight: 700;
  color: var(--text-main);
}

/* Tarjeta de Nota Final Ponderada */
.kpi-final-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

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

.final-grade-badge {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.final-breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.final-pill {
  flex: 1 1 0%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  display: flex;
  flex-direction: column;
}

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

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

.pill-plus {
  font-weight: 700;
  color: var(--text-dim);
}

.final-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Barras segmentadas por apartado */
.blocks-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

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

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

.block-bar-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
}

.block-bar-name {
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.block-bar-val {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.85rem;
}

.block-track {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.block-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.block-bar-item.capped .block-fill {
  background: var(--accent-gold);
}

.block-alert-exceeded {
  font-size: 0.72rem;
  color: var(--accent-gold);
  font-weight: 600;
  display: block;
}

/* Botones de acción */
.cockpit-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

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

.btn-copy-summary {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.btn-copy-summary:hover {
  background: var(--accent-blue-hover);
  border-color: var(--accent-blue-hover);
}

.btn-reset {
  margin-left: auto;
  color: var(--text-dim);
}

.btn-reset:hover {
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.4);
}

@media (max-width: 600px) {
  .cockpit-actions {
    flex-direction: column;
  }
  .btn-action {
    width: 100%;
  }
  .btn-reset {
    margin-left: 0;
  }
}

/* 3. Secciones del Formulario */
.form-sections-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.block-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.header-icon-pill {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.header-text-box {
  flex: 1 1 0%;
}

.block-title {
  font-size: 1.15rem;
  color: var(--text-main);
  line-height: 1.2;
}

.block-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.block-header-kpi {
  text-align: right;
}

.kpi-mini-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-blue);
}

/* Tabs de Modo de Experiencia */
.mode-tabs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .mode-tabs-row {
    grid-template-columns: 1fr;
  }
}

.mode-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.mode-tab-btn.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Periodos de Experiencia Dinámicos */
.periods-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.period-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  transition: border-color 0.2s;
}

.period-item-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

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

.period-title-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-remove-period {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.btn-remove-period:hover {
  color: var(--accent-red);
}

.period-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 0.75rem;
  align-items: end;
}

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

.period-duration-badge {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.period-points-tag {
  font-weight: 700;
  color: var(--accent-emerald);
  margin-left: auto;
}

.periods-actions-row {
  display: flex;
  justify-content: flex-start;
}

.btn-add-period {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  min-height: 40px;
  background: var(--bg-card);
  border: 1px dashed var(--accent-blue);
  border-radius: var(--radius-md);
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-period:hover {
  background: rgba(59, 130, 246, 0.1);
  border-style: solid;
}

@media (max-width: 600px) {
  .btn-add-period {
    width: 100%;
    justify-content: center;
  }
}

/* Campos de Formulario Genéricos */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.92rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-color-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Selects Canónicos Anti-overflow */
select.form-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  padding-right: 40px;
  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='%2394a3b8' 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.form-control option {
  background: var(--bg-card);
  color: var(--text-main);
}

/* Inputs en flexbox con sufijo */
.input-with-suffix {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 40px;
}

.input-with-suffix .form-control {
  border: none;
  background: transparent;
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
}

.input-suffix {
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  height: 100%;
  display: flex;
  align-items: center;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

/* Sub-bloque de Formación Académica */
.academic-subblock {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed var(--border-color);
}

.academic-subblock:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

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

.gpa-inputs-row {
  display: flex;
  gap: 1.25rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.gpa-input-group {
  max-width: 280px;
}

.gpa-quick-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

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

.btn-quick-gpa {
  padding: 0.4rem 0.65rem;
  min-height: 36px;
  font-size: 0.78rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

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

.grid-academic-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

.academic-field-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.field-info {
  flex: 1 1 0%;
  min-width: 0;
}

.field-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: block;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

.field-meta-points {
  font-size: 0.75rem;
  color: var(--accent-blue);
  font-weight: 600;
}

/* Control numérico de incremento (+ / -) */
.stepper-control {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 36px;
}

.btn-step {
  width: 32px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

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

.stepper-val {
  width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

/* Bloque 3: Otros Méritos */
.other-fields-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.other-field-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.other-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.other-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.other-card-rate {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Bloque 4: Simulador de Concurso-Oposición */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

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

/* 4. Tabla de Desglose */
.breakdown-table-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.breakdown-header {
  margin-bottom: 1.25rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.table-breakdown th {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.table-breakdown td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.table-breakdown tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

.tfoot-total-row td {
  padding: 1rem;
  background: var(--bg-card);
  font-weight: 700;
  font-size: 0.95rem;
  border-top: 2px solid var(--border-color);
}

.tfoot-score {
  font-size: 1.15rem;
  color: var(--accent-blue);
  white-space: nowrap;
}

/* 5. Guía Técnica y FAQ */
.seo-guide-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.guide-main-title {
  font-size: 1.5rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

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

.guide-subtitle {
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.guide-article p {
  margin-bottom: 0.75rem;
}

.guide-article ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.guide-article li {
  margin-bottom: 0.4rem;
}

/* FAQ Acordeón */
.faq-accordion-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

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

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

.faq-item[open] {
  border-color: var(--border-color-focus);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

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

.faq-item[open] .faq-arrow {
  transform: rotate(180deg);
  color: var(--accent-blue);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

/* Modal Corporativo */
.app-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.app-modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.app-modal-title {
  font-size: 1.05rem;
  color: var(--text-main);
}

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

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

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

.app-modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.btn-modal-primary {
  padding: 0.55rem 1.25rem;
  min-height: 40px;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-modal-primary:hover {
  background: var(--accent-blue-hover);
}

/* 6. Estilos de Impresión (@media print) */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .app-header,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .preset-grid,
  .cockpit-actions,
  .mode-tabs-row,
  .periods-actions-row,
  .btn-remove-period,
  .stepper-control,
  .gpa-quick-buttons,
  .affiliate-section,
  .related-tools-section,
  .fijate-footer,
  .app-modal-backdrop {
    display: none !important;
  }

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

  .tool-with-sidebar {
    display: block !important;
  }

  .card-main {
    gap: 1rem !important;
  }

  .results-cockpit,
  .form-block-card,
  .breakdown-table-section {
    border: 1px solid #cccccc !important;
    background: #ffffff !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .score-val {
    color: #000000 !important;
  }

  .table-breakdown th,
  .table-breakdown td {
    border-color: #dddddd !important;
    color: #000000 !important;
    padding: 6px 8px !important;
  }
}
