/**
 * ImobERP subscribe modals — 3 isolated containers, strict `hidden` visibility.
 */

.imoberp-modal-open {
  overflow: hidden !important;
}

/* Tailwind CDN defines .hidden — reinforce for our modals */
.imoberp-modal.hidden,
.checkout-phase.hidden,
.imoberp-error.hidden,
#auth-register-view.hidden,
#checkout-pix-qr.hidden {
  display: none !important;
}

/* ─── Top-level modal shell (auth | checkout | success) ─── */
.imoberp-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

.imoberp-modal__backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.imoberp-modal__panel {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  max-width: 28rem !important;
  max-height: calc(100vh - 2rem) !important;
  overflow-y: auto !important;
  border-radius: 1rem !important;
  border: 1px solid rgba(251, 191, 36, 0.3) !important;
  background: #171717 !important;
  padding: 2rem 1.75rem !important;
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.2), 0 24px 48px rgba(0, 0, 0, 0.65) !important;
  color: #e5e5e5 !important;
  box-sizing: border-box !important;
}

.imoberp-modal__panel--wide { max-width: 32rem !important; }
.imoberp-modal__panel--success { max-width: 26rem !important; text-align: center !important; }

.imoberp-modal__close {
  position: absolute !important;
  top: 1rem !important;
  right: 1rem !important;
  border: none !important;
  background: transparent !important;
  color: #9ca3af !important;
  font-size: 1.25rem !important;
  cursor: pointer !important;
  padding: 0.25rem !important;
  line-height: 1 !important;
}
.imoberp-modal__close:hover { color: #fff !important; }

.imoberp-modal__header { margin-bottom: 1.25rem !important; }
.imoberp-modal__header--center { text-align: center !important; }

.imoberp-brand-title {
  margin: 0 !important;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  color: #fff !important;
}
.imoberp-brand-accent { color: #fbbf24 !important; }

.imoberp-modal__title {
  margin: 0 !important;
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: #fff !important;
}

.imoberp-modal__subtitle {
  margin: 0.35rem 0 0 !important;
  font-size: 0.875rem !important;
  color: #9ca3af !important;
}

.imoberp-badge {
  display: inline-block !important;
  margin-bottom: 0.5rem !important;
  padding: 0.2rem 0.6rem !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 215, 0, 0.35) !important;
  background: rgba(212, 175, 55, 0.12) !important;
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #ffd700 !important;
}

/* ─── Auth tabs ─── */
.imoberp-tabbar {
  display: flex !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  margin-bottom: 1.25rem !important;
}

.imoberp-tabbar__btn {
  flex: 1 !important;
  padding: 0.65rem 0.5rem !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  background: transparent !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: #9ca3af !important;
  cursor: pointer !important;
}
.imoberp-tabbar__btn.is-active {
  color: #fbbf24 !important;
  border-bottom-color: #fbbf24 !important;
}

.imoberp-auth-switch {
  margin: 0.25rem 0 0 !important;
  text-align: center !important;
  font-size: 0.8125rem !important;
  color: #9ca3af !important;
}
.imoberp-auth-switch-link {
  border: none !important;
  background: none !important;
  color: #fbbf24 !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  text-decoration: underline !important;
  padding: 0 !important;
  margin-left: 0.25rem !important;
}

/* ─── Forms ─── */
.imoberp-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.9rem !important;
}

.imoberp-field { display: block !important; }

.imoberp-label {
  display: block !important;
  margin-bottom: 0.4rem !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  color: #d4d4d4 !important;
}
.imoberp-label--section {
  margin-bottom: 0.65rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  font-size: 0.75rem !important;
  color: #ffd700 !important;
}

.imoberp-input {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-radius: 0.65rem !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(12px) !important;
  padding: 0.72rem 0.85rem !important;
  font-size: 0.9rem !important;
  color: #fff !important;
  outline: none !important;
}
.imoberp-input:focus {
  border-color: rgba(251, 191, 36, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18) !important;
}
.imoberp-input--code {
  font-family: ui-monospace, monospace !important;
  font-size: 0.72rem !important;
  min-height: 4.5rem !important;
  resize: none !important;
}

.imoberp-btn-gold {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  border: none !important;
  border-radius: 0.75rem !important;
  padding: 0.85rem 1.25rem !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: #000 !important;
  cursor: pointer !important;
  background: linear-gradient(135deg, #996515 0%, #d4af37 48%, #ffd700 100%) !important;
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.28) !important;
}
.imoberp-btn-gold:disabled { opacity: 0.55 !important; cursor: not-allowed !important; }

.imoberp-error {
  margin: 0 !important;
  padding: 0.55rem 0.75rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.8125rem !important;
  color: #fca5a5 !important;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

/* ─── Checkout module radios ─── */
.imoberp-field--modules {
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.imoberp-field--modules legend {
  padding: 0 !important;
  margin-bottom: 0.65rem !important;
}
.imoberp-module-radios--register {
  margin-bottom: 0.25rem !important;
}

.imoberp-module-radios {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  margin-bottom: 1rem !important;
}

.imoberp-module-radio {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.75rem !important;
  border-radius: 0.75rem !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  cursor: pointer !important;
  transition: border-color 0.2s !important;
}
.imoberp-module-radio:has(input:checked) {
  border-color: rgba(251, 191, 36, 0.55) !important;
  background: rgba(212, 175, 55, 0.08) !important;
}
.imoberp-module-radio input {
  accent-color: #d4af37 !important;
  flex-shrink: 0 !important;
}
.imoberp-module-radio__emoji { font-size: 1.25rem !important; }
.imoberp-module-radio__body { display: flex !important; flex-direction: column !important; }
.imoberp-module-radio__title { font-size: 0.875rem !important; font-weight: 600 !important; color: #fff !important; }
.imoberp-module-radio__price { font-size: 0.75rem !important; color: #9ca3af !important; }

/* ─── Checkout phases ─── */
.checkout-phase { display: block !important; }

.imoberp-loading {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.75rem !important;
  padding: 2rem 0 !important;
  color: #ffd700 !important;
  font-size: 0.875rem !important;
}

.imoberp-spinner {
  width: 26px !important;
  height: 26px !important;
  border: 3px solid rgba(212, 175, 55, 0.2) !important;
  border-top-color: #ffd700 !important;
  border-radius: 50% !important;
  animation: imoberp-spin 0.75s linear infinite !important;
}
@keyframes imoberp-spin { to { transform: rotate(360deg); } }

.imoberp-qr-wrap {
  display: flex !important;
  justify-content: center !important;
  margin-bottom: 0.75rem !important;
}
.imoberp-qr-wrap img {
  border-radius: 0.75rem !important;
  background: #fff !important;
  padding: 0.5rem !important;
  max-width: 220px !important;
}

.imoberp-polling {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  margin: 0.75rem 0 0 !important;
  font-size: 0.78rem !important;
  color: #9ca3af !important;
}
.imoberp-polling-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #ffd700 !important;
  animation: imoberp-pulse 1.2s ease-in-out infinite !important;
}
@keyframes imoberp-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* ─── Success modal ─── */
.imoberp-success { padding: 1rem 0 !important; }
.imoberp-success__icon { font-size: 3rem !important; line-height: 1 !important; }
.imoberp-success__title {
  margin: 0.75rem 0 0.35rem !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #6ee7b7 !important;
}
.imoberp-success__text { color: #9ca3af !important; font-size: 0.875rem !important; margin: 0 !important; }
