/* ==========================================================
   NexoPlay V47 - Auth remodel
   Full-screen video background + glass login/register card.
   Scoped to logged-out authentication only. Profile mode stays
   under the existing NexoPlay profile styles.
   ========================================================== */

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) {
  --nx47-white: #fff;
  --nx47-soft: rgba(255,255,255,.76);
  --nx47-muted: rgba(255,255,255,.58);
  --nx47-line: rgba(255,255,255,.22);
  --nx47-field: rgba(5,10,24,.28);
  --nx47-field-focus: rgba(8,15,34,.48);
  --nx47-glass: rgba(7,12,27,.36);
  --nx47-glass-edge: rgba(255,255,255,.18);
  --nx47-accent-a: #7258ff;
  --nx47-accent-b: #2dc7f3;
  position: fixed !important;
  inset: 0 !important;
  padding: clamp(12px, 3vw, 34px) !important;
  align-items: center !important;
  justify-content: center !important;
  background: #050712 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: hidden !important;
  isolation: isolate;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-media {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(80,74,220,.34), transparent 42%),
    radial-gradient(circle at 80% 85%, rgba(21,160,196,.2), transparent 42%),
    #050712;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, calc(100vh * .72));
  height: max(100vh, calc(100vw * 1.78));
  transform: translate(-50%,-50%) scale(1.08);
  border: 0;
  pointer-events: none;
  user-select: none;
  opacity: .9;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(2,5,15,.38), rgba(2,5,15,.55));
  pointer-events: none;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at 50% 42%, transparent 0 26%, rgba(0,0,0,.24) 70%, rgba(0,0,0,.46) 100%);
  pointer-events: none;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-modal {
  position: relative;
  z-index: 2;
  width: min(430px, 94vw) !important;
  max-width: 430px !important;
  max-height: min(860px, calc(100dvh - 24px)) !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  border: 1px solid var(--nx47-glass-edge) !important;
  border-radius: 28px !important;
  background: var(--nx47-glass) !important;
  box-shadow: 0 24px 68px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.1) !important;
  backdrop-filter: blur(15px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(15px) saturate(1.08) !important;
  color: var(--nx47-white) !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 20px 8px !important;
  border: 0 !important;
  background: transparent !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-head h2 {
  margin: 0 !important;
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 850 !important;
  letter-spacing: -.02em;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx-profile-head-actions {
  margin-left: auto;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx-profile-top-logout {
  display: none !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-head .close {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  box-shadow: none !important;
  display: grid !important;
  place-items: center;
  font-size: 20px !important;
  line-height: 1 !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 24px 24px !important;
  scrollbar-width: thin;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-tabs {
  display: none !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-form {
  display: grid;
  gap: 12px !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 0 3px;
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -.03em;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-brand img {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.28));
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-copy {
  text-align: center;
  margin: 0 0 6px;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-copy h3 {
  margin: 0;
  color: #fff !important;
  font-size: clamp(23px, 5vw, 30px);
  font-weight: 900;
  letter-spacing: -.035em;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-copy p {
  margin: 7px auto 0;
  max-width: 320px;
  color: var(--nx47-soft) !important;
  font-size: 11px;
  line-height: 1.55;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-field {
  display: grid;
  gap: 6px;
  margin: 0;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-field-label,
#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-label {
  color: rgba(255,255,255,.88) !important;
  font-size: 10px !important;
  font-weight: 760 !important;
  letter-spacing: .01em;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-input-shell,
#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-password-wrap {
  position: relative;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 18px;
  text-align: center;
  color: rgba(255,255,255,.76);
  font-size: 13px;
  pointer-events: none;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-input {
  width: 100% !important;
  min-height: 46px;
  margin: 0 !important;
  padding: 11px 13px 11px 42px !important;
  border: 1px solid var(--nx47-line) !important;
  border-radius: 14px !important;
  background: var(--nx47-field) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045) !important;
  outline: 0 !important;
  font-size: 13px !important;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-input::placeholder {
  color: rgba(255,255,255,.47) !important;
  opacity: 1;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-input:focus {
  border-color: rgba(119,215,255,.72) !important;
  background: var(--nx47-field-focus) !important;
  box-shadow: 0 0 0 3px rgba(60,181,255,.12), inset 0 1px 0 rgba(255,255,255,.07) !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-password-wrap .auth-input {
  padding-right: 72px !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .password-toggle {
  right: 9px !important;
  color: rgba(255,255,255,.72) !important;
  font-size: 9px !important;
  padding: 7px !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .password-toggle:hover {
  color: #fff !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .pin-input {
  letter-spacing: 4px !important;
  text-align: left !important;
  font-size: 14px !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx42-register-hint {
  display: block;
  margin: -3px 2px 0;
  color: rgba(255,255,255,.56) !important;
  font-size: 8.5px !important;
  line-height: 1.45;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-submit {
  width: 100%;
  min-height: 47px;
  margin: 4px 0 0 !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, var(--nx47-accent-a), #5568ff 48%, var(--nx47-accent-b)) !important;
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(52,86,220,.28) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease, opacity .14s ease !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-submit:not(:disabled):active {
  transform: scale(.985);
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-submit:disabled {
  opacity: .5 !important;
  cursor: not-allowed;
  box-shadow: none !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: -2px;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-text-link,
#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-switch-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(255,255,255,.72) !important;
  font-size: 9.5px;
  font-weight: 720;
  cursor: pointer;
  text-decoration: none;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-text-link:hover,
#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-switch-link:hover {
  color: #fff !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-switch-row {
  margin: 2px 0 0;
  text-align: center;
  color: rgba(255,255,255,.62) !important;
  font-size: 10px;
  line-height: 1.4;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-switch-row .nx47-switch-link {
  margin-left: 4px;
  color: #fff !important;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .register-pin-card,
#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .recovery-box {
  display: none !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-message {
  margin-top: 12px !important;
  border-radius: 13px !important;
  border-color: rgba(255,255,255,.18) !important;
  background: rgba(22,11,25,.65) !important;
  color: #fff !important;
  font-size: 10px !important;
  backdrop-filter: none !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-message.success {
  background: rgba(7,45,29,.72) !important;
  color: #c7f9db !important;
}

#authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-note {
  display: none !important;
}

/* Keep the existing profile completely outside this remodel. */
#authBg[data-nx7-mode="profile"] .nx47-auth-media,
#authBg[data-nx8-profile="1"] .nx47-auth-media {
  display: none !important;
}

@media (max-width: 520px) {
  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) {
    padding: 10px !important;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-modal {
    width: min(94vw, 410px) !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: 24px !important;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-head {
    padding: 15px 16px 5px !important;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-head h2 {
    font-size: 15px !important;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-body {
    padding: 6px 18px 18px !important;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-form {
    gap: 10px !important;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-brand {
    font-size: 18px;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-copy h3 {
    font-size: 24px;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-auth-copy p {
    font-size: 9.5px;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-input {
    min-height: 43px;
    font-size: 12px !important;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-inline-fields {
    grid-template-columns: minmax(0,1fr) 104px;
    gap: 8px;
  }

  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-submit {
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .nx47-inline-fields {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-input,
  #authBg:not([data-nx7-mode="profile"]):not([data-nx8-profile="1"]) .auth-submit {
    transition: none !important;
  }
}
