/* ═══════════════════════════════════════════════════════════════════════════
   br4-register-modal.css v1.2
   PADRÃO RX7 — usa cores e tokens do style.css principal
   ═══════════════════════════════════════════════════════════════════════ */

.br4-register-modal[hidden] { display: none !important; }

.br4-register-modal {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px))
           max(16px, env(safe-area-inset-right, 0px))
           max(16px, env(safe-area-inset-bottom, 0px))
           max(16px, env(safe-area-inset-left, 0px));
  animation: br4ModalFade 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@keyframes br4ModalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.br4-register-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  cursor: pointer;
}

/* Card no padrão RX7 — IDÊNTICO ao .login-card-shell .login-card
   PRETO SÓLIDO + border + box-shadow multi-camada (efeito glow externo + ring interno) */
.br4-register-modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: rgba(8, 12, 28, 0.50);
  border: 1px solid rgba(30, 64, 175, 0.28);
  border-radius: 21px;
  padding: 26px 22px 22px;
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(30, 64, 175, 0.08),
    0 0 0 1px rgba(30, 64, 175, 0.12) inset,
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 25px 70px rgba(0, 0, 0, 0.5);
  animation: br4ModalSlide 0.35s cubic-bezier(0.25, 0.1, 0.25, 1.1);
  margin: 32px auto;
  font-family: 'Exo 2', system-ui, sans-serif;
}

@keyframes br4ModalSlide {
  from { transform: translateY(24px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.br4-register-modal__x {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(156, 163, 175, 0.9);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
  font-family: inherit;
}

.br4-register-modal__x:hover {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fff;
}

.br4-register-modal__header {
  text-align: center;
  margin-bottom: 20px;
}

/* Logos lado a lado (RX7 × BR4) */
.br4-register-modal__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
  min-height: 42px;
}

.br4-register-modal__logo {
  height: 40px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease;
}

.br4-register-modal__logo--mestre {
  height: 38px;
}

.br4-register-modal__logo--br4 {
  height: 32px;
  filter: drop-shadow(0 2px 8px rgba(30, 64, 175, 0.35));
}

.br4-register-modal__logo-sep {
  font-size: 1.3rem;
  font-weight: 300;
  color: rgba(59, 91, 219, 0.4);
  user-select: none;
  font-family: system-ui;
  line-height: 1;
}

.br4-register-modal__title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.br4-register-modal__sub {
  margin: 0;
  color: rgba(156, 163, 175, 0.85);
  font-size: 0.85rem;
}

.br4-register-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.br4-register-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Campo escondido (nome aparece dinamicamente) */
.br4-register-field--hidden {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
  transition: none;
}

.br4-register-field--show {
  max-height: 120px;
  opacity: 1;
  pointer-events: auto;
  animation: br4FieldReveal 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes br4FieldReveal {
  from { max-height: 0; opacity: 0; transform: translateY(-8px); }
  to { max-height: 120px; opacity: 1; transform: translateY(0); }
}

.br4-register-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(203, 213, 225, 0.9);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Input padrão RX7 */
.br4-register-input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  background: rgba(27, 32, 43, 0.5);
  border: 1.5px solid rgba(130, 150, 190, 0.22);
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.br4-register-input:hover {
  border-color: rgba(130, 150, 190, 0.42);
}

.br4-register-input:focus {
  outline: none;
  border-color: rgba(59, 91, 219, 0.5);
  box-shadow:
    0 0 0 3px rgba(30, 64, 175, 0.2),
    0 2px 10px rgba(0, 0, 0, 0.16) inset;
  background: rgba(27, 32, 43, 0.75);
}

.br4-register-input::placeholder {
  color: rgba(156, 163, 175, 0.55);
}

.br4-register-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(27, 32, 43, 0.3);
}

/* Nome readonly — destacado em verde RX7 */
.br4-register-input--readonly:read-only {
  background: rgba(30, 64, 175, 0.08);
  border-color: rgba(30, 64, 175, 0.4);
  color: #10B981;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: default;
  text-transform: uppercase;
}

.br4-register-input--readonly:read-only:focus {
  border-color: rgba(30, 64, 175, 0.6);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.18);
}

/* CPF + Lupa */
.br4-register-cpf-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.br4-register-cpf-wrap .br4-register-input {
  flex: 1;
}

/* Botão lupa — gradiente verde RX7 (igual btn-login-premium) */
.br4-register-cpf-btn {
  flex: 0 0 auto;
  width: 50px;
  min-height: 50px;
  background: linear-gradient(180deg, #3B5BDB 0%, #17a34a 48%, #1E3A8A 100%);
  border: 1px solid rgba(30, 64, 175, 0.6);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow:
    0 4px 18px rgba(30, 64, 175, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
  font-family: inherit;
}

.br4-register-cpf-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow:
    0 6px 24px rgba(30, 64, 175, 0.48),
    0 1px 0 rgba(255, 255, 255, 0.28) inset;
}

.br4-register-cpf-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.br4-register-cpf-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.4);
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border-color: rgba(75, 85, 99, 0.5);
  box-shadow: none;
}

.br4-register-cpf-btn.is-loading {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-color: rgba(75, 85, 99, 0.6);
}

.br4-register-cpf-btn.is-success {
  background: linear-gradient(180deg, #3B5BDB 0%, #17a34a 48%, #1E3A8A 100%);
  cursor: default;
  filter: brightness(1.1);
}

.br4-register-cpf-btn.is-error {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 48%, #b91c1c 100%);
  border-color: rgba(220, 38, 38, 0.6);
  box-shadow: 0 4px 18px rgba(220, 38, 38, 0.35);
}

.br4-cpf-icon { display: block; }
.br4-cpf-icon--spin { animation: br4Spin 0.85s linear infinite; }

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

.hidden { display: none !important; }

/* Feedback CPF */
.br4-register-feedback {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 18px;
  line-height: 1.45;
}

.br4-register-feedback.is-success { color: #10B981; }
.br4-register-feedback.is-error { color: #f87171; }
.br4-register-feedback.is-warning { color: #fbbf24; }
.br4-register-feedback.is-info { color: rgba(156, 163, 175, 0.85); }

/* ─── Input wrap (com error icon overlay) ──────────────────────────────── */
.br4-register-input-wrap {
  position: relative;
  width: 100%;
}

.br4-register-input-wrap .br4-register-input { width: 100%; }

/* Ícone ❗ no canto direito quando campo tem erro */
.br4-register-input-error-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #f87171;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px rgba(248, 113, 113, 0.6));
}

.br4-register-field.has-error .br4-register-input-error-icon {
  opacity: 1;
  animation: br4ErrorPulse 0.5s cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes br4ErrorPulse {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.18); }
}

/* Estado de erro do campo: borda vermelha + glow */
.br4-register-field.has-error .br4-register-input {
  border-color: #f87171 !important;
  background: rgba(248, 113, 113, 0.05);
  box-shadow:
    0 0 0 3px rgba(248, 113, 113, 0.18),
    0 0 18px rgba(248, 113, 113, 0.2) !important;
  padding-right: 42px !important;
  animation: br4Shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes br4Shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Mensagem de erro embaixo do campo */
.br4-register-fielderror {
  margin: 5px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #f87171;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.2s ease;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.br4-register-field.has-error .br4-register-fielderror {
  max-height: 40px;
  opacity: 1;
  margin: 5px 0 0;
}

.br4-register-field.has-error .br4-register-fielderror::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.8);
  flex-shrink: 0;
}

/* ─── Telefone com prefixo +55 Brasil ───────────────────────────────────── */
.br4-register-phone-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.br4-register-phone-prefix {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 50px;
  padding: 0 12px;
  background: rgba(27, 32, 43, 0.35);
  border: 1.5px solid rgba(130, 150, 190, 0.18);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: not-allowed;
  opacity: 0.65;
  user-select: none;
}

.br4-register-phone-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.br4-register-phone-code {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(203, 213, 225, 0.85);
  letter-spacing: 0.02em;
  font-family: inherit;
}

.br4-register-input-wrap--phone {
  flex: 1;
}

/* ─── Senha — input + olhinho à frente ──────────────────────────────────── */
.br4-register-input--password {
  padding-left: 48px !important;
  padding-right: 16px !important;
}

.br4-register-field.has-error .br4-register-input--password {
  padding-right: 42px !important;
}

.br4-register-password-toggle {
  position: absolute;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(156, 163, 175, 0.7);
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  z-index: 2;
}

.br4-register-password-toggle--front {
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.br4-register-password-toggle:hover { color: #10B981; }

/* ─── Checklist senha (popover BR4 style) ───────────────────────────────── */
.br4-register-password-checklist[hidden] { display: none !important; }

.br4-register-password-checklist {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: linear-gradient(180deg, #121212 0%, #1E40AFa0a 100%);
  border: 1px solid rgba(30, 64, 175, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  z-index: 50;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(30, 64, 175, 0.08) inset;
  animation: br4ChecklistIn 0.22s cubic-bezier(0.25, 0.1, 0.25, 1.05);
}

@keyframes br4ChecklistIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.br4-register-password-checklist::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 24px;
  width: 12px;
  height: 12px;
  background: #121212;
  border-left: 1px solid rgba(30, 64, 175, 0.28);
  border-top: 1px solid rgba(30, 64, 175, 0.28);
  transform: rotate(45deg);
}

.br4-register-password-checklist__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.br4-register-password-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(156, 163, 175, 0.85);
  transition: color 0.2s ease;
}

.br4-register-password-rule__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.12);
  border: 1.5px solid rgba(248, 113, 113, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: all 0.25s ease;
}

.br4-register-password-rule__icon::before {
  content: '';
  width: 4px;
  height: 4px;
  background: #f87171;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(248, 113, 113, 0.7);
}

.br4-register-password-rule.is-valid {
  color: #10B981;
}

.br4-register-password-rule.is-valid .br4-register-password-rule__icon {
  background: rgba(30, 64, 175, 0.18);
  border-color: rgba(30, 64, 175, 0.7);
  box-shadow: 0 0 8px rgba(30, 64, 175, 0.35);
}

.br4-register-password-rule.is-valid .br4-register-password-rule__icon::before {
  content: '';
  width: 10px;
  height: 10px;
  background: transparent;
  border: solid #10B981;
  border-width: 0 2px 2px 0;
  border-radius: 0;
  transform: rotate(45deg) translate(-1px, -1px);
  box-shadow: none;
}

/* Strength meter */
.br4-strength-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.br4-strength-bar {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.br4-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.br4-strength-fill.weak { background: #dc2626; width: 33%; }
.br4-strength-fill.medium { background: #f59e0b; width: 66%; }
.br4-strength-fill.strong { background: linear-gradient(90deg, #17a34a, #3B5BDB); width: 100%; }

.br4-strength-label {
  min-width: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(156, 163, 175, 0.7);
}

.br4-strength-label.weak { color: #f87171; }
.br4-strength-label.medium { color: #fbbf24; }
.br4-strength-label.strong { color: #10B981; }

/* Termos */
.br4-register-terms {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.78rem;
  color: rgba(156, 163, 175, 0.85);
  line-height: 1.45;
  cursor: pointer;
  margin: 4px 0;
}

.br4-register-terms input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #1E40AF;
  flex-shrink: 0;
}

.br4-register-link {
  color: #10B981;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

.br4-register-link:hover {
  color: #3B5BDB;
  text-decoration: underline;
}

.br4-register-link--strong {
  color: #3B5BDB;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(59, 91, 219, 0.5);
  text-underline-offset: 3px;
}

.br4-register-link--strong:hover {
  color: #10B981;
  text-decoration-color: #10B981;
}

/* Termos/Política — MESMA COR do site original (.login-legal-link) */
.br4-register-link--legal {
  color: #93C5FD;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(30, 64, 175, 0.45);
  cursor: pointer;
  transition: color 0.18s ease;
}

.br4-register-link--legal:hover,
.br4-register-link--legal:focus {
  color: #a7f3d0;
  text-decoration-color: #a7f3d0;
}

/* Botão Concluir do checklist da senha */
.br4-register-password-checklist__btn {
  margin-top: 10px;
  width: 100%;
  padding: 8px 12px;
  background: linear-gradient(180deg, #3B5BDB 0%, #17a34a 60%, #1E3A8A 100%);
  border: 1px solid rgba(30, 64, 175, 0.55);
  border-radius: 9px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.18s ease, transform 0.12s ease;
  box-shadow:
    0 3px 12px rgba(30, 64, 175, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.br4-register-password-checklist__btn:hover { filter: brightness(1.08); }
.br4-register-password-checklist__btn:active { transform: scale(0.97); }

/* ─── Sub-modal: Acesso Restrito (CPF impedido) ─────────────────────────── */
.br4-impeded-modal[hidden] { display: none !important; }

.br4-impeded-modal {
  position: fixed;
  inset: 0;
  z-index: 14500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px))
           max(16px, env(safe-area-inset-right, 0px))
           max(16px, env(safe-area-inset-bottom, 0px))
           max(16px, env(safe-area-inset-left, 0px));
  animation: br4ModalFade 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.br4-impeded-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.br4-impeded-modal__card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #0e0a0a 0%, #1E40AF808 100%);
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 20px;
  padding: 28px 22px 22px;
  text-align: center;
  animation: br4ModalSlide 0.32s cubic-bezier(0.25, 0.1, 0.25, 1.05);
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.62),
    0 0 32px rgba(220, 38, 38, 0.12),
    0 0 0 1px rgba(220, 38, 38, 0.15) inset;
}

.br4-impeded-modal__icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.18) 0%, rgba(220, 38, 38, 0.05) 70%, transparent 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  position: relative;
}

.br4-impeded-modal__icon-wrap::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(248, 113, 113, 0.18);
  animation: br4ImpededPulse 2s ease-in-out infinite;
}

@keyframes br4ImpededPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.12); opacity: 0.25; }
}

.br4-impeded-modal__icon {
  color: #f87171;
  filter: drop-shadow(0 0 12px rgba(248, 113, 113, 0.6));
}

.br4-impeded-modal__title {
  margin: 0 0 12px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.br4-impeded-modal__msg {
  margin: 0 0 22px;
  color: rgba(203, 213, 225, 0.92);
  font-size: 0.92rem;
  line-height: 1.55;
  padding: 0 4px;
}

.br4-impeded-modal__btn {
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  background: linear-gradient(180deg, #3B5BDB 0%, #17a34a 48%, #1E3A8A 100%);
  border: 1px solid rgba(30, 64, 175, 0.6);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.18s ease, transform 0.12s ease;
  box-shadow:
    0 6px 22px rgba(30, 64, 175, 0.38),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

.br4-impeded-modal__btn:hover { filter: brightness(1.07); }
.br4-impeded-modal__btn:active { transform: scale(0.985); }

@media (max-width: 380px) {
  .br4-impeded-modal__card {
    padding: 22px 18px 18px;
    border-radius: 16px;
  }
  .br4-impeded-modal__icon-wrap {
    width: 68px;
    height: 68px;
    margin-bottom: 12px;
  }
  .br4-impeded-modal__icon {
    width: 40px;
    height: 40px;
  }
  .br4-impeded-modal__title { font-size: 1.25rem; }
  .br4-impeded-modal__msg { font-size: 0.86rem; }
}

/* ─── Sub-modais: Termos / Política (inline) ────────────────────────────── */
.br4-doc-modal[hidden] { display: none !important; }

.br4-doc-modal {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px))
           max(16px, env(safe-area-inset-right, 0px))
           max(16px, env(safe-area-inset-bottom, 0px))
           max(16px, env(safe-area-inset-left, 0px));
  animation: br4ModalFade 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.br4-doc-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.br4-doc-modal__card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(80vh, 700px);
  background: rgba(8, 12, 28, 0.50);
  border: 1px solid rgba(30, 64, 175, 0.28);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: br4ModalSlide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1.05);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(30, 64, 175, 0.08),
    0 0 0 1px rgba(30, 64, 175, 0.12) inset;
}

.br4-doc-modal__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: rgba(8, 8, 8, 0.65);
  border-bottom: 1px solid rgba(30, 64, 175, 0.18);
  position: relative;
  z-index: 2;
}

.br4-doc-modal__header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.br4-doc-modal__x {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(156, 163, 175, 0.9);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: inherit;
}

.br4-doc-modal__x:hover {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fff;
}

.br4-doc-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 18px 20px;
  color: rgba(203, 213, 225, 0.92);
  font-size: 0.92rem;
  line-height: 1.6;
  font-family: inherit;
}

.br4-doc-modal__body h1,
.br4-doc-modal__body h2,
.br4-doc-modal__body h3,
.br4-doc-modal__body h4 {
  color: #fff;
  margin: 18px 0 8px;
  font-weight: 800;
}

.br4-doc-modal__body h1:first-child,
.br4-doc-modal__body h2:first-child,
.br4-doc-modal__body h3:first-child { margin-top: 0; }

.br4-doc-modal__body h1 { font-size: 1.25rem; }
.br4-doc-modal__body h2 { font-size: 1.1rem; color: #10B981; }
.br4-doc-modal__body h3 { font-size: 1rem; color: #93C5FD; }

.br4-doc-modal__body p {
  margin: 0 0 12px;
}

.br4-doc-modal__body ul,
.br4-doc-modal__body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.br4-doc-modal__body li { margin-bottom: 6px; }

.br4-doc-modal__body a {
  color: #93C5FD;
  text-decoration: underline;
}

.br4-doc-modal__body strong,
.br4-doc-modal__body b { color: #fff; font-weight: 700; }

.br4-doc-modal__loading {
  text-align: center;
  color: rgba(156, 163, 175, 0.8);
  padding: 40px 0;
  font-style: italic;
}

/* Scrollbar custom no body do doc-modal */
.br4-doc-modal__body::-webkit-scrollbar { width: 8px; }
.br4-doc-modal__body::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
.br4-doc-modal__body::-webkit-scrollbar-thumb {
  background: rgba(30, 64, 175, 0.3);
  border-radius: 4px;
}
.br4-doc-modal__body::-webkit-scrollbar-thumb:hover { background: rgba(30, 64, 175, 0.5); }

.br4-doc-modal__footer {
  flex: 0 0 auto;
  padding: 14px 18px;
  background: rgba(8, 8, 8, 0.65);
  border-top: 1px solid rgba(30, 64, 175, 0.18);
  display: flex;
  justify-content: flex-end;
}

.br4-doc-modal__btn {
  padding: 10px 22px;
  background: linear-gradient(180deg, #3B5BDB 0%, #17a34a 50%, #1E3A8A 100%);
  border: 1px solid rgba(30, 64, 175, 0.6);
  border-radius: 10px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.18s ease, transform 0.12s ease;
  box-shadow:
    0 4px 14px rgba(30, 64, 175, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

.br4-doc-modal__btn:hover { filter: brightness(1.08); }
.br4-doc-modal__btn:active { transform: scale(0.97); }

@media (max-width: 480px) {
  .br4-doc-modal__card {
    max-height: 88vh;
    border-radius: 16px;
  }
  .br4-doc-modal__header { padding: 14px 16px; }
  .br4-doc-modal__header h3 { font-size: 1rem; }
  .br4-doc-modal__body { padding: 16px; font-size: 0.88rem; }
  .br4-doc-modal__footer { padding: 12px 16px; }
}

/* Submit (clone do .btn-login-premium) */
.br4-register-submit {
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  background: linear-gradient(180deg, #3B5BDB 0%, #17a34a 48%, #1E3A8A 100%);
  border: 1px solid rgba(30, 64, 175, 0.6);
  border-radius: 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow:
    0 6px 28px rgba(30, 64, 175, 0.42),
    0 1px 0 rgba(255, 255, 255, 0.28) inset;
  margin-top: 4px;
  font-family: inherit;
  text-transform: uppercase;
}

.br4-register-submit:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow:
    0 8px 34px rgba(30, 64, 175, 0.48),
    0 1px 0 rgba(255, 255, 255, 0.32) inset;
}

.br4-register-submit:active:not(:disabled) {
  transform: scale(0.985);
}

.br4-register-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.3);
  transform: none !important;
}

.br4-register-submit.is-loading .br4-submit-text { opacity: 0; }
.br4-submit-spinner { display: none; }
.br4-register-submit.is-loading .br4-submit-spinner {
  display: inline-block;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.32);
  border-top-color: #fff;
  border-radius: 50%;
  animation: br4Spin 0.7s linear infinite;
}

.br4-register-error {
  margin: 4px 0 0;
  color: #f87171;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  min-height: 18px;
}

.br4-register-already {
  text-align: center;
  margin: 12px 0 0;
  color: rgba(156, 163, 175, 0.85);
  font-size: 0.82rem;
}

/* Overlay de sucesso */
.br4-register-success-overlay[hidden] { display: none !important; }
.br4-register-success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.96);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: br4ModalFade 0.3s ease;
  z-index: 5;
  backdrop-filter: blur(8px);
}

.br4-register-success-card {
  text-align: center;
  color: #fff;
}

.br4-register-success-icon {
  font-size: 64px;
  margin-bottom: 14px;
  animation: br4SuccessPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes br4SuccessPop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.br4-register-success-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #10B981;
}

.br4-register-success-card p {
  margin: 0;
  color: rgba(203, 213, 225, 0.9);
  font-size: 0.92rem;
}

/* ─── iPhone / Mobile polish ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .br4-register-modal {
    align-items: flex-start;
  }
  .br4-register-modal__card {
    padding: 22px 18px max(22px, calc(env(safe-area-inset-bottom, 0px) + 16px));
    border-radius: 20px;
    margin: max(16px, env(safe-area-inset-top, 0px)) auto 16px;
    min-height: auto;
  }
  .br4-register-modal__title {
    font-size: 1.28rem;
  }
  .br4-register-modal__logos {
    gap: 12px;
    margin-bottom: 12px;
    min-height: 36px;
  }
  .br4-register-modal__logo--mestre {
    height: 34px;
  }
  .br4-register-modal__logo--br4 {
    height: 28px;
  }
  .br4-register-modal__logo-sep {
    font-size: 1.1rem;
  }
  .br4-register-cpf-btn {
    width: 48px;
    min-height: 48px;
  }
  .br4-register-input {
    min-height: 48px;
    font-size: 16px;
  }
}

/* iPhone com notch / Dynamic Island */
@supports (padding: env(safe-area-inset-top)) {
  .br4-register-modal__card {
    padding-top: max(26px, calc(env(safe-area-inset-top, 0px) + 8px));
  }
}

/* Phone prefix mobile */
@media (max-width: 480px) {
  .br4-register-phone-prefix {
    min-width: 86px;
    padding: 0 10px;
    gap: 6px;
  }
  .br4-register-phone-code {
    font-size: 0.9rem;
  }
}

/* iPhone SE / pequenos — compactar mais */
@media (max-width: 380px) {
  .br4-register-modal__card {
    padding: 18px 14px;
    border-radius: 18px;
  }
  .br4-register-modal__title {
    font-size: 1.2rem;
  }
  .br4-register-modal__sub {
    font-size: 0.8rem;
  }
  .br4-register-modal__logo--mestre { height: 32px; }
  .br4-register-modal__logo--br4 { height: 26px; }
  .br4-register-form { gap: 12px; }
  .br4-register-input { min-height: 46px; padding: 0 14px; }
  .br4-register-cpf-btn { width: 46px; min-height: 46px; }
}

/* iPhone landscape — modal full vertical scroll */
@media (max-height: 700px) and (max-width: 900px) {
  .br4-register-modal { align-items: flex-start; }
  .br4-register-modal__card {
    margin: 12px auto;
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .br4-register-modal__logos { min-height: 32px; }
  .br4-register-modal__logo--mestre { height: 30px; }
  .br4-register-modal__logo--br4 { height: 26px; }
  .br4-register-modal__header { margin-bottom: 14px; }
}

/* Inputs sem aparência iOS (estiliza nativo) */
.br4-register-input,
.br4-register-cpf-btn,
.br4-register-submit,
.br4-register-password-toggle {
  -webkit-appearance: none;
  appearance: none;
}

/* Reduz motion pra usuários sensíveis */
@media (prefers-reduced-motion: reduce) {
  .br4-register-modal,
  .br4-register-modal__card,
  .br4-register-success-icon,
  .br4-register-field--show {
    animation-duration: 0.01s !important;
    transition-duration: 0.01s !important;
  }
}

/* RX7 MODAL HEADER TRANSPARENT + CPF BTN GREEN */

/* Header do modal de registro — transparente */
html body .br4-register-modal__header,
.br4-register-modal__header,
header.br4-register-modal__header {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  padding-bottom: 14px !important;
  margin-bottom: 4px !important;
}

/* Lupa/search button — estado normal */
.br4-register-cpf-btn,
button.br4-register-cpf-btn {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  color: rgba(255,255,255,0.7) !important;
  transition: all 150ms ease !important;
}
.br4-register-cpf-btn:hover {
  background: rgba(255,255,255,0.10) !important;
}

/* Lupa — estado CPF verificado/encontrado = VERDE */
.br4-register-cpf-btn--ok,
.br4-register-cpf-btn--found,
.br4-register-cpf-btn--verified,
.br4-register-cpf-btn--success,
.br4-register-cpf-btn.is-ok,
.br4-register-cpf-btn.is-found,
.br4-register-cpf-btn.is-verified,
.br4-register-cpf-btn.is-success,
/* After CPF search returns name (name field shows) */
.br4-register-cpf-btn[data-state="ok"],
.br4-register-cpf-btn[data-state="found"] {
  background: rgba(16, 185, 129, 0.20) !important;
  border-color: rgba(16, 185, 129, 0.60) !important;
  color: #10B981 !important;
  box-shadow: 0 0 12px rgba(16,185,129,0.20) !important;
}
.br4-register-cpf-btn--ok svg,
.br4-register-cpf-btn--found svg,
.br4-register-cpf-btn--verified svg,
.br4-register-cpf-btn.is-ok svg,
.br4-register-cpf-btn.is-found svg {
  color: #10B981 !important;
  fill: #10B981 !important;
  stroke: #10B981 !important;
}

/* Lupa — estado erro/CPF inválido = vermelho sutil */
.br4-register-cpf-btn--error,
.br4-register-cpf-btn.is-error,
.br4-register-cpf-btn[data-state="error"] {
  background: rgba(220, 38, 38, 0.15) !important;
  border-color: rgba(220, 38, 38, 0.50) !important;
  color: #EF4444 !important;
}

/* SVG icon da lupa — default */
.br4-register-cpf-btn svg {
  color: rgba(255,255,255,0.6) !important;
  fill: rgba(255,255,255,0.6) !important;
}

/* Phone prefix button — sem gray */
.br4-register-phone-prefix {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 8px !important;
}

/* RX7 HEADER GLASS FIX — modal card glass + header truly transparent */
.br4-register-modal__card {
  background: rgba(8, 12, 28, 0.55) !important;
  backdrop-filter: blur(32px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(180%) !important;
}
header.br4-register-modal__header,
.br4-register-modal__header {
  background: transparent !important;
  background-color: transparent !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}
/* CPF btn success = GREEN */
.br4-register-cpf-btn.is-success {
  background: rgba(16,185,129,0.18) !important;
  border-color: rgba(16,185,129,0.55) !important;
  color: #10B981 !important;
  box-shadow: 0 0 12px rgba(16,185,129,0.15) !important;
}
.br4-register-cpf-btn.is-success svg,
.br4-register-cpf-btn.is-success path {
  fill: #10B981 !important;
  stroke: #10B981 !important;
  color: #10B981 !important;
}
