@font-face {
  font-family: "Telefonica";
  src: url("./fonts/Telefonica-Regular.otf") format("truetype");
  font-weight: 400; /* Regular */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Telefonica";
  src: url("./fonts/Telefonica-Regular.otf") format("truetype");
  font-weight: 700; /* Bold */
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------- 
  THEME COLORS (Variables Centralizadas)
---------------------------------------------------- */
:root {
  --rgb-background: 15, 23, 42; /* Equivalente a #0f172a (slate-900) */
  --color-primary: #0b9cea; /* Azul personalizado */
  --color-primary-hover: #0b9cea; /* Azul más claro para hover */
  --color-background: #0f172a;
  --color-surface: #1e293b;
  --color-surface-light: #334155;
  --color-text-base: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-bg-gray: #6b6c6f;
  --color-border: #475569;
  --color-success: #22c55e; /* green-500 */
}

/* --- Clases de Color Personalizadas --- */
.bg-primary {
  background-color: var(--color-primary);
}
.bg-background-80 {
  background-color: rgba(var(--rgb-background), 0.8);
}
.bg-background {
  background-color: var(--color-background);
}
.bg-surface {
  background-color: var(--color-surface);
}
.bg-surface-light {
  background-color: var(--color-surface-light);
}
.text-primary {
  color: var(--color-primary);
}
.text-text-base {
  color: var(--color-text-base);
}
.text-text-muted {
  color: var(--color-text-muted);
}
.text-success {
  color: var(--color-success);
}
.border-primary {
  border-color: var(--color-primary);
}
.border-border {
  border-color: var(--color-border);
}
.hover\:bg-primary-hover:hover {
  background-color: var(--color-primary-hover);
}
.hover\:bg-surface-light:hover {
  background-color: var(--color-surface-light);
}
.hover\:border-white:hover {
  border-color: white;
}
.hover\:text-white:hover {
  color: white;
}

/* --- Estilos Generales del Sitio --- */

body {
  font-family: "Telefonica", sans-serif;
  background-color: var(--color-background);
  color: var(--color-text-base);
}

#main-content {
  position: relative;
  z-index: 2;
  background-color: var(--color-background);
}

.plan-popular {
  border-color: var(--color-primary);
}

#plans-grid > div,
#features-grid > div {
  transition:
    transform 0.3s ease-in-out,
    box-shadow 0.3s ease-in-out;
}

#plans-grid > div:hover,
#features-grid > div:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px color-mix(in srgb, var(--color-primary) 60%, transparent); /* CORREGIDO: Usa variable */
}

.modal {
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.modal:not(.open) {
  opacity: 0;
  visibility: hidden;
}
.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}
.modal-content::-webkit-scrollbar-track {
  background: var(--color-surface);
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.channel-item {
  width: 80px;
  height: 80px;
  border-radius: 9999px;
  background-color: var(--color-surface-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.5rem;
  transition: all 0.3s ease-in-out;
  padding: 12px;
  font-weight: 600;
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* --- Lógica del Precio Oculto --- */
.hidden {
  display: none !important;
}

.price-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem; /* Ajusta según tu diseño */
  font-weight: bold;
  color: var(--primary-blue); /* Usa tu variable de color */
}

.price-hidden-text {
  font-weight: bold;
  letter-spacing: 2px; /* Hace que los asteriscos se vean mejor */
  color: var(--primary-blue);
}

.btn-eye {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.btn-eye:hover {
  opacity: 0.7;
}

.icon-eye {
  width: 24px;
  height: 24px;
  /* Asegúrate de tener la imagen o usa un SVG */
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.animate-spin {
  animation: spin 1s linear infinite;
}

/* Adaptación para pantallas más grandes */
@media (min-width: 640px) {
  .manual-carousel-track {
    padding-left: 1.5rem;
  }
  .manual-card {
    flex-basis: 35%;
  }
  .manual-card:last-child {
    margin-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .manual-card {
    flex-basis: 25%;
  }
}

/* =========================
   OTP Gate (Overlay / Popup)
   ========================= */

body.otp-locked {
  overflow: hidden;
}

/* Bloquea interacción visual con el contenido original sin modificarlo */
body.otp-locked main,
body.otp-locked #cutoff-section,
body.otp-locked #planes,
body.otp-locked #plan-details-modal,
body.otp-locked #confirmation-modal,
body.otp-locked #payment-modal {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
}

.otp-gate-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-base);
  margin-bottom: 8px;
}

.otp-gate-label-hint {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.otp-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999; /* por encima de tus modales actuales */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(var(--rgb-background), 0.85); /* coherente con tu theme */
  backdrop-filter: blur(6px);
}

.otp-gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.otp-gate-header {
  text-align: center;
  margin-bottom: 18px;
}

.otp-gate-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-text-base);
  margin: 0 0 6px 0;
}

.otp-gate-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.otp-gate-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 8px;
}

.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-text-base);
  background: var(--color-surface-light);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.otp-digit:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.otp-digit--error {
  border-color: #ff4d6d !important;
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.25);
  background: color-mix(in srgb, var(--color-surface-light) 85%, #ff4d6d 15%);
}

.otp-gate-error {
  text-align: center;
  color: #ff4d6d;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
  padding: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.18s ease,
    opacity 0.18s ease,
    margin 0.18s ease;
}

.otp-gate-error--hidden {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

.otp-gate-error--visible {
  max-height: 48px;
  opacity: 1;
  margin: 8px 0 16px;
}

.otp-gate-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.08s ease,
    opacity 0.2s ease,
    background-color 0.2s ease;
}

.otp-gate-btn:active {
  transform: scale(0.99);
}

.otp-gate-btn-primary {
  background: var(--color-primary);
  color: white;
}

.otp-gate-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.otp-gate-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.9rem;
}

.otp-gate-muted {
  color: var(--color-text-muted);
}

.otp-gate-link {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.otp-gate-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================
   OTP Gate - Phone Step
   ========================= */

.otp-gate-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-base);
  margin-bottom: 8px;
}

.otp-gate-label-hint {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.otp-gate-phone-input {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  background: var(--color-surface-light);
  border: 2px solid var(--color-border);
  color: var(--color-text-base);
  padding: 0 14px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.otp-gate-phone-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.otp-phone-error {
  margin-top: 8px;
  margin-bottom: 4px;
  color: #ff4d6d;
  font-weight: 600;
  font-size: 0.85rem;
}

/* =========================
   OTP Error dinámico (como pediste)
   - margen SOLO si hay error
   ========================= */

.otp-gate-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 8px; /* compacto sin error */
}

.otp-gate-error {
  text-align: center;
  color: #ff4d6d;
  font-weight: 600;
  font-size: 0.9rem;

  margin: 0; /* SIN margen por defecto */
  max-height: 0;
  opacity: 0;
  overflow: hidden;

  transition:
    max-height 0.18s ease,
    opacity 0.18s ease,
    margin 0.18s ease;
}

.otp-gate-error--hidden {
  max-height: 0;
  opacity: 0;
  margin: 0; /* SIN margen */
}

.otp-gate-error--visible {
  max-height: 48px;
  opacity: 1;
  margin: 8px 0 16px; /* margen solo cuando aparece */
}

/* Inputs marcados en error */
.otp-digit--error {
  border-color: #ff4d6d !important;
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.25);
  background: color-mix(in srgb, var(--color-surface-light) 85%, #ff4d6d 15%);
}

/* =========================
   OTP Gate - Spacing system
   ========================= */
:root {
  --otp-s1: 6px;
  --otp-s2: 10px;
  --otp-s3: 14px;
  --otp-s4: 18px;
  --otp-s5: 24px;
}

/* Card base */
.otp-gate-card {
  padding: 22px; /* ok */
}

/* Header spacing */
.otp-gate-header {
  text-align: center;
  margin-bottom: var(--otp-s4);
}

.otp-gate-title {
  margin: 0 0 var(--otp-s1) 0;
}

.otp-gate-subtitle {
  margin: 0;
}

/* Phone step spacing */
#otp-step-phone .otp-gate-label {
  margin: 0 0 var(--otp-s2) 0;
}

#otp-step-phone .otp-gate-phone-input {
  margin: 0; /* controlado por el error y el botón */
}

/* Phone error spacing: solo si visible (usa tu .hidden global display:none) */
#otp-phone-error {
  margin: var(--otp-s2) 0 var(--otp-s3);
}

/* Botón continuar: separación consistente */
#otp-phone-continue {
  margin-top: var(--otp-s3);
}

/* =========================
   OTP Step spacing
   ========================= */

/* Inputs: espacio inferior pequeño si no hay error */
.otp-gate-inputs {
  margin: var(--otp-s4) 0 var(--otp-s2);
}

/* Error OTP (margen solo cuando aparece, como pediste) */
.otp-gate-error {
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.18s ease,
    opacity 0.18s ease,
    margin 0.18s ease;
}

.otp-gate-error--hidden {
  max-height: 0;
  opacity: 0;
  margin: 0; /* sin margen */
}

.otp-gate-error--visible {
  max-height: 56px;
  opacity: 1;
  margin: var(--otp-s2) 0 var(--otp-s4); /* margen grande SOLO con error */
}

/* Verify button spacing */
#otp-gate-verify {
  margin-top: 0; /* el error ya empuja si aplica */
}

/* Footer spacing */
.otp-gate-footer {
  margin-top: var(--otp-s3);
}

/* Inputs marcados en error */
.otp-digit--error {
  border-color: #ff4d6d !important;
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.25);
  background: color-mix(in srgb, var(--color-surface-light) 85%, #ff4d6d 15%);
}

/* =========================
   Modal confirmación interno
   ========================= */
.otp-confirm-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--otp-s4);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.otp-confirm--hidden {
  display: none;
}

.otp-confirm-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: var(--otp-s4);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  position: relative;
}

.otp-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--otp-s3);
}

.otp-confirm-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text-base);
}

.otp-confirm-x {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.otp-confirm-x:hover {
  color: var(--color-text-base);
}

.otp-confirm-text {
  margin: 0 0 var(--otp-s4) 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: left;
}

.otp-confirm-actions {
  display: flex;
  gap: var(--otp-s2);
}

.otp-confirm-btn {
  flex: 1;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
}

.otp-confirm-btn-secondary {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}
.otp-confirm-btn-secondary:hover {
  background: #3b4a63;
}

.otp-confirm-btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.otp-confirm-btn-primary:hover {
  background: var(--color-primary-hover);
}
