/* =========================================
   MODAL — KEYFRAMES
   ========================================= */
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(14px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

@keyframes gridReveal {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================
   MODAL SER SOCIO
   ========================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.activo {
  opacity: 1;
  visibility: visible;
}

.modal-overlay.activo .modal-box {
  animation: modalIn 0.32s ease both;
}

.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px 36px;
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-cerrar {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #94A3B8;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.2s;
}
.modal-cerrar:hover { color: #2D2DE4; }

.modal-titulo {
  font-family: 'Bugaki', sans-serif;
  font-size: 1.8rem;
  color: #2D2DE4;
  margin-bottom: 6px;
  text-align: center;
}

.modal-subtitulo {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: #94A3B8;
  text-align: center;
  margin-bottom: 32px;
}

/* --- Planes --- */
.planes-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.plan-card {
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.plan-card:hover {
  border-color: #2D2DE4;
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(45, 45, 228, 0.12);
}

/* Grilla aparece como bloque completo — suave, rápida, profesional */
.planes-grid.animado {
  animation: gridReveal 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.08s;
}

.plan-card.destacado {
  border-color: #FFB70D;
  background: #fffbf0;
}

.plan-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 183, 13, 0.2), transparent);
  transform: skewX(-15deg);
  transition: left 0.55s ease;
  pointer-events: none;
}

.plan-card:hover::after {
  left: 150%;
}

.plan-icono {
  font-size: 1.8rem;
}

.plan-nombre {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2D2DE4;
  line-height: 1.3;
}

.plan-precio {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2D2DE4;
  margin: 0;
}

.plan-precio span {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94A3B8;
}

.btn-suscribir {
  background: #FFB70D;
  color: #2D2DE4;
  border: none;
  border-radius: 50px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 10px 16px;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s;
  margin-top: auto;
}
.btn-suscribir:hover { opacity: 0.85; }

/* --- Formulario --- */
.form-wrapper {
  max-width: 420px;
  margin: 0 auto;
}

.form-wrapper.entrando {
  animation: fadeSlideIn 0.3s ease both;
}

.btn-volver {
  background: none;
  border: none;
  color: #94A3B8;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.btn-volver:hover { color: #2D2DE4; }

.form-titulo {
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2D2DE4;
  margin-bottom: 4px;
}

.form-precio-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #FFB70D;
  margin-bottom: 24px;
}

.form-grupo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-grupo label {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2D2DE4;
}

.form-grupo input {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s;
}
.form-grupo input:focus {
  border-color: #2D2DE4;
  box-shadow: 0 0 0 3px rgba(45, 45, 228, 0.15);
}
.form-grupo input.invalido { border-color: #ef4444; }

.form-error {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: #ef4444;
  min-height: 16px;
}

.btn-confirmar {
  width: 100%;
  background: #2D2DE4;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 16px;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
}
.btn-confirmar:hover { opacity: 0.88; }
.btn-confirmar:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-confirmar.cargando {
  pointer-events: none;
}

.btn-confirmar.cargando::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}

.form-nota {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: #94A3B8;
  margin-top: 12px;
}

.form-exito p {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #16a34a;
  background: #f0fdf4;
  border-radius: 10px;
  padding: 20px;
  margin-top: 16px;
}

.form-error-global p {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #dc2626;
  background: #fef2f2;
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
}

/* =========================================
   RESPONSIVE MODAL
   ========================================= */
@media (max-width: 768px) {
  .modal-box {
    padding: 32px 20px 28px;
  }

  .planes-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .plan-card:last-child {
    grid-column: 1 / -1;
  }
}

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

  .plan-card:last-child {
    grid-column: auto;
  }
}
