/* Reestilização apenas visual do modal nativo de autenticação.
   Mantém os componentes, campos, validações e handlers originais. */
html.sg-auth-modal-open #sg-fixed-brand-logo {
  display: none !important;
  visibility: hidden !important;
}

.sg-auth-fullscreen-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-width: 100vw !important;
  min-height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #0f7a6e !important;
  z-index: 2147483000 !important;
}

.sg-auth-fullscreen-dialog {
  position: absolute !important;
  top: 0 !important;
  right: auto !important;
  bottom: 0 !important;
  left: 50% !important;
  width: min(100vw, 360px) !important;
  height: 100dvh !important;
  min-width: 0 !important;
  min-height: 100dvh !important;
  max-width: 360px !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translateX(-50%) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  background: #024e46 !important;
  color: #e5f5ef !important;
}

.sg-auth-fullscreen-dialog > .ui-dialog__main {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  background: #024e46 !important;
}

.sg-auth-fullscreen-dialog .ui-dialog__content {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
  padding: 0 !important;
  background: #024e46 !important;
}

.sg-auth-fullscreen-dialog .loginRegisterFragment {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  max-width: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  box-sizing: border-box !important;
  margin: 0 auto !important;
  padding: 0 18px max(16px, env(safe-area-inset-bottom)) !important;
  background: #024e46 !important;
  color: #e8f5ef !important;
  scrollbar-width: none;
}

.sg-auth-fullscreen-dialog .loginRegisterFragment::-webkit-scrollbar,
.sg-auth-fullscreen-dialog .ui-tabs__content::-webkit-scrollbar {
  display: none !important;
}

/* O wrapper já existe no componente; a arte enviada ocupa somente o cabeçalho. */
.sg-auth-fullscreen-dialog .loginRegisterFragment > [class*="_headerWrap_"] {
  position: relative !important;
  display: block !important;
  flex: 0 0 clamp(150px, 20vh, 165px) !important;
  width: 100% !important;
  max-width: min(100%, 360px) !important;
  height: clamp(150px, 20vh, 165px) !important;
  min-height: 150px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
}

/* O banner personalizado já contém a marca; ocultar conteúdo nativo evita duplicação. */
.sg-auth-fullscreen-dialog .loginRegisterFragment > [class*="_headerWrap_"] > * {
  display: none !important;
}

.sg-auth-fullscreen-dialog .loginRegisterFragment > [class*="_headerWrap_"]::before {
  position: absolute;
  top: 45px;
  right: 0;
  left: 0;
  display: block;
  width: 100%;
  aspect-ratio: 960 / 298;
  background-image: url("/assets/custom/auth-promo.avif?v=1");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
}

/* Voltar fica no topo esquerdo, mas conserva o click handler nativo. */
.sg-auth-fullscreen-dialog > .ui-dialog-close-box {
  position: absolute !important;
  z-index: 10 !important;
  top: max(6px, env(safe-area-inset-top)) !important;
  right: auto !important;
  bottom: auto !important;
  left: 8px !important;
  display: block !important;
  width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

.sg-auth-fullscreen-dialog > .ui-dialog-close-box > div {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
}

.sg-auth-fullscreen-dialog #loginRegisterModalCloseButton {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  color: #83d3c1 !important;
  cursor: pointer !important;
}

.sg-auth-fullscreen-dialog #loginRegisterModalCloseButton svg {
  display: none !important;
}

.sg-auth-fullscreen-dialog #loginRegisterModalCloseButton::before {
  display: block;
  width: 9px;
  height: 9px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

/* Abas Registro/Login em duas colunas como na referência. */
.sg-auth-fullscreen-dialog .loginRegisterFragment > .ui-tabs {
  display: flex !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: min(100%, 360px) !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  background: transparent !important;
}

.sg-auth-fullscreen-dialog .ui-tabs__wrap {
  flex: 0 0 auto !important;
  width: 100% !important;
  margin: 0 !important;
  background: transparent !important;
}

.sg-auth-fullscreen-dialog .ui-tabs__nav {
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  width: 100% !important;
  height: 40px !important;
  border-bottom: 0 !important;
  background: transparent !important;
}

.sg-auth-fullscreen-dialog .ui-tab {
  display: flex !important;
  flex: 1 1 50% !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  height: 40px !important;
  color: #c2e8dd !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.sg-auth-fullscreen-dialog .ui-tab--active {
  color: #ffe17e !important;
}

.sg-auth-fullscreen-dialog .ui-tabs__line {
  height: 2px !important;
  background: #f9d86e !important;
}

.sg-auth-fullscreen-dialog .ui-tabs__content {
  flex: 0 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: calc(100dvh - 320px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #024e46 !important;
}

.sg-auth-fullscreen-dialog .ui-swipe,
.sg-auth-fullscreen-dialog .ui-swipe__track,
.sg-auth-fullscreen-dialog .ui-tabs__track {
  height: auto !important;
  min-height: 0 !important;
}

.sg-auth-fullscreen-dialog .login-register-tab-sub-title {
  display: block !important;
  margin: 11px 0 6px !important;
  color: #eff8f4 !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  text-align: left !important;
}

.sg-auth-fullscreen-dialog .sg-auth-register-form,
.sg-auth-fullscreen-dialog .sg-auth-login-form {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: min(100%, 360px) !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.sg-auth-fullscreen-dialog .sg-auth-register-form > .login-register-tab-sub-title { order: 0 !important; }
.sg-auth-fullscreen-dialog .sg-auth-register-form > .lobby-form-item--phone { order: 1 !important; }
.sg-auth-fullscreen-dialog .sg-auth-register-form > .account-switch-sub-type { order: 2 !important; }
.sg-auth-fullscreen-dialog .sg-auth-register-form > .lobby-form-item--userpass { order: 3 !important; }
.sg-auth-fullscreen-dialog .sg-auth-register-form > .pass-strength-check { order: 4 !important; }
.sg-auth-fullscreen-dialog .sg-auth-register-form > .lobby-form-item--confirmPassword { order: 5 !important; margin-bottom: 12px !important; }
.sg-auth-fullscreen-dialog .sg-auth-register-form > .lobby-form-item--account { order: 6 !important; margin-bottom: 8px !important; }
.sg-auth-fullscreen-dialog .sg-auth-login-form > .login-register-tab-sub-title { order: 0 !important; }
.sg-auth-fullscreen-dialog .sg-auth-login-form > .lobby-form-item--account { order: 1 !important; }
.sg-auth-fullscreen-dialog .sg-auth-login-form > .account-switch-sub-type { order: 2 !important; }
.sg-auth-fullscreen-dialog .sg-auth-login-form > .lobby-form-item--userpass { order: 3 !important; }

.sg-auth-fullscreen-dialog .lobby-form-item:not(.lobby-form-item--areaCode) {
  flex: 0 0 auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 0 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item .ui-input {
  display: flex !important;
  flex: 1 1 auto !important;
  align-self: stretch !important;
  width: 100% !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item:not(.lobby-form-item--areaCode) > .lobby-form-item__content {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item:not(.lobby-form-item--areaCode) > .lobby-form-item__content > .lobby-form-item__input {
  display: flex !important;
  width: 100% !important;
  height: 36px !important;
  min-height: 36px !important;
  border: 1px solid rgba(15, 161, 137, .82) !important;
  border-radius: 8px !important;
  background: #004b40 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item .ui-input__prefix,
.sg-auth-fullscreen-dialog .lobby-form-item .ui-input__input-wrap,
.sg-auth-fullscreen-dialog .lobby-form-item .ui-input__suffix,
.sg-auth-fullscreen-dialog .lobby-form-item .ui-input__input {
  height: 100% !important;
  min-height: 0 !important;
}

/* O campo +55 mantém seu tamanho compacto; a explicação aparece abaixo do contorno do input. */
.sg-auth-fullscreen-dialog .lobby-form-item--phone:not(.lobby-form-item--areaCode) > .lobby-form-item__content > .lobby-form-item__input {
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 7px !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone .lobby-form-item--areaCode > .lobby-form-item__content,
.sg-auth-fullscreen-dialog .lobby-form-item--phone .lobby-form-item--areaCode > .lobby-form-item__content > .lobby-form-item__input {
  height: 100% !important;
  min-height: 0 !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone .ui-input {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone .ui-input__prefix {
  position: relative !important;
  flex: 0 0 21% !important;
  width: 21% !important;
  min-width: 68px !important;
  max-width: 104px !important;
  padding: 0 !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone .lobby-form-item--areaCode {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone .ui-input__prefix::after {
  position: absolute;
  top: 18%;
  right: 0;
  width: 1px;
  height: 64%;
  background: rgba(42, 174, 153, .7);
  content: "";
  pointer-events: none;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone .phone-area-code {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  border: 0 !important;
  background: transparent !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone .phone-area-code > :last-child {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone .phone-area-code > :last-child > :first-child {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone .phone-area-code img {
  width: 22px !important;
  height: auto !important;
  flex: none !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone .phone-area-code > :last-child > :first-child > :last-child {
  width: auto !important;
  padding: 0 0 0 7px !important;
  white-space: nowrap !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item--phone input {
  min-width: 0 !important;
  padding: 0 0 0 12px !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item input {
  color: #e7f8f2 !important;
  font-size: 13px !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item input::placeholder {
  color: #48ad9b !important;
  opacity: 1 !important;
}

/* O erro nativo flui abaixo do input contornado; o item cresce e empurra o próximo campo. */
.sg-auth-fullscreen-dialog .lobby-form-item:has(.lobby-form-item__explain-text__error),
.sg-auth-fullscreen-dialog .lobby-form-item:has(.lobby-form-item__explain-icon__error) {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item:has(.lobby-form-item__explain-text__error) > .lobby-form-item__content,
.sg-auth-fullscreen-dialog .lobby-form-item:has(.lobby-form-item__explain-icon__error) > .lobby-form-item__content {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.sg-auth-fullscreen-dialog .lobby-form-item__explain-text__error,
.sg-auth-fullscreen-dialog .lobby-form-item__explain-icon__error {
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  margin-top: 4px !important;
  color: #ff8f8f !important;
  opacity: 1 !important;
  overflow: visible !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.sg-auth-fullscreen-dialog .account-switch-sub-type {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  min-height: 24px !important;
  margin: 0 0 8px !important;
  color: #ffe17e !important;
  font-size: 11px !important;
}

.sg-auth-fullscreen-dialog .account-switch-sub-type:empty {
  display: none !important;
  width: 0 !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sg-auth-fullscreen-dialog .pass-strength-check {
  width: 100% !important;
  margin: -4px 0 12px !important;
  color: #e8f5ef !important;
  font-size: 11px !important;
}

.sg-auth-fullscreen-dialog .sg-auth-footer {
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: min(100%, 360px) !important;
  margin: 0 auto !important;
  padding: 4px 0 8px !important;
  box-sizing: border-box !important;
  color: #e6f4ef !important;
}

.sg-auth-fullscreen-dialog .sg-auth-footer > :first-child { padding-top: 0 !important; }
.sg-auth-fullscreen-dialog .sg-auth-footer > :nth-child(2) { padding-top: 8px !important; }
.sg-auth-fullscreen-dialog .sg-auth-footer > :nth-child(3) { padding-top: 8px !important; }

.sg-auth-fullscreen-dialog .sg-auth-footer .ui-button--primary,
.sg-auth-fullscreen-dialog .ui-button--primary.ui-button--block {
  width: 100% !important;
  min-height: 38px !important;
  margin: 6px 0 8px !important;
  border: 2px solid #e4bd55 !important;
  border-radius: 9px !important;
  background: #ffdc79 !important;
  color: #5c653b !important;
  box-shadow: 0 1px 3px rgba(255, 223, 126, .30) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  position: relative !important;
  overflow: visible !important;
}

/* O envio continua sendo feito pelo handler nativo do Vue/skin. */
.sg-auth-fullscreen-dialog .sg-auth-footer button,
.sg-auth-fullscreen-dialog button[type="submit"],
.sg-auth-fullscreen-dialog [id*="Submit"] {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 2 !important;
}

.sg-auth-fullscreen-dialog .sg-auth-footer a,
.sg-auth-fullscreen-dialog .sg-auth-footer [role="button"] {
  color: #ffe17e !important;
}

.sg-auth-fullscreen-dialog input[type="checkbox"] {
  accent-color: #16c947 !important;
}

.sg-auth-fullscreen-dialog .ui-checkbox {
  color: #e9f5f0 !important;
  font-size: 12px !important;
}

@media (max-width: 420px) {
  .sg-auth-fullscreen-dialog .loginRegisterFragment {
    padding-right: 18px !important;
    padding-left: 18px !important;
  }
}

@media (max-width: 480px) {
  .sg-auth-fullscreen-overlay {
    background: #024e46 !important;
  }

  .sg-auth-fullscreen-dialog {
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    transform: none !important;
  }
}

/* Pós-login: conserva o bloco nativo de nome/saldo e esconde apenas os CTAs. */
#sg-auth-bar.sg-authenticated > .sg-auth-btns {
  display: none !important;
}

#sg-auth-bar > .sg-auth-native-profile {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 2px !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 44% !important;
  position: relative !important;
  inset: auto !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 6 !important;
}

/* Identificador da conta, na primeira linha do bloco nativo, acima do saldo. */
#sg-auth-bar > .sg-auth-native-profile .sg-auth-user-id {
  display: block !important;
  order: -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 2px 0 !important;
  padding: 0 !important;
  color: #d7eeee !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  letter-spacing: .01em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: left !important;
}

@media (max-width: 360px) {
  #sg-auth-bar > .sg-auth-native-profile .sg-auth-user-id {
    font-size: 12px !important;
  }
}
