/* The one layout of every sign-in surface: the sign-in, register, password and code pages (.a1-form-shell, built by
   login.js) and the 'Sign in again' pop-up over an open page (.a1-reauth-form, a1-session.js). Both load this sheet, so
   the alignment is the same everywhere:
   1. The title, its sentence, every message and the buttons are centred.
   2. Field labels start at the left edge of one column of full-width fields.
   3. Inside a group the gap is medium; between groups (title, fields, passkey, button) it is wide.
   scripts/check-layout.mjs rule r19 fails a surface that breaks 1. */
:root {
  --a1-signin-gap-in: 10px; /* a label and its field, two lines of one message */
  --a1-signin-gap: 16px; /* fields of one group */
  --a1-signin-gap-between: 24px; /* title, fields, passkey and button groups */
  --a1-signin-button-max: 22rem;
}

:is(.a1-form-shell, .a1-reauth-form) :is(h1, h2, h3, h4),
:is(.a1-form-shell, .a1-reauth-form) :is(.a1-reauth-why, .a1-signin-lead) {
  text-align: center;
}

:is(.a1-form-shell, .a1-reauth-form) label {
  text-align: left;
}

/* Messages: one centred tinted surface with an even edge, never a bar with an accent on the left. */
:is(.a1-form-shell, .a1-reauth-form) :is(.alert, .accu_keys-msg, .a1-reauth-msg:not(:empty)) {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--a1-border-strong);
  border-radius: 4px 12px;
  background: color-mix(in srgb, var(--a1-lavender) 50%, #fff);
  color: var(--a1-purple-ink);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  box-shadow: none;
}
:is(.a1-form-shell, .a1-reauth-form) :is(.alert-danger, .accu_keys-msg-error, .a1-reauth-msg.is-error) {
  border-color: var(--a1-negative);
  background: color-mix(in srgb, var(--a1-rose) 55%, #fff);
  color: var(--a1-negative);
}
:is(.a1-form-shell, .a1-reauth-form) :is(.alert-success, .accu_keys-msg-success) {
  border-color: var(--a1-positive);
  background: color-mix(in srgb, var(--a1-mint) 60%, #fff);
  color: var(--a1-positive);
}

/* The passkey group: the 'or' line and the button centred in the column. */
:is(.a1-form-shell, .a1-reauth-form) .accu_keys-login {
  align-items: center;
  gap: var(--a1-signin-gap);
  margin: var(--a1-signin-gap-between) 0 0;
}
.a1-reauth-form .accu_keys-login { margin: 0; } /* the pop-up's grid gap spaces it */
:is(.a1-form-shell, .a1-reauth-form) .accu_keys-login.accu_keys-first { margin: 0 0 var(--a1-signin-gap-between); }
:is(.a1-form-shell, .a1-reauth-form) .accu_keys-or { width: 100%; margin: 0; }

/* One primary button: centred, as wide as its label, never past 22 rem, never pushed to a corner. */
:is(.a1-form-shell, .a1-reauth-form) :is(.a1-login-actions, .a1-reauth-actions) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
:is(.a1-form-shell, .a1-reauth-form) .btn,
:is(.a1-form-shell, .a1-reauth-form) .accu_keys-btn-login {
  max-width: var(--a1-signin-button-max);
}

/* The language choice (theme template part language_picker.php): one small centred button at the foot of the card,
   below the links and the passkey, with a globe before the language name. It opens the list in the top layer. */
.a1-signin-lang {
  display: flex;
  justify-content: center;
  margin: var(--a1-signin-gap-between) auto 0;
}
.a1-signin-lang .bootstrap-select:not(.input-group-btn) { width: auto !important; max-width: 14rem; }
.a1-form-shell .a1-signin-lang .btn.a1-signin-lang-btn,
.a1-signin-lang .btn.a1-signin-lang-btn {
  width: auto;
  height: 34px;
  min-height: 34px;
  padding: 0 14px !important;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  color: var(--a1-muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.a1-signin-lang .btn.a1-signin-lang-btn:hover,
.a1-signin-lang .bootstrap-select.open .btn.a1-signin-lang-btn {
  transform: none;
  color: var(--a1-purple-ink);
  border-color: var(--a1-border-strong);
  background: var(--a1-button-face);
}
.a1-signin-lang .a1-signin-lang-btn .filter-option-inner-inner::before {
  content: "\f0ac"; /* globe */
  font: var(--fa-font-solid, 900 1em "Font Awesome 6 Free");
  margin-right: 8px;
}
.a1-signin-lang .a1-signin-lang-btn .bs-caret { display: none; }
.a1-signin-lang .a1-signin-lang-btn .filter-option { position: static; padding: 0; }
.a1-signin-lang .dropdown-menu[popover] { min-width: 13rem !important; }

/* The platform wraps the password label in a row that once held 'Forgot password': that row was taller than the label and
   kept its own margin, so the password field sat further from its label than the email field (Nov 11, 2026). */
.a1-form-shell .form-group > span:has(> label.control-label) {
  display: block !important;
  margin: 0 0 8px !important;
  line-height: normal;
}

/* 'Remember me' starts at the left edge of the fields above it, with its box beside its label. */
.a1-form-shell .checkbox.checkbox-inline { display: flex; align-items: center; gap: 8px; padding-left: 0; margin: 0; }
.a1-form-shell .checkbox.checkbox-inline input[type="checkbox"] { position: static; margin: 0; }
.a1-form-shell .checkbox.checkbox-inline label { padding-left: 0; margin: 0; }
