/**
 * Estilos canónicos para Calculadora de importación de coches de Alemania y la UE
 * fijate.com/tools/calculadora-importacion-coche-alemania-ue/
 */

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

  /* Colores temáticos claros */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-heading: #1e293b;

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

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

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

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.2);
}

/* Modo oscuro Midnight Slate */
[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #131b26;
  --bg-card-subtle: #1a2433;
  --bg-input: #1a2433;
  --border-color: #243144;
  --border-focus: #60a5fa;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-heading: #f8fafc;

  --color-brand: #3b82f6;
  --color-brand-hover: #60a5fa;
  --color-brand-glow: rgba(59, 130, 246, 0.25);

  --color-success: #34d399;
  --color-success-bg: rgba(52, 211, 153, 0.15);
  --color-warning: #fbbf24;
  --color-warning-bg: rgba(251, 191, 36, 0.15);
  --color-danger: #f87171;
  --color-danger-bg: rgba(248, 113, 113, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* Reset y contención básica */
*, *::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;
  -webkit-font-smoothing: antialiased;
}

/* Tipografías de títulos y números */
h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.hero-title,
.faq-section-title,
.card-section-title {
  font-family: var(--font-heading);
}

.mono,
.kpi-value,
.code-val,
.stat-price-val,
.stat-saving-val {
  font-family: var(--font-mono);
}

/* Layout canónico */
.tool-layout {
  max-width: 1240px;
  width: 100%;
  margin: 1.5rem auto 3.5rem;
  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%;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Sidebar vertical sticky AdSense */
.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: 1.5rem;
}

/* Tarjeta Hero explicativa */
.hero-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-subtle) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--color-brand-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge-legal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-brand-glow);
  color: var(--color-brand);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.hero-title {
  font-size: clamp(1.4rem, 2.8vw, 1.95rem);
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.25;
  margin-bottom: 0.65rem;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 0.975rem;
  max-width: 880px;
  line-height: 1.6;
}

/* Chips de Presets de Coches Populares */
.presets-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

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

.presets-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

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

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

.preset-chip-btn:hover {
  border-color: var(--color-brand);
  background: var(--color-brand-glow);
  transform: translateY(-2px);
}

.preset-chip-btn.active {
  border-color: var(--color-brand);
  background: var(--color-brand-glow);
  box-shadow: 0 0 0 2px var(--color-brand);
}

.preset-chip-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.3;
}

.preset-chip-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Grid del Formulario de Entrada */
.form-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .form-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-box {
  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: 1.15rem;
}

.form-box-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.form-box-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-brand-glow);
  color: var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-box-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

/* Inputs y Selects táctiles con reglas canónicas */
.form-input,
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0 0.9rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.925rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--color-brand-glow);
}

/* Regla canónica estricta para <select> */
.form-select {
  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 14px center;
  background-size: 16px;
  padding-right: 40px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Wrappers flexbox con sufijos/monedas */
.input-with-suffix {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

.input-with-suffix .form-input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  padding-right: 3rem;
}

.input-suffix {
  position: absolute;
  right: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

/* Fila de controles compacta (mes y año) */
.form-row-dual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

/* Checkbox estilizados táctiles */
.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.checkbox-card:hover {
  border-color: var(--color-brand);
}

.checkbox-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--color-brand);
  cursor: pointer;
}

.checkbox-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

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

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

/* Badge de depreciación calculada */
.depreciation-info-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.825rem;
}

.depreciation-info-pill strong {
  color: var(--color-brand);
  font-family: var(--font-mono);
}

/* Paneles condicionales */
.conditional-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-brand);
}

/* DASHBOARD DE RESULTADOS (COCKPIT) */
.results-cockpit {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
}

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

.cockpit-title-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cockpit-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-heading);
}

.cockpit-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Botones de acción del cockpit */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 40px;
  min-height: 40px;
  padding: 0 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  user-select: none;
}

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

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

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

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

/* Tarjetas KPI de Resumen Financiero */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .kpi-cards-grid {
    grid-template-columns: 1.35fr 1fr 1fr;
  }
}

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

.kpi-card-total {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, var(--bg-card-subtle) 100%);
  border-color: rgba(37, 99, 235, 0.3);
}

.kpi-card-saving {
  background: linear-gradient(135deg, var(--color-success-bg) 0%, var(--bg-card-subtle) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

.kpi-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-size: clamp(1.6rem, 2.8vw, 2.15rem);
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.15;
}

.kpi-card-total .kpi-value {
  color: var(--color-brand);
}

.kpi-card-saving .kpi-value {
  color: var(--color-success);
}

.kpi-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Semáforo de Rentabilidad y Veredicto */
.verdict-banner {
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border: 1px solid transparent;
}

.verdict-banner.verdict-super,
.verdict-banner.verdict-green {
  background: var(--color-success-bg);
  border-color: rgba(16, 185, 129, 0.35);
}

.verdict-banner.verdict-teal {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.35);
}

.verdict-banner.verdict-yellow {
  background: var(--color-warning-bg);
  border-color: rgba(245, 158, 11, 0.35);
}

.verdict-banner.verdict-red {
  background: var(--color-danger-bg);
  border-color: rgba(239, 68, 68, 0.35);
}

.verdict-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.verdict-super .verdict-icon,
.verdict-green .verdict-icon {
  background: var(--color-success);
  color: #ffffff;
}

.verdict-teal .verdict-icon {
  background: #0ea5e9;
  color: #ffffff;
}

.verdict-yellow .verdict-icon {
  background: var(--color-warning);
  color: #ffffff;
}

.verdict-red .verdict-icon {
  background: var(--color-danger);
  color: #ffffff;
}

.verdict-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.verdict-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.verdict-super .verdict-badge,
.verdict-green .verdict-badge {
  color: var(--color-success);
}

.verdict-teal .verdict-badge {
  color: #0ea5e9;
}

.verdict-yellow .verdict-badge {
  color: var(--color-warning);
}

.verdict-red .verdict-badge {
  color: var(--color-danger);
}

.verdict-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-heading);
}

.verdict-explanation {
  font-size: 0.875rem;
  color: var(--text-main);
  line-height: 1.5;
}

/* Barra Gráfica de Distribución de Costes */
.cost-bar-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cost-bar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cost-bar-progress {
  height: 24px;
  border-radius: 9999px;
  background: var(--bg-card-subtle);
  overflow: hidden;
  display: flex;
  border: 1px solid var(--border-color);
}

.cost-segment {
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}

.cost-segment-car { background: #3b82f6; }
.cost-segment-taxes { background: #f59e0b; }
.cost-segment-transport { background: #8b5cf6; }
.cost-segment-admin { background: #10b981; }

.cost-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.8rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Tabla Desglose Contable */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

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

.breakdown-table th,
.breakdown-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.breakdown-table th {
  background: var(--bg-card-subtle);
  font-weight: 700;
  color: var(--text-heading);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.breakdown-table tr:last-child td {
  border-bottom: none;
}

.breakdown-table .row-total {
  background: var(--bg-card-subtle);
  font-weight: 800;
  font-size: 0.95rem;
}

.breakdown-table .row-total td {
  color: var(--color-brand);
}

.text-right {
  text-align: right;
}

/* Cronograma Interactivo de los 6 Pasos */
.roadmap-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
}

.roadmap-header {
  margin-bottom: 1.5rem;
}

.roadmap-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-heading);
}

.roadmap-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .roadmap-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .roadmap-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.step-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
}

.step-card-text {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.step-card-doc {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--color-brand);
  background: var(--color-brand-glow);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  align-self: flex-start;
  margin-top: auto;
}

/* Checklist de Documentación */
.checklist-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
}

.checklist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .checklist-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.checklist-item:hover {
  background: var(--border-color);
}

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

.checklist-item-text {
  font-size: 0.85rem;
  color: var(--text-heading);
  line-height: 1.4;
}

.checklist-item-text small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Acordeón FAQ Canónico */
.faq-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

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

.faq-section-desc {
  color: var(--text-muted);
  font-size: 0.925rem;
  margin-bottom: 1.5rem;
}

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

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

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

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

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

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

.faq-item[open] .faq-icon-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-main);
  line-height: 1.65;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 0.25rem;
  padding-top: 0.85rem;
}

[data-theme="dark"] .faq-answer {
  border-top-color: rgba(255, 255, 255, 0.05);
}

/* Modales accesibles (sin window.alert) */
.custom-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: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

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

.custom-modal-backdrop.is-open .custom-modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Toast de feedback */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--color-brand);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive móvil */
@media (max-width: 640px) {
  .tool-layout {
    margin-top: 1rem;
    padding: 0 0.75rem;
  }

  .hero-card {
    padding: 1.25rem;
  }

  .form-box {
    padding: 1.15rem;
  }

  .results-cockpit {
    padding: 1.25rem;
  }

  .btn-action {
    width: 100%;
  }

  .cockpit-actions {
    width: 100%;
  }

  .verdict-banner {
    flex-direction: column;
    padding: 1rem;
  }

  .toast-notice {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* Estilos de Impresión (@media print) */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .tool-ad-sidebar,
  .tools-ad-banner-section,
  .cockpit-actions,
  .presets-section,
  .fijate-footer,
  .amazon-affiliate-section,
  .related-tools-section,
  .faq-section {
    display: none !important;
  }

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

  .results-cockpit,
  .form-box,
  .roadmap-section,
  .checklist-section {
    box-shadow: none !important;
    border: 1px solid #cccccc !important;
    page-break-inside: avoid;
  }
}
