#modal[data-auth-modal-root],
#auth-forgot-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

html.auth-modal-scroll-locked {
  scroll-behavior: auto !important;
}

body.auth-modal-scroll-locked {
  overscroll-behavior: none;
}

#modal[data-auth-modal-root].open,
#auth-forgot-modal.open {
  opacity: 1;
  pointer-events: all;
}

#modal[data-auth-modal-root] .modal-content,
#modal[data-auth-modal-root] .modal-box,
#auth-forgot-modal .modal-content,
#auth-forgot-modal .modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: min(92vh, 720px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 24px;
  background: #09101f;
  padding: 40px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6);
  transform: translateY(20px) scale(.97);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}

#modal[data-auth-modal-root] .modal-content::before,
#modal[data-auth-modal-root] .modal-box::before,
#auth-forgot-modal .modal-content::before,
#auth-forgot-modal .modal-box::before {
  content: '';
  position: absolute;
  top: 0;
  right: 20%;
  left: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, .5), transparent);
}

#modal[data-auth-modal-root].open .modal-content,
#modal[data-auth-modal-root].open .modal-box,
#auth-forgot-modal.open .modal-content,
#auth-forgot-modal.open .modal-box {
  transform: none;
  animation: authModalShellIn .35s cubic-bezier(.22, 1, .36, 1);
}

#modal[data-auth-modal-root] .auth-completion-status {
  display: none;
  min-height: 160px;
  align-items: center;
  justify-content: center;
  color: var(--text, var(--color-text));
  text-align: center;
}

#modal[data-auth-modal-root][data-auth-completion="confirming"] [data-auth-modal-panel],
#modal[data-auth-modal-root][data-auth-completion="confirming"] #modal-register-success {
  display: none;
}

#modal[data-auth-modal-root][data-auth-completion="confirming"] .auth-completion-status {
  display: flex;
}

#modal[data-auth-modal-root] .modal-close,
#auth-forgot-modal .modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border, var(--border-subtle));
  border-radius: 8px;
  background: var(--card, var(--color-card));
  color: var(--muted, var(--color-muted));
  font-size: 1rem;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

#modal[data-auth-modal-root] .modal-close:hover,
#auth-forgot-modal .modal-close:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--text, var(--color-text));
}

#modal[data-auth-modal-root] .modal-close:focus-visible,
#auth-forgot-modal .modal-close:focus-visible {
  outline: 2px solid rgba(99, 102, 241, .72);
  outline-offset: 3px;
}

#modal[data-auth-modal-root] h2,
#auth-forgot-modal h2 {
  margin-bottom: 8px;
  font-family: var(--display, var(--font-display));
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0;
}

#modal[data-auth-modal-root] .modal-subtitle,
#auth-forgot-modal .modal-subtitle {
  margin-bottom: 28px;
  color: var(--muted, var(--color-muted));
  font-size: .875rem;
}

#modal[data-auth-modal-root] .auth-form,
#auth-forgot-modal .auth-form {
  margin: 0;
}

#modal[data-auth-modal-root] .form,
#auth-forgot-modal .form,
#modal[data-auth-modal-root] .form-field,
#auth-forgot-modal .form-field,
#modal[data-auth-modal-root] .form-group,
#auth-forgot-modal .form-group {
  min-width: 0;
}

#modal[data-auth-modal-root] .form-group,
#auth-forgot-modal .form-group {
  margin-bottom: 14px;
}

#modal[data-auth-modal-root] .form-label,
#auth-forgot-modal .form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted, var(--muted, var(--color-muted)));
  font-size: var(--text-xs, .78rem);
  font-weight: 500;
  line-height: 1.35;
}

#modal[data-auth-modal-root] .form-input,
#modal[data-auth-modal-root] .form-control,
#auth-forgot-modal .form-input,
#auth-forgot-modal .form-control {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border, var(--border-subtle));
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
  color: var(--text-primary, var(--text, var(--color-text)));
  padding: 11px 14px;
  font-family: var(--font-sans, inherit);
  font-size: var(--text-sm, .9rem);
  line-height: 1.4;
  outline: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

#modal[data-auth-modal-root] .password-input-wrap,
#auth-forgot-modal .password-input-wrap {
  position: relative;
}

#modal[data-auth-modal-root] .password-input-wrap .form-control,
#auth-forgot-modal .password-input-wrap .form-control {
  padding-right: 48px;
}

#modal[data-auth-modal-root] .password-visibility-toggle,
#auth-forgot-modal .password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, var(--muted, var(--color-muted)));
  cursor: pointer;
  transform: translateY(-50%);
}

#modal[data-auth-modal-root] .password-visibility-toggle:hover,
#auth-forgot-modal .password-visibility-toggle:hover {
  background: rgba(148, 163, 184, .09);
  color: var(--text-primary, var(--text, var(--color-text)));
}

#modal[data-auth-modal-root] .password-visibility-toggle:focus-visible,
#auth-forgot-modal .password-visibility-toggle:focus-visible {
  outline: 2px solid rgba(148, 163, 184, .55);
  outline-offset: 1px;
}

#modal[data-auth-modal-root] .password-visibility-toggle svg,
#auth-forgot-modal .password-visibility-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#modal[data-auth-modal-root] .password-visibility-toggle .password-visibility-slash,
#auth-forgot-modal .password-visibility-toggle .password-visibility-slash {
  display: none;
}

#modal[data-auth-modal-root] .password-visibility-toggle[aria-pressed="true"] .password-visibility-slash,
#auth-forgot-modal .password-visibility-toggle[aria-pressed="true"] .password-visibility-slash {
  display: block;
}

#modal[data-auth-modal-root] .form-input:focus,
#modal[data-auth-modal-root] .form-control:focus,
#auth-forgot-modal .form-input:focus,
#auth-forgot-modal .form-control:focus {
  border-color: rgba(99, 102, 241, .58);
  background: rgba(99, 102, 241, .04);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

#modal[data-auth-modal-root] .form-input::placeholder,
#modal[data-auth-modal-root] .form-control::placeholder,
#auth-forgot-modal .form-input::placeholder,
#auth-forgot-modal .form-control::placeholder {
  color: var(--text-muted, var(--muted, var(--color-muted)));
}

#modal[data-auth-modal-root] .form-input.error,
#modal[data-auth-modal-root] .form-control.error,
#auth-forgot-modal .form-input.error,
#auth-forgot-modal .form-control.error {
  border-color: rgba(244, 63, 94, .6);
}

#modal[data-auth-modal-root] .form-help,
#modal[data-auth-modal-root] .form-hint,
#auth-forgot-modal .form-help,
#auth-forgot-modal .form-hint {
  margin-top: 6px;
  color: var(--text-muted, var(--muted, var(--color-muted)));
  font-size: var(--text-xs, .76rem);
  line-height: 1.45;
}

#modal[data-auth-modal-root] .form-error,
#auth-forgot-modal .form-error {
  display: none !important;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  color: var(--rose, var(--color-rose));
  font-size: .78rem;
  line-height: 1.4;
}

#modal[data-auth-modal-root] .form-error.visible,
#auth-forgot-modal .form-error.visible {
  display: flex !important;
}

#modal[data-auth-modal-root] .forgot-link,
#auth-forgot-modal .forgot-link {
  display: block;
  width: fit-content;
  margin: -4px 0 16px auto;
  border: 0;
  background: none;
  padding: 0;
  color: var(--primary, var(--color-primary));
  font-family: var(--sans, var(--font-sans));
  font-size: .78rem;
  text-align: right;
  cursor: pointer;
}

#modal[data-auth-modal-root] .forgot-link:hover,
#auth-forgot-modal .forgot-link:hover {
  text-decoration: underline;
}

#modal[data-auth-modal-root] .turnstile-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 14px;
}

#modal[data-auth-modal-root] .turnstile-wrap[hidden] {
  display: none !important;
}

#modal[data-auth-modal-root] .turnstile-box {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#modal[data-auth-modal-root] .turnstile-box:empty {
  min-height: 0;
}

#modal[data-auth-modal-root] .google-auth-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  margin: 0 0 16px;
  overflow: visible;
  box-sizing: border-box;
}

#modal[data-auth-modal-root] .google-auth-block[hidden],
#modal[data-auth-modal-root] .auth-divider[hidden] {
  display: none !important;
}

#modal[data-auth-modal-root] .auth-google-btn {
  position: relative;
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(99,102,241,.48);
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(99,102,241,.15), rgba(14,165,233,.06)),
    rgba(2,6,23,.5);
  color: var(--text-primary, var(--text, var(--color-text)));
  padding: 7px 13px;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.025) inset,
    0 0 24px rgba(79,70,229,.17);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}

#modal[data-auth-modal-root] .auth-google-btn:hover,
#modal[data-auth-modal-root] .auth-google-btn:focus-visible {
  border-color: rgba(129,140,248,.78);
  background:
    linear-gradient(135deg, rgba(99,102,241,.2), rgba(14,165,233,.08)),
    rgba(2,6,23,.58);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 0 30px rgba(79,70,229,.28);
}

#modal[data-auth-modal-root] .auth-google-btn:hover {
  transform: translateY(-1px);
}

#modal[data-auth-modal-root] .auth-google-btn:focus-visible {
  outline: 2px solid rgba(99,102,241,.62);
  outline-offset: 3px;
}

#modal[data-auth-modal-root] .auth-google-btn:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

#modal[data-auth-modal-root] .auth-google-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 22px rgba(0,0,0,.24);
}

#modal[data-auth-modal-root] .auth-google-btn__icon svg {
  width: 18px;
  height: 18px;
}

#modal[data-auth-modal-root] .auth-google-btn__label {
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#modal[data-auth-modal-root] .auth-google-hidden-container {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

#modal[data-auth-modal-root] .auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 2px 0 18px;
  color: var(--muted, var(--color-muted));
  font-size: .76rem;
  line-height: 1.2;
  text-align: center;
}

#modal[data-auth-modal-root] .auth-divider::before,
#modal[data-auth-modal-root] .auth-divider::after {
  content: "";
  flex: 1;
  min-width: 24px;
  height: 1px;
  background: var(--border, var(--border-subtle));
}

#modal[data-auth-modal-root] .auth-divider span {
  white-space: nowrap;
}

#modal[data-auth-modal-root] .auth-error {
  width: 100%;
  color: var(--rose, var(--color-rose));
  font-size: .78rem;
  line-height: 1.4;
  text-align: center;
}

#modal[data-auth-modal-root] .auth-error[hidden] {
  display: none !important;
}

#modal[data-auth-modal-root] .modal-switch,
#auth-forgot-modal .modal-switch {
  margin-top: 18px;
  color: var(--muted, var(--color-muted));
  font-size: .82rem;
  text-align: center;
}

#modal[data-auth-modal-root] .modal-switch a,
#auth-forgot-modal .modal-switch a {
  color: var(--primary, var(--color-primary));
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

#modal[data-auth-modal-root] .modal-switch a:hover,
#auth-forgot-modal .modal-switch a:hover {
  text-decoration: underline;
}

#modal[data-auth-modal-root] .modal-success,
#auth-forgot-modal .forgot-success {
  padding: 16px 0;
  text-align: center;
}

#modal[data-auth-modal-root] .modal-success-icon,
#auth-forgot-modal .modal-success-icon {
  display: block;
  margin-bottom: 16px;
  font-size: 3rem;
}

#modal[data-auth-modal-root] .modal-success-sub,
#auth-forgot-modal .modal-success-sub {
  margin: 12px 0 24px;
  color: var(--muted, var(--color-muted));
  font-size: .9rem;
}

#modal[data-auth-modal-root] .modal-success-dot {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, .2);
  border-top-color: var(--green, var(--color-green));
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes authModalShellIn {
  from {
    transform: translateY(20px) scale(.97);
  }

  to {
    transform: none;
  }
}

@media (max-width: 480px) {
  #modal[data-auth-modal-root],
  #auth-forgot-modal {
    padding: 14px;
  }

  #modal[data-auth-modal-root] .modal-content,
  #modal[data-auth-modal-root] .modal-box,
  #auth-forgot-modal .modal-content,
  #auth-forgot-modal .modal-box {
    padding: 32px 22px 24px;
  }

  #modal[data-auth-modal-root] .auth-google-btn {
    min-height: 52px;
    grid-template-columns: 32px 1fr 32px;
    gap: 7px;
    border-radius: 13px;
    padding: 7px 9px;
    font-size: .86rem;
  }

  #modal[data-auth-modal-root] .auth-google-btn__icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  #modal[data-auth-modal-root] .auth-google-btn__icon svg {
    width: 17px;
    height: 17px;
  }

  #modal[data-auth-modal-root] .auth-divider {
    gap: 10px;
    font-size: .72rem;
  }

  #modal[data-auth-modal-root] .auth-divider span {
    white-space: normal;
  }
}


/* Auth modal consent v301 */
#modal[data-auth-modal-root] .auth-consent,
#modal[data-auth-modal-root] .auth-consent * {
  box-sizing: border-box;
}

#modal[data-auth-modal-root] .auth-consent.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  margin: 8px 0 14px;
  color: var(--text-muted, var(--muted, var(--color-muted)));
  font-size: var(--text-xs, .76rem);
  line-height: 1.38;
  cursor: pointer;
  user-select: none;
}

#modal[data-auth-modal-root] .auth-consent input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#modal[data-auth-modal-root] .checkbox-custom {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(10,12,26,.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition, .2s ease);
  margin-top: 1px;
}

#modal[data-auth-modal-root] .checkbox-label input:checked + .checkbox-custom {
  background: rgba(167,139,250,.2);
  border-color: var(--c-purple, #a78bfa);
  box-shadow: 0 0 10px rgba(167,139,250,.25);
}

#modal[data-auth-modal-root] .checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  display: block;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--c-purple, #a78bfa);
  border-bottom: 2px solid var(--c-purple, #a78bfa);
  transform: rotate(-45deg) translateY(-1px);
}

#modal[data-auth-modal-root] .auth-consent input:focus-visible + .checkbox-custom {
  border-color: rgba(129, 140, 248, .9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18), 0 0 10px rgba(167,139,250,.25);
}

#modal[data-auth-modal-root] .auth-consent__text {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

#modal[data-auth-modal-root] .auth-consent__text a {
  color: #8da2ff;
  font-weight: 700;
  text-decoration: none;
}

#modal[data-auth-modal-root] .auth-consent__text a:hover {
  text-decoration: underline;
}

#modal[data-auth-modal-root] .auth-consent-error {
  display: none;
  margin: -7px 0 10px 27px;
  color: var(--rose, var(--color-rose, #f43f5e));
  font-size: .74rem;
  line-height: 1.35;
}

#modal[data-auth-modal-root] .auth-consent-error.visible,
#modal[data-auth-modal-root] .auth-consent-error:not([hidden]) {
  display: block;
}

#modal[data-auth-modal-root] #modal-register .auth-consent-disabled {
  opacity: .56;
  cursor: not-allowed;
  filter: grayscale(.18);
}

@media (max-width: 480px) {
  #modal[data-auth-modal-root] .auth-consent.checkbox-label {
    gap: 8px;
    margin: 8px 0 12px;
    font-size: .72rem;
  }

  #modal[data-auth-modal-root] .auth-consent-error {
    margin-left: 26px;
    font-size: .72rem;
  }
}
