/* ==========================================================================
   Traductor de recetas de gafas y lentillas — Estilos específicos
   Normas: Tipografías corporativas Outfit, Inter, JetBrains Mono
   Variables corporativas compartidas y soporte de modo claro/oscuro
   ========================================================================== */

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

  /* Paleta específica del traductor óptico */
  --optic-primary: #0284c7;
  --optic-primary-hover: #0369a1;
  --optic-primary-light: rgba(2, 132, 199, 0.12);
  --optic-accent: #06b6d4;
  --optic-accent-light: rgba(6, 182, 212, 0.15);
  --optic-od: #3b82f6;
  --optic-od-bg: rgba(59, 130, 246, 0.08);
  --optic-oi: #8b5cf6;
  --optic-oi-bg: rgba(139, 92, 246, 0.08);
  --optic-success: #10b981;
  --optic-warning: #f59e0b;
  --optic-danger: #ef4444;

  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Contención global conforme al estándar */
body {
  font-family: var(--font-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body, #0b0f17);
  color: var(--text-main, #e2e8f0);
}

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

.mono,
code,
.diopter-val,
.spec-val,
.kpi-value {
  font-family: var(--font-mono);
}

/* Layout de la herramienta */
.tool-layout {
  max-width: 1200px;
  margin: 1.25rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

.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%;
}

/* Barra lateral publicitaria */
.tool-ad-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: none;
}

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

/* Tarjeta principal contenedora */
.card-main {
  background: var(--bg-surface, #131b2a);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-xl);
  padding: 1.75rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  margin-bottom: 2rem;
}

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

/* Hero introductorio */
.tool-hero {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 1.75rem;
}

.tool-hero h2 {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.6rem;
  color: var(--text-heading, #f8fafc);
  letter-spacing: -0.02em;
}

.tool-hero p {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-muted, #94a3b8);
  margin: 0;
}

/* Barra de presets rápidos */
.presets-bar {
  background: var(--bg-surface-secondary, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-lg);
  padding: 0.85rem 1rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.presets-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.presets-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.preset-chip {
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  color: var(--text-main, #e2e8f0);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
}

.preset-chip:hover {
  background: var(--optic-primary-light);
  border-color: var(--optic-primary);
  color: #38bdf8;
  transform: translateY(-1px);
}

/* Rejilla de ojos OD / OI */
.rx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.eye-card {
  background: var(--bg-surface-secondary, rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  position: relative;
  transition: var(--transition-smooth);
}

.eye-card.eye-od {
  border-top: 3px solid var(--optic-od);
}

.eye-card.eye-oi {
  border-top: 3px solid var(--optic-oi);
}

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

.eye-badge-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.eye-pill {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.eye-od .eye-pill {
  background: var(--optic-od);
  color: #ffffff;
}

.eye-oi .eye-pill {
  background: var(--optic-oi);
  color: #ffffff;
}

.eye-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-heading, #f8fafc);
}

.eye-sublabel {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
}

/* Campos de entrada dentro de la tarjeta de ojo */
.eye-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-hint {
  font-size: 0.72rem;
  font-weight: normal;
  color: var(--text-subtle, #64748b);
  font-family: var(--font-mono);
}

/* Inputs y selects según las directrices canónicas */
.input-control,
.select-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: var(--border-radius-sm);
  padding: 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-main, #f8fafc);
  transition: var(--transition-fast);
  box-sizing: border-box;
}

.select-control {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  padding-right: 36px;
  background-image: url("data:svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.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;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.select-control option {
  background: #1e293b;
  color: #f8fafc;
}

[data-theme="light"] .select-control option {
  background: #ffffff;
  color: #0f172a;
}

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

/* Controles auxiliares: DP y botones de acción */
.rx-extra-bar {
  background: var(--bg-surface-secondary, rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.dp-input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 280px;
}

.dp-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
  white-space: nowrap;
}

.dp-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 140px;
}

.dp-input-wrap .input-control {
  height: 38px;
  min-height: 38px;
  text-align: center;
}

.dp-unit {
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-mono);
}

.rx-action-buttons {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn-secondary {
  height: 40px;
  min-height: 40px;
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: var(--border-radius-sm);
  padding: 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   SIMULADOR INTERACTIVO CANVAS ("¿Cómo veo yo el mundo sin gafas?")
   ========================================================================== */
.simulator-section {
  background: #090d14;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.simulator-header {
  padding: 1.15rem 1.4rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.sim-title-group h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sim-title-group p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
}

.sim-controls-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.eye-selector-tabs {
  display: inline-flex;
  background: #1e293b;
  padding: 3px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.eye-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 32px;
}

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

.btn-toggle-glasses {
  height: 36px;
  min-height: 36px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: var(--border-radius-sm);
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.btn-toggle-glasses:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
}

.btn-toggle-glasses.glasses-off {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Lienzo Canvas y contenedor de split-view */
.canvas-viewport-wrapper {
  position: relative;
  width: 100%;
  height: 480px;
  background: #000000;
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
}

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

#vision-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Indicadores de modo sobre el canvas */
.canvas-overlay-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
}

.badge-vision-state {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-state-unfocused {
  color: #f87171;
}

.badge-state-corrected {
  color: #34d399;
}

/* Divisor interactivo del split view */
.split-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #ffffff;
  cursor: ew-resize;
  z-index: 10;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
}

.split-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

/* Barra inferior del simulador: selector de escenas */
.simulator-footer {
  padding: 0.9rem 1.4rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.scene-selector-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.scene-buttons-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.btn-scene {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: var(--border-radius-sm);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 34px;
  transition: var(--transition-fast);
}

.btn-scene:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.btn-scene.active {
  background: var(--optic-primary-light);
  border-color: var(--optic-primary);
  color: #38bdf8;
  font-weight: 600;
}

/* ==========================================================================
   MÓDULOS DE DIAGNÓSTICO Y EXPLICACIÓN EN LENGUAJE LLANO
   ========================================================================== */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.result-card {
  background: var(--bg-surface-secondary, rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
}

.result-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.result-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--optic-primary-light);
  color: var(--optic-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-heading, #f8fafc);
}

.diagnosis-box {
  background: var(--bg-surface, #1e293b);
  border-left: 4px solid var(--optic-primary);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.diagnosis-eye-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--optic-primary);
  margin-bottom: 0.35rem;
}

.diagnosis-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-main, #f1f5f9);
  margin: 0;
}

.vision-impact-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.vision-impact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.45;
}

.vision-impact-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--optic-accent);
}

/* ==========================================================================
   RECOMENDADOR DE ÍNDICE DE CRISTAL (Evitar «culo de vaso»)
   ========================================================================== */
.index-recommender-card {
  background: var(--bg-surface-secondary, rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-xl);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.index-badge-optimal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.lens-thickness-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

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

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

.lens-col-card {
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-md);
  padding: 1.15rem;
  text-align: center;
  position: relative;
  transition: var(--transition-smooth);
}

.lens-col-card.is-recommended {
  border-color: var(--optic-primary);
  background: var(--optic-primary-light);
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.2);
}

.lens-col-card.is-recommended::before {
  content: 'RECOMENDADO';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--optic-primary);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.lens-index-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-heading, #f8fafc);
  margin-bottom: 0.2rem;
  font-family: var(--font-mono);
}

.lens-name {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 1rem;
}

/* Gráfico visual de sección de lente */
.lens-profile-visual {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.lens-svg-cross-section {
  max-width: 100%;
  height: 50px;
}

.lens-specs-mini {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.4;
  text-align: left;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   CONVERTIDOR A LENTILLAS (Distancia al vértice)
   ========================================================================== */
.contacts-converter-card {
  background: var(--bg-surface-secondary, rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-xl);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.contacts-comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.contacts-comparison-table th,
.contacts-comparison-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.contacts-comparison-table th {
  background: var(--bg-surface, #1e293b);
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  font-size: 0.82rem;
}

.contacts-comparison-table td {
  color: var(--text-main, #e2e8f0);
}

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

.contacts-advice-box {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--border-radius-md);
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #a5f3fc;
}

/* Transposición optométrica */
.transposition-card {
  background: var(--bg-surface-secondary, rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.transposition-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-surface, #1e293b);
  border-radius: var(--border-radius-md);
  margin-top: 0.75rem;
}

.transposition-col {
  text-align: center;
}

.transposition-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.transposition-formula {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading, #f8fafc);
}

.transposition-arrow {
  color: var(--optic-primary);
  font-size: 1.4rem;
}

/* Modal corporativo accesible */
.optic-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.optic-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.optic-modal {
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: var(--border-radius-xl);
  max-width: 520px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.optic-modal-overlay.is-active .optic-modal {
  transform: translateY(0) scale(1);
}

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

.optic-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-heading, #f8fafc);
}

.optic-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
}

.optic-modal-close:hover {
  color: #ffffff;
}

.optic-modal-body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-main, #cbd5e1);
  margin-bottom: 1.5rem;
}

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

/* ==========================================================================
   ACORDEÓN SEO Y PREGUNTAS FRECUENTES
   ========================================================================== */
.faq-accordion-group {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-md);
  background: var(--bg-surface-secondary, rgba(255, 255, 255, 0.02));
  overflow: hidden;
  transition: var(--transition-fast);
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.faq-trigger {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 1.15rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading, #f8fafc);
  gap: 1rem;
}

.faq-trigger:hover {
  color: var(--optic-primary);
}

.faq-chevron {
  transition: transform 0.25s ease;
  color: var(--text-muted, #94a3b8);
  flex-shrink: 0;
}

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

.faq-content {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-muted, #cbd5e1);
}

.faq-item.is-open .faq-content {
  display: block;
}

/* Ajustes adaptativos para móvil (< 600px) */
@media (max-width: 600px) {
  .eye-fields {
    grid-template-columns: 1fr;
  }

  .rx-extra-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .dp-input-group {
    justify-content: space-between;
  }

  .rx-action-buttons {
    width: 100%;
  }

  .rx-action-buttons .btn-secondary {
    flex: 1 1 auto;
    justify-content: center;
  }

  .simulator-header {
    flex-direction: column;
    align-items: stretch;
  }

  .sim-controls-top {
    justify-content: space-between;
  }
}
