/* ═══════════════════════════════════════════════════════
   Suscripción AutoFocus — Modal + Configurador de Plan
   ═══════════════════════════════════════════════════════ */

/* ── Sección #planes en la landing ───────────────────── */
.af-planes-intro {
  text-align: center;
  margin-bottom: 48px;
}
.af-planes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.af-plan-card {
  background: rgba(10,30,44,.55);
  border: 1px solid rgba(126,184,247,.12);
  border-radius: 16px;
  padding: 24px 20px;
  transition: border-color .2s, transform .2s;
}
.af-plan-card:hover {
  border-color: rgba(255,96,34,.35);
  transform: translateY(-3px);
}
.af-plan-card--obligatorio {
  border-color: rgba(255,96,34,.3);
}
.af-plan-badge-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}
.af-plan-badge-tag--obligatorio { background: rgba(255,96,34,.15); color: #ff9060; }
.af-plan-badge-tag--opcional    { background: rgba(126,184,247,.12); color: #7eb8f7; }
.af-plan-badge-tag--gratis      { background: rgba(52,211,153,.12); color: #34d399; }

.af-plan-card h3 { font-size: 16px; font-weight: 700; color: #f8fafc; margin-bottom: 8px; }
.af-plan-price   { font-size: 28px; font-weight: 800; color: var(--orange); margin: 8px 0 2px; line-height: 1; }
.af-plan-price span { font-size: 14px; font-weight: 400; color: var(--muted); }
.af-plan-unit    { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.af-plan-desc    { font-size: 13px; color: var(--muted); line-height: 1.6; }

.af-planes-cta   { text-align: center; margin-top: 40px; }

/* ── Overlay ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,18,29,.88);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal container ──────────────────────────────────── */
.modal-box {
  background: #0f2233;
  border: 1px solid rgba(126,184,247,.15);
  border-radius: 20px;
  width: 100%;
  max-width: 960px;
  position: relative;
  animation: modalIn .25s ease;
}
@keyframes modalIn {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,.08); }

.modal-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.modal-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 4px;
}
.modal-header p {
  font-size: 13px;
  color: var(--muted);
}

/* ── Cuerpo: dos columnas ─────────────────────────────── */
.modal-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
}
@media (max-width: 700px) {
  .modal-body { grid-template-columns: 1fr; }
}

/* ── Columna izquierda: módulos ───────────────────────── */
.modal-modulos {
  padding: 24px 28px;
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 700px) {
  .modal-modulos { border-right: none; border-bottom: 1px solid rgba(255,255,255,.06); }
}

.modulo-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color .15s;
}
.modulo-card.selected { border-color: rgba(255,96,34,.4); background: rgba(255,96,34,.04); }

.modulo-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modulo-card-info { flex: 1; }
.modulo-card-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.modulo-card-label input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
  cursor: pointer;
  flex-shrink: 0;
}
.modulo-card-title { font-size: 15px; font-weight: 700; color: #f0f4f8; }
.modulo-card-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.modulo-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
  text-align: right;
}
.modulo-card-price small { font-size: 11px; font-weight: 400; color: var(--muted); display: block; }
.modulo-card-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.badge-obligatorio { background: rgba(255,96,34,.15); color: #ff9060; }
.badge-opcional    { background: rgba(126,184,247,.1);  color: #7eb8f7; }
.badge-gratis      { background: rgba(52,211,153,.1);   color: #34d399; }

/* Stepper */
.modulo-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.05);
}
.modulo-stepper label { font-size: 12px; color: var(--muted); flex: 1; }
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  overflow: hidden;
}
.stepper button {
  background: none;
  border: none;
  color: var(--orange);
  font-size: 18px;
  font-weight: 700;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper button:hover { background: rgba(255,96,34,.1); }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper input {
  width: 42px;
  text-align: center;
  background: none;
  border: none;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 700;
  outline: none;
}

/* Aviso chatbot */
.aviso-chatbot {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(246,200,49,.06);
  border: 1px solid rgba(246,200,49,.2);
  border-radius: 8px;
  font-size: 12px;
  color: #f0d060;
  line-height: 1.5;
  display: none;
}
.aviso-chatbot.visible { display: block; }

/* Packs IA extra */
.modulo-packs {
  display: none;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.05);
}
.modulo-packs.visible { display: block; }
.modulo-packs .modulo-stepper { margin-top: 0; padding-top: 0; border-top: none; }
.modulo-packs-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ── Columna derecha: resumen + contacto ──────────────── */
.modal-sidebar {
  padding: 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Resumen de precios */
.resumen-box {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 18px;
}
.resumen-box h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 14px;
}
.resumen-lineas { display: flex; flex-direction: column; gap: 6px; }
.resumen-linea {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: #c8d8e8;
}
.resumen-linea .rl-label { flex: 1; }
.resumen-linea .rl-val   { font-weight: 600; white-space: nowrap; margin-left: 12px; }
.resumen-sep {
  border: none;
  border-top: 1px dashed rgba(255,255,255,.1);
  margin: 10px 0;
}
.resumen-subtotal { color: #e2e8f0; font-size: 13px; }
.resumen-iva      { color: var(--muted); font-size: 12px; }
.resumen-total-uf { font-size: 14px; font-weight: 700; color: #f0f4f8; }
.resumen-sep-full {
  border: none;
  border-top: 1px solid rgba(255,255,255,.12);
  margin: 10px 0;
}
.resumen-total-clp {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
}
.resumen-total-clp .label { font-size: 12px; color: var(--muted); }
.resumen-total-clp .amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--orange);
}
.resumen-uf-ref {
  font-size: 11px;
  color: #4a6070;
  margin-top: 6px;
  text-align: right;
}
.resumen-loading { color: var(--muted); font-size: 13px; text-align: center; padding: 8px 0; }

/* Formulario de contacto */
.contacto-form h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 14px;
}
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) { .cf-row { grid-template-columns: 1fr; } }
.cf-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cf-group label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.cf-group input  {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 9px 12px;
  color: #e2e8f0;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s;
  width: 100%;
}
.cf-group input:focus { outline: none; border-color: var(--orange); }
.cf-group.full { grid-column: 1 / -1; }

.btn-pagar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  margin-top: 4px;
  background: var(--orange);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  font-family: inherit;
}
.btn-pagar:hover:not(:disabled) {
  background: #e05015;
  box-shadow: 0 6px 20px rgba(255,96,34,.4);
}
.btn-pagar:active { transform: scale(.98); }
.btn-pagar:disabled { opacity: .55; cursor: not-allowed; }

.pagar-hint {
  text-align: center;
  font-size: 11px;
  color: #4a6070;
  margin-top: 8px;
  line-height: 1.5;
}
.pagar-hint a { color: var(--muted); }

/* Error message */
.modal-error {
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.25);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 13px;
  padding: 10px 14px;
  margin-top: 10px;
  display: none;
}
.modal-error.visible { display: block; }

/* Footer del modal */
.modal-footer {
  padding: 14px 28px;
  border-top: 1px solid rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-footer-note {
  font-size: 11px;
  color: #4a6070;
}
.modal-footer-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: #4a6070;
}
