/*
 * Page styles: login. Owned by the page agent for this area; loaded after
 * hostsrc.css and hostsrc-cart.css. Scope every rule to the body class
 * .hs-page-<templatefile> (see header.tpl). Order form pages load Standard
 * Cart's all.min.css after this file, so prefix those rules with "html body".
 *
 * Sign in, password reset, two-factor, invite, access denied and banned share
 * one layout (the templates' .hs-auth): a centred Ash Panel tile with a real
 * h1, labelled fields 44px tall, one bright full-width action, and the quiet
 * alternative under the tile, as on hostsrc.com.
 */

:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) {
  --hs-auth-pad: 24px;
}
@media (min-width: 576px) {
  :is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) {
    --hs-auth-pad: 32px;
  }
}

/* Layout ----------------------------------------------------------------- */

:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth {
  width: 100%;
  max-width: 420px;
  margin: 16px auto 56px;
}
@media (min-width: 768px) {
  :is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth {
    margin-top: 48px;
    margin-bottom: 96px;
  }
}
.hs-page-user-invite-accept .hs-auth.hs-auth-wide { max-width: 880px; }

:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth-tile {
  margin: 0;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth-tile > .card-body {
  padding: var(--hs-auth-pad);
}

/* Two tiles side by side (invite: sign in, or create a user). */
.hs-page-user-invite-accept .hs-auth-pair {
  display: grid;
  gap: 8px;
}
@media (min-width: 768px) {
  .hs-page-user-invite-accept .hs-auth-pair { grid-template-columns: 1fr 1fr; align-items: start; }
}
.hs-page-user-invite-accept .hs-auth-pair h2 {
  margin: 0 0 20px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.hs-page-user-invite-accept .hs-auth-row {
  display: grid;
  gap: 0 12px;
}
@media (min-width: 576px) {
  .hs-page-user-invite-accept .hs-auth-row { grid-template-columns: 1fr 1fr; }
}

/* Heading ---------------------------------------------------------------- */

:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth-head {
  margin-bottom: 24px;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth-head h1 {
  margin: 0;
  font-size: 1.5rem !important;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth-head p {
  margin: 8px 0 0;
  color: var(--hs-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  text-wrap: pretty;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth-head p strong { color: var(--hs-foreground); }
/* The invite page's heading sits above the tiles, on the page. */
.hs-page-user-invite-accept .hs-auth-head-page { margin-bottom: 24px; }
.hs-page-user-invite-accept .hs-auth-head-page h1 { font-size: 1.75rem !important; }

:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth-text {
  margin: 0 0 20px;
  color: var(--hs-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth-label {
  margin: 0 0 8px;
  color: var(--hs-foreground);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Fields ----------------------------------------------------------------- */

:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth .form-group {
  margin-bottom: 16px;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth label {
  display: block;
  margin-bottom: 8px;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth .form-control {
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 1rem; /* 16px: no zoom on focus in iOS Safari */
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth .input-group-append .btn {
  min-width: 44px;
  min-height: 44px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth .input-group-append .btn-reveal-pw {
  justify-content: center;
  padding: 0 12px;
  border-left: 0 !important;
}
.hs-page-login .hs-auth .btn-reveal-pw:hover,
.hs-page-login .hs-auth .btn-reveal-pw[aria-pressed="true"] { color: var(--hs-foreground) !important; }

/* Password label with "Forgot password?" on the same line. */
.hs-page-login .hs-auth-labelrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.hs-page-login .hs-auth-labelrow label { margin-bottom: 0; }
.hs-page-login .hs-auth-quiet {
  /* Taller hit area without moving the line: 44px on touch screens. */
  margin: -12px -6px;
  padding: 12px 6px;
  color: var(--hs-muted);
  font-size: 0.875rem;
  text-decoration: none;
}
.hs-page-login .hs-auth-quiet:hover,
.hs-page-login .hs-auth-quiet:focus-visible {
  color: var(--hs-foreground);
  text-decoration: underline;
}

/* A normal checkbox with its label, 44px tall to tap. */
:is(.hs-page-login, .hs-page-user-invite-accept) .hs-auth-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: -4px 0 16px;
}
:is(.hs-page-login, .hs-page-user-invite-accept) .hs-auth-check input[type=checkbox] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}
:is(.hs-page-login, .hs-page-user-invite-accept) .hs-auth .hs-auth-check label {
  display: block;
  margin: 0;
  padding: 10px 0;
  font-weight: 400;
  font-size: 0.9375rem;
  cursor: pointer;
}

/* Captcha (when WHMCS has one on for the form): centred, no row gutters. */
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-user-invite-accept) .hs-auth .recaptcha-container,
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-user-invite-accept) .hs-auth .row.justify-content-center,
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-user-invite-accept) .hs-auth .form-group.row {
  margin-left: 0;
  margin-right: 0;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-user-invite-accept) .hs-auth .recaptcha-container { margin-bottom: 16px; }

/* Actions ---------------------------------------------------------------- */

:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth .btn-lg {
  min-height: 44px;
  justify-content: center;
  font-weight: 600;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth .btn-block + .btn-block { margin-top: 8px; }
.hs-page-access-denied .hs-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.hs-page-access-denied .hs-auth-actions .btn { flex: 1 1 140px; }

/* "or" between the form and linked-account buttons, when WHMCS shows any. */
.hs-page-login .hs-auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--hs-muted);
  font-size: 0.8125rem;
}
.hs-page-login .hs-auth-or::before,
.hs-page-login .hs-auth-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--hs-border);
}
.hs-page-login .social-signin-btns {
  display: grid;
  gap: 8px;
}
.hs-page-login .social-signin-btns > *,
.hs-page-login .social-signin-btns .btn {
  width: 100%;
  min-height: 44px;
  margin: 0 !important;
}
.hs-page-login .social-signin-btns .btn {
  justify-content: center;
  background: var(--hs-fill) !important;
  border: 1px solid var(--hs-input) !important;
  border-radius: var(--hs-radius-md) !important;
  color: var(--hs-foreground) !important;
  font-weight: 600;
}
.hs-page-login .social-signin-btns .btn:hover { background: var(--hs-fill-hover) !important; }
.hs-page-login .providerLinkingFeedback:not(:empty) { margin-bottom: 16px; }

/* The quiet alternative under the tile: create account, back to sign in. */
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge) .hs-auth-alt {
  margin: 20px 0 0;
  color: var(--hs-muted);
  font-size: 0.9375rem;
  text-align: center;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge) .hs-auth-alt a {
  display: inline-block;
  padding: 12px 4px;
  margin: -12px 0;
  color: var(--hs-foreground);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: oklch(1 0 0 / 35%);
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge) .hs-auth-alt a:hover { text-decoration-color: currentColor; }

/* Messages inside the tile: tighter than page-level alerts. */
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth .alert {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: var(--hs-radius-md);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: left;
}
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth .alert-info,
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth .alert:has(small) {
  /* An info note inside the tile sits on Ash Control, not on the tile's own colour. */
  background-color: var(--hs-control) !important;
}

/* Password strength (reset and invite). */
.hs-page-password-reset-container .hs-auth-strength { margin-top: -4px; }
.hs-page-password-reset-container .hs-auth-strength > br { display: none; }
:is(.hs-page-password-reset-container, .hs-page-user-invite-accept) .hs-auth .progress {
  height: 6px !important;
  margin: 0 0 12px !important;
  background: var(--hs-control);
  border-radius: 999px;
}
.hs-page-user-invite-accept .password-strength-meter { margin-top: 12px; }
.hs-page-user-invite-accept .password-strength-meter p { margin: 0; }
:is(.hs-page-password-reset-container, .hs-page-user-invite-accept) .hs-auth .progress-bar { border-radius: 999px; }
.hs-page-password-reset-container #inputNewPassword2Msg .form-text { margin: 8px 0 0; color: var(--hs-danger) !important; }

/* Two-factor: the module's own code field, large and in Geist Mono. */
.hs-page-two-factor-challenge .hs-auth-challenge .margin-bottom,
.hs-page-two-factor-challenge .hs-auth-challenge > div { margin-bottom: 12px; }
.hs-page-two-factor-challenge .hs-auth-challenge input[type=text],
.hs-page-two-factor-challenge .hs-auth-challenge input[type=number],
.hs-page-two-factor-challenge #inputTwoFaBackupCode {
  height: 52px;
  font-family: var(--hs-font-mono);
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-align: center;
}
.hs-page-two-factor-challenge .hs-auth-challenge input[type=submit],
.hs-page-two-factor-challenge .hs-auth-challenge button[type=submit] {
  display: flex;
  width: 100%;
  min-height: 44px;
  justify-content: center;
  font-weight: 600;
}
.hs-page-two-factor-challenge .hs-auth-challenge br { display: none; }

/* A new backup code: data, so mono, on Ash Control. */
.hs-page-two-factor-new-backup-code .hs-auth-code {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--hs-control);
  border-radius: var(--hs-radius-md);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-align: center;
  word-break: break-all;
}

/* Access denied: what this user may open. */
.hs-page-access-denied .hs-auth-list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hs-border);
}
.hs-page-access-denied .hs-auth-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--hs-border);
  font-size: 0.9375rem;
}

/* Banned: the reason and expiry as label and value. */
.hs-page-banned .hs-auth-head h1 .hs-data { font-size: 0.9em; letter-spacing: 0; }
.hs-page-banned .hs-auth-facts { margin: 0; border-top: 1px solid var(--hs-border); }
.hs-page-banned .hs-auth-facts > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hs-border);
}
.hs-page-banned .hs-auth-facts dt { color: var(--hs-muted); font-weight: 400; font-size: 0.9375rem; }
.hs-page-banned .hs-auth-facts dd { margin: 0; font-size: 0.9375rem; }

/* A step's text right under the h1 reads as its subtitle. */
:is(.hs-page-password-reset-container, .hs-page-two-factor-challenge) .hs-auth-head + .hs-auth-text { margin-top: -16px; }
:is(.hs-page-login, .hs-page-password-reset-container, .hs-page-two-factor-challenge, .hs-page-two-factor-new-backup-code, .hs-page-user-invite-accept, .hs-page-access-denied, .hs-page-banned) .hs-auth .card-body > :last-child { margin-bottom: 0; }
