/*!
 * Sistema de Teste Grátis + Assinatura via WhatsApp — Prime IPTV
 * Portado de SISTEMA-TESTE-WHATSAPP.md. Cores adaptadas à marca (roxo #580050).
 */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 1rem;
  align-items: center;
  justify-content: center;
  background: rgba(10, 0, 10, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.modal-overlay.active {
  display: flex;
  animation: waOverlayIn 0.25s ease forwards;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.6rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(163, 0, 144, 0.35);
  background: linear-gradient(160deg, rgba(38, 4, 34, 0.98), rgba(12, 2, 12, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  color: #fff;
  animation: waContentIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}
.modal-subtitle {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
}
.payment-label {
  margin-top: 1.1rem;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.btn-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn-close:hover {
  background: rgba(163, 0, 144, 0.55);
  transform: rotate(90deg);
}

.btn-back {
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-back:hover {
  background: rgba(163, 0, 144, 0.55);
}

.device-badge {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffd9f7;
  background: rgba(163, 0, 144, 0.28);
  border: 1px solid rgba(163, 0, 144, 0.45);
}
.plan-badge {
  margin: 0.2rem 0 1.1rem;
  white-space: normal;
}

/* ------------------------------- Grelha de dispositivos ---------------- */
.device-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.device-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.9rem 0.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.device-card:hover,
.device-card:focus-visible {
  outline: none;
  background: rgba(163, 0, 144, 0.25);
  border-color: rgba(163, 0, 144, 0.65);
  transform: translateY(-2px);
}
.device-emoji {
  font-size: 1.6rem;
  line-height: 1;
}
.device-label {
  line-height: 1.2;
}

/* ------------------------------- Inputs -------------------------------- */
.input-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}
.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.85;
  pointer-events: none;
  z-index: 2;
}
.glass-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}
.glass-input:focus {
  border-color: rgba(163, 0, 144, 0.8);
  box-shadow: 0 0 0 3px rgba(163, 0, 144, 0.25);
}
.text-input {
  padding-left: 2.9rem;
}
.phone-input {
  padding-left: 8.4rem;
}

/* --------------------------------- DDI --------------------------------- */
.ddi-wrapper {
  position: absolute;
  left: 2.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 5rem;
  height: 1.6rem;
  z-index: 3;
}
.ddi-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 1rem;
}
.ddi-display {
  display: flex;
  align-items: center;
  height: 100%;
  padding-right: 0.7rem;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
}

/* ----------------------------- Pagamento ------------------------------- */
.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}
.payment-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 0.5rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.payment-option:hover {
  border-color: rgba(163, 0, 144, 0.6);
}
.payment-option.active {
  background: rgba(163, 0, 144, 0.4);
  border-color: #a30090;
  box-shadow: 0 0 0 3px rgba(163, 0, 144, 0.25);
}

/* -------------------------- Botão principal ---------------------------- */
.action-btn {
  width: 100%;
  margin-top: 0.4rem;
  padding: 1rem;
  border: none;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #a30090, #580050);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(163, 0, 144, 0.45);
}
.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.modal-note {
  margin: 0.8rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* ------------------------------ Animações ------------------------------ */
@keyframes waOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes waContentIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 420px) {
  .modal-content { padding: 1.3rem; border-radius: 1.25rem; }
  .modal-title { font-size: 1.2rem; }
  .phone-input { padding-left: 7.8rem; }
  .ddi-wrapper { left: 2.6rem; width: 4.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay.active,
  .modal-content,
  .device-card,
  .btn-close,
  .action-btn {
    animation: none !important;
    transition: none !important;
  }
}
