/**
 * Simulador de Maniobras en Garajes Estrechos y Marcha Atrás con Remolque 3D
 * Hoja de estilos canónica y responsive (css/style.css)
 * fijate.com
 */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Tema oscuro Midnight Slate (predeterminado) */
  --bg-page: #0b0f17;
  --bg-card: #131b2a;
  --bg-card-subtle: #192438;
  --bg-input: #0f172a;
  --border-color: #24344d;
  --border-focus: #38bdf8;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Acentos automotrices */
  --accent-cyan: #38bdf8;
  --accent-blue: #2563eb;
  --accent-indigo: #6366f1;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-green: #10b981;

  --shadow-card: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.18);
  --radius-card: 16px;
  --radius-btn: 10px;
}

/* Modo claro automático o manual */
[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #0284c7;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --shadow-card: 0 6px 20px -2px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.12);
}

/* Reset y contención de ancho de viewport */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  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;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin-top: 0;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
}

.text-mono {
  font-family: var(--font-mono);
}

/* Layout principal */
.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;
  max-width: 100%;
}

/* Sidebar AdSense Desktop (>= 1536 px) */
.tool-ad-sidebar {
  display: none;
  width: 300px;
  flex-shrink: 0;
}

.sticky-ad-box {
  position: sticky;
  top: 85px;
  width: 300px;
  min-height: 600px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

@media (min-width: 1536px) {
  .tool-ad-sidebar {
    display: block;
  }
}

/* Banner publicitario superior horizontal */
.tools-ad-banner-section {
  width: 100%;
  margin-bottom: 1.5rem;
  min-height: 90px;
  background: var(--bg-card-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Navegación por pestañas de modo */
.mode-nav-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card-subtle);
  padding: 0.4rem;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1 1 0%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  text-align: center;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
}

@media (max-width: 640px) {
  .mode-nav-tabs {
    flex-direction: column;
    gap: 0.4rem;
  }
}

/* Visor del Simulador 3D */
.sim-viewport-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 1.75rem;
  position: relative;
}

.sim-header-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.vehicle-badge-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

.camera-selector-group {
  display: inline-flex;
  gap: 0.3rem;
  background: var(--bg-card);
  padding: 0.2rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-color);
}

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

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

.cam-btn.active {
  background: var(--accent-cyan);
  color: #0b0f17;
  font-weight: 700;
}

@media (max-width: 640px) {
  .cam-btn span {
    display: none;
  }
  .cam-btn {
    padding: 0.4rem 0.6rem;
  }
}

/* Contenedor del Canvas 3D */
.sim-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 480px;
  background: #0b0f17;
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 768px) {
  .sim-canvas-wrapper {
    height: 400px;
  }
}

/* HUD de Telemetría Flotante */
.sim-telemetry-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 10;
  pointer-events: none;
  flex-wrap: wrap;
}

.hud-item {
  display: flex;
  flex-direction: column;
  padding: 0 0.4rem;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-item:last-child {
  border-right: none;
}

.hud-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 700;
}

.hud-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.hud-val small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hud-sensor-item .hud-val {
  color: var(--accent-green);
  transition: color 0.2s ease;
}

/* Dial de Tijera (Modo Remolque) */
.hud-jackknife-card {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 220px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 10;
  pointer-events: none;
}

.jackknife-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.jackknife-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.jackknife-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.jackknife-badge.safe {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.jackknife-badge.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.jackknife-badge.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.jackknife-meter {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.jackknife-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 60%, #ef4444 100%);
  transition: width 0.1s linear;
}

.jackknife-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

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

/* Retrovisores virtuales dinámicos */
.hud-mirror-left, .hud-mirror-right {
  position: absolute;
  top: 75px;
  width: 110px;
  height: 65px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hud-mirror-left {
  left: 12px;
}

.hud-mirror-right {
  right: 12px;
}

.mirror-label {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.58rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
}

.mirror-view {
  width: 100%;
  height: 100%;
  position: relative;
  background: #0f172a;
}

.mirror-trailer-guide {
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 35px;
  background: #38bdf8;
  border-radius: 2px;
  transform-origin: bottom center;
  transition: transform 0.1s ease;
}

#mirror-guide-left {
  right: 25px;
}

#mirror-guide-right {
  left: 25px;
}

@media (max-width: 640px) {
  .hud-mirror-left, .hud-mirror-right {
    display: none;
  }
}

/* Controles táctiles móviles integrados */
.sim-mobile-controls {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 15;
}

.touch-gear-selector {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.btn-touch-gear {
  flex: 1 1 0%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.15s ease;
}

.btn-touch-gear.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}

.touch-steering-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.btn-touch-control {
  flex: 1 1 0%;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  backdrop-filter: blur(6px);
}

.btn-touch-control:active {
  background: var(--accent-cyan);
  color: #0b0f17;
}

.touch-pedals-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.btn-touch-pedal {
  flex: 1 1 0%;
  height: 46px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-pedal-brake {
  background: #dc2626;
  color: #ffffff;
}

.btn-pedal-brake:active {
  background: #b91c1c;
}

.btn-pedal-gas {
  background: #16a34a;
  color: #ffffff;
}

.btn-pedal-gas:active {
  background: #15803d;
}

/* Barra de acciones rápidas */
.sim-action-bar {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.btn-action-primary, .btn-action-secondary, .btn-action-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 42px;
}

.btn-action-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-action-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.btn-action-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-action-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-action-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
}

.btn-action-ghost:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

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

/* Grilla de Configuración de Parámetros */
.params-cockpit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 860px) {
  .params-cockpit-grid {
    grid-template-columns: 1fr;
  }
}

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

.card-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.card-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
}

.card-heading {
  font-size: 1.15rem;
  margin: 0;
}

.form-group {
  margin-bottom: 1rem;
}

.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

/* Reglas canónicas para desplegables <select> */
.form-control.select-clean {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 42px;
  padding: 0 40px 0 0.85rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  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 14px center;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.form-control.select-clean:focus {
  outline: none;
  border-color: var(--border-focus);
}

.form-control.select-clean option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.inputs-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

/* Reglas canónicas para inputs en flex con sufijo */
.input-unit-wrapper {
  display: flex;
  align-items: stretch;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  overflow: hidden;
  height: 42px;
  transition: border-color 0.2s ease;
}

.input-unit-wrapper:focus-within {
  border-color: var(--border-focus);
}

.input-unit-wrapper .form-control {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.input-unit-wrapper .form-control:focus {
  outline: none;
}

.unit-tag {
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border-left: 1px solid var(--border-color);
  user-select: none;
}

.checkbox-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (max-width: 480px) {
  .checkbox-options-grid {
    grid-template-columns: 1fr;
  }
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.custom-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.trailer-tip-box {
  display: flex;
  gap: 0.65rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-btn);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  color: var(--accent-amber);
  align-items: flex-start;
}

.trailer-tip-box p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Dashboard de Diagnóstico Cinemático */
.diagnostic-cockpit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
}

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

.diagnostic-badge-title {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
}

.diagnostic-main-heading {
  font-size: 1.25rem;
  margin: 0;
}

.verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
}

.verdict-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.verdict-caution {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.verdict-fail {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

@media (max-width: 500px) {
  .kpi-cards-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-stat-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.kpi-number {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-number small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kpi-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.kpi-subtext strong {
  color: var(--accent-cyan);
}

.recommendations-box {
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-btn);
  padding: 1.25rem;
}

.rec-title {
  font-size: 0.95rem;
  margin: 0 0 0.65rem 0;
  color: var(--accent-cyan);
}

.rec-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.rec-list li {
  margin-bottom: 0.45rem;
}

.rec-list li:last-child {
  margin-bottom: 0;
}

/* Guía Técnica y FAQ */
.educational-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.guide-heading {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
}

.guide-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.guide-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 1.25rem;
}

.guide-card-title {
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 0.65rem;
  color: var(--text-main);
}

.guide-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.75rem 0;
}

.guide-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

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

.faq-section-title {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

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

.faq-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  overflow: hidden;
}

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

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

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

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

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

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

/* Modal Corporativo Accesible (sin window.alert) */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 23, 0.8);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.app-modal-backdrop.active {
  display: flex;
}

.app-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.app-modal-title {
  font-size: 1.15rem;
  margin: 0;
}

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

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

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

.app-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-color);
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 0.65rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 42px;
}

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

/* Reglas de impresión */
@media print {
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .sim-mobile-controls,
  .sim-action-bar,
  .app-header,
  .fijate-footer {
    display: none !important;
  }
  .tool-layout {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
}
