/* ==========================================================================
   Fijate Tools - Calculadora de pérdida y recuperación de puntos de la DGT
   Estilos canónicos con soporte integral para modo oscuro y claro
   ========================================================================== */

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

  /* Paleta DGT / Tráfico (Tema Oscuro por defecto) */
  --bg-body: #0b0f17;
  --bg-card: #111827;
  --bg-card-subtle: #162032;
  --bg-input: #1a2436;
  --border-color: #27354d;
  --border-color-focus: #3b82f6;

  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.15);
  --primary-glow: rgba(37, 99, 235, 0.35);

  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.15);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

[data-theme="light"],
body.light-theme {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-color-focus: #2563eb;

  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);
  --primary-glow: rgba(37, 99, 235, 0.2);

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

  --color-success: #059669;
  --color-success-bg: rgba(5, 150, 105, 0.12);
  --color-warning: #d97706;
  --color-warning-bg: rgba(217, 119, 6, 0.12);
  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.12);

  --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 caja base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.mono {
  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: 1.5rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
}

/* Publicidad canónica */
.tools-ad-banner-section {
  margin-bottom: 1.5rem;
}

.ad-banner-container,
.ad-sticky-box {
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  text-align: center;
}

.ad-label {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 0.25rem;
}

.tool-ad-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 1536px) {
  .tool-ad-sidebar {
    display: block;
  }
  .ad-sticky-box {
    position: sticky;
    top: 5rem;
  }
}

/* Tarjeta principal */
.card-main {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
  .card-main {
    padding: 1rem;
    border-radius: var(--radius-lg);
  }
}

/* Caja de introducción */
.intro-box {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary-color);
  background-color: var(--primary-light);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.intro-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.intro-text strong {
  color: var(--text-main);
}

/* Workspace en 2 columnas */
.calculator-workspace {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.75rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

@media (max-width: 991px) {
  .calculator-workspace {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.workspace-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.column-results .results-sticky-box {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Secciones de formulario y tarjetas contenedoras */
.card-box {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

/* Toggle conductor particular / profesional */
.driver-type-toggle {
  display: inline-flex;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
}

.btn-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.btn-toggle.active {
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Presets de saldo inicial */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .presets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.preset-card {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 40px;
}

.preset-card:hover {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}

.preset-card.active {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.preset-pts {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-color);
}

.preset-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 0.2rem;
}

.preset-desc {
  font-size: 0.6875rem;
  color: var(--text-subtle);
  margin-top: 0.1rem;
}

/* Stepper numérico de puntos */
.custom-points-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

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

.input-stepper-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-stepper {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-stepper:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.input-number-points {
  width: 60px;
  height: 36px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
}

.input-number-points:focus {
  outline: none;
  border-color: var(--border-color-focus);
}

.unit-badge {
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

/* Controles de catálogo de infracciones */
.infractions-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.input-search {
  width: 100%;
  height: 42px;
  padding: 0 2.5rem 0 2.5rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.875rem;
  font-family: var(--font-main);
  transition: border-color 0.15s ease;
}

.input-search:focus {
  outline: none;
  border-color: var(--border-color-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-clear-search {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 1.25rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.btn-clear-search:hover {
  color: var(--text-main);
  background-color: var(--border-color);
}

.tabs-filter-group {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.tab-btn {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.35rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 32px;
}

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

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

/* Lista de catálogo */
.infractions-catalog-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.catalog-item-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.catalog-item-card:hover {
  border-color: rgba(37, 99, 235, 0.4);
}

.catalog-item-pts-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 0.4rem 0.25rem;
  border-radius: var(--radius-sm);
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  flex-shrink: 0;
}

.catalog-pts-number {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
}

.catalog-pts-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 0.15rem;
}

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

.catalog-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.catalog-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.catalog-item-meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.badge-fine {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.badge-pronto {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-success);
  background-color: var(--color-success-bg);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.badge-gravedad {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.btn-add-sancion {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--primary-color);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  min-height: 38px;
}

.btn-add-sancion:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

/* Expediente y lista de infracciones añadidas */
.empty-state {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--text-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.empty-state p {
  font-size: 0.875rem;
  max-width: 380px;
  line-height: 1.5;
}

.added-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.added-item-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--color-danger);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.added-item-left {
  flex: 1 1 200px;
  min-width: 0;
}

.added-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.added-item-sub {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 0.2rem;
}

.added-item-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.date-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.date-label-sub {
  font-size: 0.6875rem;
  color: var(--text-subtle);
}

.input-date-fine {
  height: 34px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color-scheme: dark;
}

[data-theme="light"] .input-date-fine,
body.light-theme .input-date-fine {
  color-scheme: light;
}

.btn-remove-fine {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.btn-remove-fine:hover {
  color: var(--color-danger);
  background-color: var(--color-danger-bg);
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--color-danger);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.btn-text-danger:hover {
  text-decoration: underline;
}

/* Opciones de cursos DGT */
.courses-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.course-card-option {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.course-card-option:hover {
  border-color: var(--primary-color);
}

.course-check-wrap {
  padding-top: 0.15rem;
}

.input-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

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

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

.course-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.badge-recover {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-success);
  background-color: var(--color-success-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
}

.badge-recover.badge-blue {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

.course-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* ==========================================================================
   Columna derecha: Permiso digital, medidor y dictamen
   ========================================================================== */

/* Tarjeta digital del carnet DGT */
.dgt-license-card {
  background: linear-gradient(135deg, #111e38 0%, #0d1527 100%);
  border: 1px solid #1e3a8a;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .dgt-license-card,
body.light-theme .dgt-license-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #e0effe 100%);
  border-color: #93c5fd;
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.15);
}

.license-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

[data-theme="light"] .license-top-strip,
body.light-theme .license-top-strip {
  border-bottom-color: rgba(37, 99, 235, 0.15);
}

.license-flag-box {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: #1e40af;
  color: #ffffff;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.license-es {
  font-weight: 900;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  background: #ffffff;
  color: #1e40af;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.license-country {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.license-title-box {
  text-align: center;
}

.license-badge-dgt {
  display: block;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #60a5fa;
}

[data-theme="light"] .license-badge-dgt,
body.light-theme .license-badge-dgt {
  color: #1d4ed8;
}

.license-subtitle {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.license-chip {
  width: 28px;
  height: 22px;
  background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
  border-radius: 4px;
  border: 1px solid #b45309;
}

.license-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

@media (max-width: 480px) {
  .license-body {
    flex-direction: column;
    text-align: center;
  }
}

/* Medidor circular SVG tipo velocímetro */
.license-gauge-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 9;
}

.gauge-progress {
  fill: none;
  stroke: var(--color-success);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 301.59; /* 2 * PI * 48 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

.gauge-inner-data {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.gauge-pts-val {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.gauge-pts-max {
  font-size: 0.6875rem;
  color: var(--text-subtle);
  margin-top: 0.15rem;
}

/* Metadatos del permiso */
.license-meta {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.license-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-success);
  margin-bottom: 0.25rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  display: inline-block;
  box-shadow: 0 0 8px var(--color-success);
}

.license-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  gap: 0.5rem;
}

.meta-label {
  color: var(--text-subtle);
}

.meta-val {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
}

.text-danger {
  color: var(--color-danger);
}

/* Alerta de saldo 0 o crítico */
.license-alert-banner {
  margin-top: 0.875rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.4;
  border: 1px solid;
}

.license-alert-banner.alert-critical {
  background-color: var(--color-danger-bg);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.license-alert-banner.alert-warning {
  background-color: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

/* Tarjeta de Recuperación de Oficio (2 años) */
.recovery-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.recovery-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  margin-bottom: 0.875rem;
}

.recovery-header-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
}

.recovery-date-display {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.875rem;
}

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

.recovery-date-val {
  font-size: 1.125rem;
  color: var(--primary-color);
  font-family: var(--font-heading);
}

.countdown-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.countdown-stat {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  text-align: center;
}

.count-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.count-unit {
  font-size: 0.6875rem;
  color: var(--text-subtle);
}

.recovery-progress-wrap {
  margin-bottom: 0.875rem;
}

.progress-bar {
  height: 8px;
  background-color: var(--bg-input);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.4s ease;
}

.progress-desc {
  font-size: 0.6875rem;
  color: var(--text-subtle);
}

.recovery-legal-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.recovery-legal-note strong {
  color: var(--text-main);
}

/* Tarjeta de resumen económico */
.fines-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.fines-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.fines-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fine-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.fine-label {
  color: var(--text-muted);
}

.fine-val {
  font-weight: 700;
  color: var(--text-main);
}

.fine-row.highlight-green .fine-label {
  color: var(--color-success);
}

.fine-row.highlight-green .fine-val {
  color: var(--color-success);
  font-size: 1.125rem;
}

.fine-saving-note {
  font-size: 0.75rem;
  color: var(--color-success);
  background-color: var(--color-success-bg);
  padding: 0.4rem 0.625rem;
  border-radius: var(--radius-sm);
  margin-top: 0.35rem;
}

/* Botonera de acciones */
.actions-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-action-primary {
  width: 100%;
  min-height: 44px;
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.btn-action-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 0 16px var(--primary-glow);
}

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

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

/* ==========================================================================
   Sección FAQ acordeón
   ========================================================================== */
.faq-section {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  margin-top: 1.5rem;
}

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

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

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

.faq-item[open] {
  border-color: rgba(37, 99, 235, 0.4);
}

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

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

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

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary-color);
}

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

.faq-answer p + p {
  margin-top: 0.75rem;
}

.faq-answer ul,
.faq-answer ol {
  margin: 0.75rem 0 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.faq-answer code {
  background-color: var(--bg-input);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  color: var(--text-main);
}

/* ==========================================================================
   Modal Canónico de Notificaciones / Confirmaciones
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

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

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

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

.modal-heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

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

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

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

.btn-modal-action {
  min-height: 40px;
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-modal-action:hover {
  background-color: var(--primary-hover);
}

/* ==========================================================================
   Vista de Impresión Oficial A4 (.print-sheet)
   ========================================================================== */
.print-sheet {
  display: none;
}

@media print {
  /* Ocultar toda la interfaz visual y publicitaria */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .app-header,
  .fijate-footer,
  .main-wrapper.tool-layout,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .modal-overlay {
    display: none !important;
  }

  /* Mostrar la hoja formal A4 */
  .print-sheet {
    display: block !important;
    max-width: 210mm;
    margin: 0 auto;
    padding: 15mm 15mm;
    background: #ffffff;
    color: #000000;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #000000;
    padding-bottom: 8mm;
    margin-bottom: 6mm;
  }

  .print-brand h2 {
    font-size: 15pt;
    font-weight: bold;
    color: #000000;
  }

  .print-sub {
    font-size: 9pt;
    color: #444444;
  }

  .print-date {
    font-size: 9pt;
    text-align: right;
  }

  .print-section {
    margin-bottom: 6mm;
  }

  .print-section h3 {
    font-size: 11pt;
    font-weight: bold;
    border-bottom: 1px solid #cccccc;
    padding-bottom: 2mm;
    margin-bottom: 3mm;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 4mm;
    font-size: 9.5pt;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #cccccc;
    padding: 2mm 3mm;
    text-align: left;
  }

  .print-table th {
    background-color: #f2f2f2;
    font-weight: bold;
  }

  .print-footer-legal {
    margin-top: 8mm;
    border-top: 1px solid #cccccc;
    padding-top: 3mm;
    font-size: 8pt;
    color: #555555;
    line-height: 1.4;
  }
}
