/*
 * Sign-in look, shared by every page about getting into an account:
 * /auth/staff and /login (server/create-app.mjs, loginPageHtml) and the Astro
 * pages /login, /signup, /forgot, /reset and /verify (Layout with `bare`).
 * A soft colour scene with one glass card in the middle; no footer. /login,
 * /signup and /forgot show the site header, floating over the scene.
 */
body.auth-page {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #F5F4E5;
}

.login-scene {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  /* The colour layer reaches past the edges; keep it from widening the page. */
  overflow: hidden;
  background: #F5F4E5;
  font-family: "Public Sans", system-ui, sans-serif;
  color: #19191B;
}
.login-scene *, .login-scene *::before, .login-scene *::after { box-sizing: border-box; }
/* The site header lies over the top of the scene (app.css keeps it above the
   blur layer); the scene keeps the card clear of it. */
body.auth-page .app-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}
.app-header ~ .login-scene { padding-top: calc(80px + 24px); }
.login-scene::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: var(--mesh-brand); /* app.css */
  filter: blur(2px);
  z-index: 0;
}
.login-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25,25,27,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1;
}

.glass-panel {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  padding: 32px 28px 30px;
  border-radius: 20px;
  background: rgba(255,255,255,0.28);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow:
    0 4px 24px rgba(25,25,27,0.08),
    inset 0 1px 0 rgba(255,255,255,0.65);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}
/* Sign-up asks for more, so its card is a little wider. */
.glass-panel.glass-panel--wide { width: min(480px, 100%); }

.glass-panel h1 {
  font-family: "Bricolage Grotesque", ui-serif, Georgia, serif;
  margin: 0 0 6px;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: none;
}
.glass-panel .lead {
  margin: 0 0 22px;
  font-size: 0.95rem;
  color: #494949;
  line-height: 1.45;
}
.glass-panel p { line-height: 1.45; }
/* A compact form, not running text: no 2.5rem under paragraphs (tokens.css).
   As weak as that rule, so classes such as .lead keep their own margins. */
:where(.glass-panel) p { margin-bottom: 0; }

.login-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(135,32,18,0.08);
  color: #872012;
  font-size: 0.9rem;
}
.login-error a { color: inherit; }
.login-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--us-lilac-light);
  color: var(--us-lilac-text);
  font-size: 0.9rem;
}
/* Parts of a card that swap (reset link expired, reset e-mail sent). */
.glass-panel [hidden] { display: none; }
.glass-panel [tabindex="-1"]:focus { outline: none; }
.login-links {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.9rem;
}
.login-links a {
  /* --us-lilac-text: the lighter lilac was 4.06:1 on the glass over the dark backdrop. */
  color: var(--us-lilac-text);
  text-underline-offset: 3px;
  /* 24px tall to tap (WCAG 2.5.8): the links sit in rows close together. */
  display: inline-block;
  padding: 4px 2px;
}

/* Field labels; the radio and checkbox rows (.selector) keep their own look. */
.glass-panel label:not(.selector),
.glass-panel .line-label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #2E2E2E;
}
/* No space above the first field of a form (the staff form is the card itself). */
form.glass-panel > label:first-of-type,
.glass-panel form > label:first-of-type { margin-top: 0; }
.glass-panel .line-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.glass-panel .line-label label { margin: 0; }
.glass-panel .line-label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #494949;
}

.glass-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(25,25,27,0.12);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255,255,255,0.55);
  color: #19191B;
}
.glass-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus {
  outline: 2px solid #6257E8;
  outline-offset: 2px;
  border-color: transparent;
}

.glass-panel button[type="submit"] {
  margin-top: 22px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "Bricolage Grotesque", ui-serif, Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #19191B 0%, #423A75 100%);
  /* A solid colour under the gradient: what contrast checkers measure white text on. */
  background-color: var(--us-lilac-text);
  box-shadow: 0 4px 16px rgba(25,25,27,0.2);
}
.glass-panel button[type="submit"]:hover { filter: brightness(1.06); }

/* Anything marked hidden stays hidden, whatever the rules below say. */
.glass-panel [hidden] { display: none !important; }

/* The sign-up form's field rows (app.css draws them as underlined lines):
   one column, and fields like the ones above. */
.glass-panel .line-form,
.glass-panel .line-row,
.glass-panel .line-field { display: block; }
.glass-panel .line-label { line-height: normal; }
.glass-panel .line-control,
.glass-panel .line-control:focus-within {
  display: block;
  position: relative;
  border-bottom: 0;
  box-shadow: none;
}
.glass-panel .line-control .line-input { font-weight: 400; line-height: normal; }
.glass-panel .line-control .line-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  margin: 0;
  transform: translateY(-50%);
}
.glass-panel input[aria-invalid="true"] { border-color: #872012; }
.glass-panel .line-control:has(.line-toggle) input { padding-right: 44px; }
.glass-panel .signup-type { margin: 0 0 18px; }
.glass-panel .signup-end { margin-top: 18px; }
.glass-panel .field-error { margin: 6px 0 0; font-size: 0.85rem; color: #872012; }
.glass-panel .field-hint { margin: 6px 0 0; font-size: 0.85rem; color: #494949; }
.glass-panel [role="status"]:empty,
.glass-panel [role="alert"]:empty { margin: 0; }
