/* ==========================================
   reCAPTCHA - WOXB dark/gold wrapper
   Fixes the white bottom/right iframe lines
========================================== */
.auth-captcha {
  width: 100%;
  margin: 6px 0 4px;
  border-radius: 12px;
  overflow: hidden;
}

.auth-captcha-inner {
  width: 100%;
  min-height: 78px;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html:not(.dark) .auth-captcha-inner {
  border: 0;
  background: transparent;
  box-shadow: none;
}

/*
   Google reCAPTCHA is rendered inside a cross-origin iframe.
   The small white bottom/right bars can appear on some laptop/browser
   scaling combinations. We clip only the outer 4px edges of the iframe
   so the checkbox and logo remain untouched.
*/
.captcha-widget-clip {
  position: relative;
  width: 304px;
  height: 78px;
  flex: 0 0 304px;
  overflow: hidden;
  border-radius: 3px;
  background: #222;
  line-height: 0;
}

html:not(.dark) .captcha-widget-clip {
  background: #f9f9f9;
}

.auth-captcha .g-recaptcha {
  width: 304px;
  height: 78px;
  margin: 0;
  padding: 0;
  line-height: 0;
  transform: none;
  transform-origin: left top;
}

.auth-captcha .g-recaptcha > div {
  width: 304px !important;
  height: 78px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.auth-captcha iframe {
  display: block !important;
  width: 304px !important;
  height: 78px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip-path: inset(0 4px 4px 0);
}

/* Extra cover for browsers that still paint a scrollbar edge */
.captcha-widget-clip::after,
.captcha-widget-clip::before {
  content: "";
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: #222;
}

.captcha-widget-clip::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
}

.captcha-widget-clip::before {
  top: 0;
  right: 0;
  bottom: 0;
  width: 4px;
}

html:not(.dark) .captcha-widget-clip::after,
html:not(.dark) .captcha-widget-clip::before {
  background: #f9f9f9;
}

@media (max-width: 390px) {
  .captcha-widget-clip {
    width: 280px;
    height: 72px;
    flex-basis: 280px;
  }

  .auth-captcha .g-recaptcha {
    transform: scale(.92);
    transform-origin: left top;
  }

  .auth-captcha-inner {
    min-height: 72px;
    padding: 0;
  }
}

@media (max-width: 350px) {
  .captcha-widget-clip {
    width: 256px;
    height: 66px;
    flex-basis: 256px;
  }

  .auth-captcha .g-recaptcha {
    transform: scale(.84);
  }

  .auth-captcha-inner {
    min-height: 78px;
  }
}

/* ==========================================
   LOGIN-MATCHED AUTH LAYOUT
   Keeps register aligned with the sign-in card.
========================================== */
body.auth-page.register-page .auth-main {
  min-height: 100vh !important;
  height: auto !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box;
  overflow: visible !important;
}

body.auth-page.register-page .auth-shell.hero,
html:not(.dark) body.auth-page.register-page .auth-shell.hero,
html.dark body.auth-page.register-page .auth-shell.hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: center !important;
  align-items: center !important;
  gap: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100vh !important;
  height: auto !important;
  min-height: 100svh !important;
  margin: 0 auto !important;
  padding: 76px max(5%, calc((100% - 1440px) / 2)) !important;
  box-sizing: border-box;
  overflow: visible !important;
}

.auth-copy {
  display: none !important;
}

body.auth-page.register-page .auth-card {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  grid-column: 1 !important;
  width: min(430px, calc(100vw - 32px)) !important;
  max-width: 430px !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 auto !important;
  padding: 22px 28px 18px !important;
  overflow: visible !important;
  scrollbar-width: auto !important;
  transform: none !important;
}

.register-page .auth-card {
  width: min(430px, calc(100vw - 32px)) !important;
  max-width: 430px !important;
}

html,
body.auth-page {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.register-page .auth-card-head {
  margin-bottom: 16px !important;
}

.register-page .auth-form {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.register-page .auth-field {
  min-width: 0 !important;
  gap: 5px !important;
}

.register-page .auth-field input,
.register-page .auth-field select {
  min-height: 44px !important;
}

.register-page .auth-captcha {
  margin: 2px 0 0 !important;
}

.register-page .auth-submit {
  min-height: 48px !important;
  margin-top: 0 !important;
}

.register-page .auth-submit:disabled,
.register-page .auth-submit[aria-disabled="true"] {
  background: linear-gradient(135deg, #e5e7eb, #cbd5e1) !important;
  border-color: rgba(148, 163, 184, 0.55) !important;
  box-shadow: none !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  opacity: 0.82 !important;
  pointer-events: none !important;
  transform: none !important;
}

@media (max-width: 767px) {
  html,
  body.auth-page.register-page {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.auth-page.register-page .auth-main {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: auto !important;
    min-height: 100svh !important;
    overflow: visible !important;
  }

  body.auth-page.register-page .auth-shell.hero,
  html:not(.dark) body.auth-page.register-page .auth-shell.hero,
  html.dark body.auth-page.register-page .auth-shell.hero {
    padding: 16px !important;
    height: auto !important;
    min-height: 100svh !important;
    overflow: visible !important;
  }

  body.auth-page.register-page .auth-card {
    width: 100% !important;
    max-width: 430px !important;
    padding: 20px 18px 16px !important;
  }

  .register-page .auth-card {
    width: min(360px, calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px) !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .register-page .auth-form {
    grid-template-columns: 1fr !important;
  }
}

@media (max-height: 820px) and (min-width: 768px) {
  .register-page .auth-card {
    padding-top: 18px !important;
    padding-bottom: 14px !important;
  }
}

/* Final register input polish: no blue blur/shade on fields. */
body.auth-page.register-page .auth-field input,
body.auth-page.register-page .auth-field select {
  background: #171717 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.auth-page.register-page .password-wrap {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.auth-page.register-page .auth-field input:focus,
body.auth-page.register-page .auth-field select:focus,
body.auth-page.register-page .auth-field.has-error input,
body.auth-page.register-page .auth-field.has-success input {
  box-shadow: none !important;
}

body.auth-page.register-page .auth-field input:-webkit-autofill,
body.auth-page.register-page .auth-field input:-webkit-autofill:hover,
body.auth-page.register-page .auth-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 0 0 1000px #171717 inset !important;
  transition: background-color 9999s ease-out !important;
}

html:not(.dark) body.auth-page.register-page .auth-field input,
html:not(.dark) body.auth-page.register-page .auth-field select {
  background: #ffffff !important;
}

html:not(.dark) body.auth-page.register-page .auth-field input:-webkit-autofill,
html:not(.dark) body.auth-page.register-page .auth-field input:-webkit-autofill:hover,
html:not(.dark) body.auth-page.register-page .auth-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #101828 !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
}

body.auth-page.register-page .auth-field.has-error input,
body.auth-page.register-page .auth-field.has-error input:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.75) !important;
}

html:not(.dark) body.auth-page.register-page .auth-field.has-error input,
html:not(.dark) body.auth-page.register-page .auth-field.has-error input:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.45) !important;
}
