/* Keep the larger recovery layout local to its visible form. */
#auth-view:not([hidden]):has(#forgot-password-form:not([hidden])) {
  box-sizing: border-box;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
}
#auth-view:has(#forgot-password-form:not([hidden])) .auth-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  margin: -22px auto 0;
  padding: 32px 36px;
}
#auth-view:has(#forgot-password-form:not([hidden])) .auth-brand { gap: 13px; }
#auth-view:has(#forgot-password-form:not([hidden])) .identity-mark,
#auth-view:has(#forgot-password-form:not([hidden])) .identity-mark img { width: 46px; height: 46px; }
#auth-view:has(#forgot-password-form:not([hidden])) .auth-brand strong { color: var(--teal-dark); font-size: 22px; letter-spacing: .25px; }
#auth-view:has(#forgot-password-form:not([hidden])) .auth-brand small { margin-top: 3px; font-size: 13px; }
#auth-view:has(#forgot-password-form:not([hidden])) .auth-heading { margin-top: 30px; }
#auth-view:has(#forgot-password-form:not([hidden])) .auth-heading h2 { font-size: 32px; line-height: 1.3; }
#auth-view:has(#forgot-password-form:not([hidden])) .auth-heading p { margin-top: 10px; font-size: 16px; line-height: 1.7; }

#forgot-password-form { margin-top: 26px; }
#forgot-password-form > label { margin: 21px 0 9px; font-size: 16px; line-height: 1.5; font-weight: 700; }
#forgot-password-form > label:first-child { margin-top: 0; }
#forgot-password-form .password-email-row { display: grid; grid-template-columns: minmax(0, 1fr) 136px; gap: 12px; align-items: stretch; }
#forgot-password-form input:not([type="checkbox"]) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 15px;
  border: 1px solid #aab9c2;
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  line-height: 1.4;
}
#forgot-password-form input:not([type="checkbox"]):focus { border-color: var(--teal); outline: 3px solid rgba(0, 113, 122, .12); }
#forgot-password-form .password-email-row button {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
#forgot-password-form .password-email-row button:disabled { background: var(--surface-muted); color: var(--muted); cursor: default; opacity: 1; }
#forgot-password-form .password-email-row button:not(:disabled):hover { border-color: var(--teal); background: var(--teal-soft); }
#forgot-password-form .password-email-row button:focus-visible { outline: 3px solid rgba(0, 113, 122, .18); outline-offset: 2px; }
#forgot-password-form .password-email-proof { margin: 9px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
#forgot-password-form .password-email-proof:empty { display: none; }
#forgot-password-form .password-email-proof.verified { color: #167447; font-weight: 650; }
#forgot-password-form input:not([type="checkbox"]):disabled { background: var(--surface-muted); color: var(--muted); cursor: not-allowed; }
#forgot-password-form input:not([type="checkbox"])[readonly] { background: #f0f8f4; border-color: #82b7a1; color: #176b4d; }
#forgot-password-form:has(.password-email-proof.verified) #forgot-password-verify { background: #f0f8f4; border-color: #82b7a1; color: #176b4d; opacity: 1; }
#forgot-password-form .turnstile-slot { margin-top: 22px; }
#forgot-password-form > .primary-command { min-height: 56px; margin-top: 24px; border-radius: 8px; font-size: 18px; }
#forgot-password-form > .auth-back-button { min-height: 50px; margin-top: 12px; border-radius: 8px; font-size: 16px; }

:root[data-theme="dark"] #forgot-password-form input:not([type="checkbox"]) { border-color: #516671; }
:root[data-theme="dark"] #forgot-password-form input:not([type="checkbox"])[readonly],
:root[data-theme="dark"] #forgot-password-form:has(.password-email-proof.verified) #forgot-password-verify { background: #183b31; border-color: #528c76; color: #a0dfbe; }
:root[data-theme="dark"] #forgot-password-form .password-email-proof.verified { color: #a0dfbe; }

@media (max-width: 640px) {
  #auth-view:not([hidden]):has(#forgot-password-form:not([hidden])) { width: 100%; padding: 24px 16px 48px; }
  #auth-view:has(#forgot-password-form:not([hidden])) .auth-banner { display: none; }
  .portal-page:has(#auth-view:not([hidden]) #forgot-password-form:not([hidden])) { background: var(--surface); }
  .portal-page:has(#auth-view:not([hidden]) #forgot-password-form:not([hidden]))::before,
  .portal-page:has(#auth-view:not([hidden]) #forgot-password-form:not([hidden])) .auth-sakura { display: none; }
  #auth-view:has(#forgot-password-form:not([hidden])) .auth-card { margin: 0 auto; padding: 20px; border: 0; box-shadow: none; }
  #auth-view:has(#forgot-password-form:not([hidden])) .auth-heading h2 { font-size: 32px; }
  #auth-view:has(#forgot-password-form:not([hidden])) .auth-heading p { font-size: 15px; }
  #forgot-password-form .password-email-row { grid-template-columns: minmax(0, 1fr) 104px; gap: 8px; }
  #forgot-password-form .password-email-row button { padding-inline: 8px; font-size: 14px; }
  #forgot-password-form input:not([type="checkbox"]) { padding-inline: 12px; font-size: 16px; }
}
@media (max-width: 359px) {
  #auth-view:not([hidden]):has(#forgot-password-form:not([hidden])) { padding-inline: 12px; }
  #auth-view:has(#forgot-password-form:not([hidden])) .auth-card { padding-inline: 16px; }
  #forgot-password-form .password-email-row button { font-size: 13px; }
}
