/*
  Dependency chain: auth-entry-redesign.css variables -> generated AuthGate forms ->
  this control layer. Owns field, button, consent, validation, and
  focus-visible polish without changing auth API contracts.
*/
:root[data-hf-auth-entry-redesign] .auth-form {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .78rem;
  width: 100%;
  max-width: 26.5rem;
  justify-self: center;
}

:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup {
  box-sizing: border-box;
  padding: .78rem;
  border: 1px solid rgba(206, 222, 255, .5);
  border-radius: 8px;
  background: rgba(55, 91, 146, .82);
  color: var(--hf-auth-on-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup .auth-field > span,
:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup .auth-policy-consent__check {
  color: var(--hf-auth-on-dark);
}

:root[data-hf-auth-entry-redesign] form[data-hf4-register-form] {
  grid-template-columns: minmax(0, 1fr) minmax(4.25rem, 5rem);
  column-gap: .62rem;
}
:root[data-hf-auth-entry-redesign] .auth-field--first-name,
:root[data-hf-auth-entry-redesign] .auth-field--password,
:root[data-hf-auth-entry-redesign] .auth-field--confirm-password,
:root[data-hf-auth-entry-redesign] form[data-hf4-register-form] .auth-policy-consent,
:root[data-hf-auth-entry-redesign] form[data-hf4-register-form] .auth-error,
:root[data-hf-auth-entry-redesign] form[data-hf4-register-form] .auth-submit { grid-column: 1 / -1; }
:root[data-hf-auth-entry-redesign] .auth-field--last-name { grid-column: 1; grid-row: 2; }
:root[data-hf-auth-entry-redesign] .auth-field--middle-initial { grid-column: 2; grid-row: 2; }
:root[data-hf-auth-entry-redesign] .auth-field--middle-initial input { text-align: center; }

:root[data-hf-auth-entry-redesign] .auth-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .34rem;
}

:root[data-hf-auth-entry-redesign] .auth-field > span,
:root[data-hf-auth-entry-redesign] .auth-policy-consent__check {
  color: var(--hf-auth-on-dark);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: 0;
}

.auth-screen .auth-form input:not(:is(
  [type="button"],
  [type="checkbox"],
  [type="color"],
  [type="file"],
  [type="hidden"],
  [type="image"],
  [type="radio"],
  [type="range"],
  [type="reset"],
  [type="submit"]
)),
.auth-screen .auth-form textarea,
.auth-screen .auth-form select,
.auth-screen .auth-field input:not(:is(
  [type="button"],
  [type="checkbox"],
  [type="color"],
  [type="file"],
  [type="hidden"],
  [type="image"],
  [type="radio"],
  [type="range"],
  [type="reset"],
  [type="submit"]
)),
.auth-screen .auth-field textarea,
.auth-screen .auth-field select,
.auth-screen .auth-password-control,
.auth-screen .auth-password-control input {
  border-color: var(--hf-auth-input-border) !important;
  background-color: var(--hf-auth-input-bg) !important;
  background-image: none !important;
  background: var(--hf-auth-input-bg) !important;
  background-clip: padding-box;
  color: var(--hf-auth-input-text) !important;
  caret-color: var(--hf-auth-input-text);
}

.auth-screen .auth-form input:not(:is(
  [type="button"],
  [type="checkbox"],
  [type="color"],
  [type="file"],
  [type="hidden"],
  [type="image"],
  [type="radio"],
  [type="range"],
  [type="reset"],
  [type="submit"]
)):-webkit-autofill,
.auth-screen .auth-form input:not(:is(
  [type="button"],
  [type="checkbox"],
  [type="color"],
  [type="file"],
  [type="hidden"],
  [type="image"],
  [type="radio"],
  [type="range"],
  [type="reset"],
  [type="submit"]
)):-webkit-autofill:hover,
.auth-screen .auth-form input:not(:is(
  [type="button"],
  [type="checkbox"],
  [type="color"],
  [type="file"],
  [type="hidden"],
  [type="image"],
  [type="radio"],
  [type="range"],
  [type="reset"],
  [type="submit"]
)):-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--hf-auth-input-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--hf-auth-input-bg) inset !important;
  -webkit-text-fill-color: var(--hf-auth-input-text) !important;
  caret-color: var(--hf-auth-input-text);
}

:root[data-hf-auth-entry-redesign] .auth-field input,
:root[data-hf-auth-entry-redesign] .auth-field textarea,
:root[data-hf-auth-entry-redesign] .auth-field select,
:root[data-hf-auth-entry-redesign] .auth-password-control {
  min-height: 2.75rem;
  height: auto !important;
  box-sizing: border-box;
  border: 1px solid var(--hf-auth-input-border);
  border-radius: 14px;
  background-color: var(--hf-auth-input-bg) !important;
  background: var(--hf-auth-input-bg) !important;
  color: var(--hf-auth-input-text) !important;
  box-shadow: none;
  font-size: .92rem;
  line-height: 1.2;
}

:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup [name="phoneNumber"],
:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup input,
:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup textarea,
:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup select,
:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup .auth-field input,
:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup .auth-field textarea,
:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup .auth-field select,
:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup .auth-field input[name="phoneNumber"] {
  border-color: var(--hf-auth-input-border);
  background-color: var(--hf-auth-input-bg) !important;
  background: var(--hf-auth-input-bg) !important;
}

:root[data-hf-auth-entry-redesign] .auth-field input,
:root[data-hf-auth-entry-redesign] .auth-field textarea,
:root[data-hf-auth-entry-redesign] .auth-field select {
  padding: .52rem .72rem;
}

:root[data-hf-auth-entry-redesign] .auth-password-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .42rem; padding: .12rem .12rem .12rem 0; }
:root[data-hf-auth-entry-redesign] .auth-password-control input { grid-column: 1; min-width: 0; width: 100%; border: 0 !important; outline: 0 !important; box-shadow: none !important; padding-right: .35rem; }
:root[data-hf-auth-entry-redesign] .auth-password-reveal { grid-column: 2; position: relative; z-index: 2; inset: auto; justify-self: end; transform: none; min-width: 4.2rem; min-height: 2rem; padding: 0 .58rem; touch-action: manipulation; white-space: nowrap; }
:root[data-hf-auth-entry-redesign] .auth-password-control input::-ms-reveal, :root[data-hf-auth-entry-redesign] .auth-password-control input::-ms-clear { display: none; }

:root[data-hf-auth-entry-redesign] .auth-field input::placeholder,
:root[data-hf-auth-entry-redesign] .auth-field textarea::placeholder,
:root[data-hf-auth-entry-redesign] .auth-field select::placeholder {
  color: var(--hf-auth-input-text);
  opacity: 1;
}

.auth-screen .auth-form input::placeholder,
.auth-screen .auth-form textarea::placeholder {
  color: var(--hf-auth-input-text);
  opacity: 1;
}

:root[data-hf-auth-entry-redesign] .auth-field input:focus,
:root[data-hf-auth-entry-redesign] .auth-field textarea:focus,
:root[data-hf-auth-entry-redesign] .auth-field select:focus,
:root[data-hf-auth-entry-redesign] .auth-password-control:focus-within {
  border-color: var(--hf-auth-focus);
  background-color: var(--hf-auth-input-bg-focus) !important;
  background: var(--hf-auth-input-bg-focus) !important;
  outline: 3px solid rgba(242, 181, 68, .32);
  outline-offset: 2px;
}

:root[data-hf-auth-entry-redesign] .auth-field input:focus,
:root[data-hf-auth-entry-redesign] .auth-field textarea:focus,
:root[data-hf-auth-entry-redesign] .auth-field select:focus,
:root[data-hf-auth-entry-redesign] .auth-password-control:focus-within input {
  background-color: var(--hf-auth-input-bg-focus) !important;
  background: var(--hf-auth-input-bg-focus) !important;
}

:root[data-hf-auth-entry-redesign] .auth-password-reveal,
:root[data-hf-auth-entry-redesign] .auth-phone-summary button {
  border-radius: 12px;
  border: 1px solid var(--hf-auth-button-border);
  background: rgba(30, 75, 118, .12);
  color: var(--hf-auth-input-text);
  font-weight: 800;
}

:root[data-hf-auth-entry-redesign] .auth-phone-summary button { min-height: 2.25rem; padding: .34rem .62rem; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
:root[data-hf-auth-entry-redesign] .auth-phone-summary button:focus-visible { border-color: var(--hf-auth-focus); outline: 3px solid rgba(242, 181, 68, .32); outline-offset: 2px; }

:root[data-hf-auth-entry-redesign] .auth-submit {
  width: 100%;
  justify-self: stretch;
  min-height: 2.85rem;
  border: 2px solid var(--hf-auth-action-border);
  border-radius: 14px;
  background: var(--hf-auth-action);
  color: var(--hf-auth-ink);
  box-shadow: 0 12px 28px rgba(217, 134, 0, .3);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0;
}

:root[data-hf-auth-entry-redesign] .auth-submit:hover:not(:disabled),
:root[data-hf-auth-entry-redesign] .auth-submit:focus-visible:not(:disabled) {
  background: var(--hf-auth-action-strong);
  color: #09223c;
}

:root[data-hf-auth-entry-redesign] .auth-submit:disabled {
  border-color: var(--hf-auth-action-border);
  background: var(--hf-auth-action);
  color: rgba(7, 19, 35, .82);
  opacity: 1;
  box-shadow: none;
  cursor: not-allowed;
}

:root[data-hf-auth-entry-redesign] .auth-policy-consent {
  padding: .86rem;
}

:root[data-hf-auth-entry-redesign] .hf-phone-entry-consent,
:root[data-hf-auth-entry-redesign] .hf-phone-policy-consent {
  border-width: 2px;
  border-color: var(--hf-auth-action-border);
  background: rgba(11, 20, 50, .5);
  box-shadow: inset 0 0 0 1px rgba(255, 194, 71, .2);
  color: var(--hf-auth-on-dark);
}

:root[data-hf-auth-entry-redesign] .hf-phone-entry-consent .auth-policy-consent__check,
:root[data-hf-auth-entry-redesign] .hf-phone-policy-consent .auth-policy-consent__check {
  color: var(--hf-auth-on-dark);
}

:root[data-hf-auth-entry-redesign] .auth-form--phone-lookup .auth-sms-disclosure {
  border-color: rgba(206, 222, 255, .34);
  background: rgba(11, 20, 50, .5);
}

:root[data-hf-auth-entry-redesign] .hf-phone-entry-consent-error {
  margin: 0;
}

:root[data-hf-auth-entry-redesign] .auth-policy-consent__check {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  min-height: 2.75rem;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.28;
  cursor: pointer;
}

:root[data-hf-auth-entry-redesign] .auth-policy-consent input[type="checkbox"] {
  accent-color: var(--hf-auth-teal);
  inline-size: 1.22rem;
  block-size: 1.22rem;
  margin-top: .05rem;
}

:root[data-hf-auth-entry-redesign] .auth-policy-consent__check:focus-within {
  border-radius: 8px;
  outline: 3px solid rgba(242, 181, 68, .34);
  outline-offset: 5px;
}

:root[data-hf-auth-entry-redesign] .auth-policy-consent__links { display: flex; flex-wrap: wrap; gap: .42rem .5rem; align-items: center; margin-top: .64rem; }
:root[data-hf-auth-entry-redesign] .auth-policy-consent__links a { display: inline-flex; width: fit-content; padding: .3rem .48rem; border: 1px solid rgba(158, 215, 255, .32); border-radius: 999px; background: rgba(158, 215, 255, .08); line-height: 1.1; text-decoration: none; }
:root[data-hf-auth-entry-redesign] .auth-policy-consent__links a,
:root[data-hf-auth-entry-redesign] .auth-sms-disclosure a {
  color: #ffd7a0;
  font-weight: 800;
}

:root[data-hf-auth-entry-redesign] .auth-policy-consent__links a:focus-visible,
:root[data-hf-auth-entry-redesign] .auth-sms-disclosure a:focus-visible,
:root[data-hf-auth-entry-redesign] .auth-password-reveal:focus-visible {
  border-color: var(--hf-auth-focus);
  outline: 3px solid rgba(242, 181, 68, .34);
  outline-offset: 3px;
}

:root[data-hf-auth-entry-redesign] .auth-phone-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .42rem .72rem; padding: .82rem; }

:root[data-hf-auth-entry-redesign] .auth-phone-summary span { grid-column: 1 / -1; color: var(--hf-auth-muted-on-dark); }

:root[data-hf-auth-entry-redesign] .auth-phone-summary strong { min-width: 0; color: var(--hf-auth-on-dark); font-size: 1.05rem; line-height: 1.15; }

:root[data-hf-auth-entry-redesign] .hf-auth-roadmap {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding: .82rem .9rem;
  list-style: none;
  counter-reset: hf-auth-step;
}

:root[data-hf-auth-entry-redesign] .hf-auth-roadmap li {
  display: grid;
  grid-template-columns: 1.65rem 1fr;
  gap: .6rem;
  align-items: center;
  color: var(--hf-auth-muted-on-dark);
  font-size: .88rem;
  line-height: 1.28;
}

:root[data-hf-auth-entry-redesign] .hf-auth-roadmap li::before {
  counter-increment: hf-auth-step;
  content: counter(hf-auth-step);
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--hf-auth-gold);
  color: #071323;
  font-weight: 900;
}

:root[data-hf-auth-entry-redesign] .hf-auth-trust-note,
:root[data-hf-auth-entry-redesign] .auth-sms-disclosure {
  margin: 0;
  padding: .78rem .86rem;
  border-color: rgba(255, 255, 255, .18);
  background: rgba(7, 19, 35, .34);
}

:root[data-hf-auth-entry-redesign] .hf-auth-trust-note,
:root[data-hf-auth-entry-redesign] .auth-sms-disclosure,
:root[data-hf-auth-entry-redesign] .hf-auth-trust-note span,
:root[data-hf-auth-entry-redesign] .auth-sms-disclosure span {
  color: var(--hf-auth-muted-on-dark) !important;
  text-shadow: none !important;
}

:root[data-hf-auth-entry-redesign] .auth-sms-disclosure a {
  color: #ffd7a0 !important;
}

:root[data-hf-auth-entry-redesign] .auth-error {
  border: 1px solid rgba(255, 122, 122, .72);
  border-radius: 8px;
  background: rgba(112, 31, 43, .88);
  color: #fff6f4;
}

:root[data-hf-auth-entry-redesign] .auth-security-note,
:root[data-hf-auth-entry-redesign] .auth-turnstile,
:root[data-hf-auth-entry-redesign] [data-hf-turnstile-retired="1"] {
  display: none !important;
}

:root[data-hf-auth-entry-redesign] .hf-password-match-error {
  margin: -.28rem 0 0;
  padding: .62rem .72rem;
  font-size: .86rem;
  line-height: 1.32;
}

:root[data-hf-auth-entry-redesign] .hf-phone-entry-validation {
  margin: -.24rem 0 0;
  padding: .58rem .68rem;
  border: 1px solid rgba(255, 215, 160, .58);
  border-radius: 8px;
  background: rgba(7, 19, 35, .36);
  color: #ffe3b8;
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.28;
}

@media (max-width: 460px) {
  :root[data-hf-auth-entry-redesign] .auth-form {
    max-width: none;
  }

  :root[data-hf-auth-entry-redesign] form[data-hf4-register-form] {
    grid-template-columns: minmax(0, 1fr) minmax(4.25rem, 5rem);
  }

  :root[data-hf-auth-entry-redesign] .auth-screen[data-hf-auth-mode="phone"] .auth-submit {
    margin-bottom: .75rem;
  }
}
