/* The sign-in stage (T-login, Louis 30 Nov 2026: candidate C2, spiral in the card).
 * Loaded by layouts/bare.eta, so it reaches every bare-shell page: /login, email code,
 * persona select, invite acceptance, OAuth consent (and the client portal pages, which
 * share the stage but keep their own lockup). Replaces the animated login battlefield
 * (public/js/login-background.js, removed) and the stacked Lituus logo.
 *
 * Sources. Colours are platform tokens (styles.css) except the glitch pair, which is the
 * brand web register's --teal #00d9c0 and --ether #a855f7 (lituus-brand brand-system.md),
 * the pair the studio website uses for its own RGB split. The chrome wash is the lab
 * sidebar's (lab ui/public/cohesive/nav-glass.css @ 12365bee). The glitch is one held frame
 * of lituus.studio's hero spiral idle animation (.hero-theme-trigger::before/::after,
 * themeTriggerIdleA at 8% and themeTriggerIdleB at 9%). Title type is the D-110 page title
 * (.list-title). Static throughout: no animation, canvas or noise.
 */

/* ---- Stage: the platform chrome, theme-independent like the top bar ---- */
.bare {
  background:
    radial-gradient(110% 40% at 0% 24%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    linear-gradient(180deg, var(--chrome-2), var(--chrome-3) 46%);
}
.bare--signin {
  flex-direction: column;
  --signin-primary-ink: var(--on-accent);
}
[data-theme="dark"] .bare--signin { --signin-primary-ink: var(--chrome-3); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .bare--signin { --signin-primary-ink: var(--chrome-3); }
}

/* ---- Card: follows the theme; the shadow is the one the bare card always had ---- */
.bare-card {
  padding: 2rem 1.75rem 1.75rem;
  border-color: transparent;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(13, 5, 32, 0.45), 0 2px 6px rgba(13, 5, 32, 0.3);
}
.bare-card h1 {
  margin: 0 0 0.25rem;
  font: 700 1.7rem/1.15 var(--font-display);
  letter-spacing: -0.01em;
}

/* ---- The sign-in mark: the spiral alone, 44px, with the still glitch ----
   One vendored file (app-mark-white.png, the top-bar spiral) serves both themes: white on
   the dark card, and filtered to black on the light card (the brand's mark-black on light
   grounds; brand-system.md allows black, white or deep purple only). Two masked copies of
   the spiral are sliced and nudged 2px: teal low, ether high. */
.signin-mark {
  position: relative;
  display: block;
  width: 44px;
  margin: 0 auto 1.25rem;
  isolation: isolate;
}
a.signin-mark:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 4px;
}
.signin-mark img {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(0);
}
[data-theme="dark"] .signin-mark img { filter: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .signin-mark img { filter: none; }
}
.signin-mark::before,
.signin-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  -webkit-mask: url("/brand/app-mark-white.png") center / contain no-repeat;
  mask: url("/brand/app-mark-white.png") center / contain no-repeat;
}
.signin-mark::before {
  background: #00d9c0;           /* brand web --teal */
  opacity: 0.42;
  clip-path: inset(47% 0 30%);
  transform: translate(-2px, 1px);
}
.signin-mark::after {
  background: #a855f7;           /* brand web --ether */
  opacity: 0.34;
  clip-path: inset(26% 0 50%);
  transform: translate(2px, -1px);
}

/* ===== Moved from styles.css "Login screen" (unchanged unless noted) ===== */
/* Everything on the sign-in card is centred; scoped to .login so the shared bare
   shell (persona-select) is untouched. */
.login {
  text-align: center;
}
.login .muted {
  margin: 0 0 1.75rem;
}
.login .error {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
/* T-login: an error line reads as one on every sign-in card (it was red only on /login). */
.bare-card .error { color: var(--danger); }

/* Both the primary variant and plain sign-in submit buttons use the same pair. */
.bare--signin :is(.btn-primary, button[type="submit"]:not(.btn, .btn-google)) {
  background: var(--accent);
  color: var(--signin-primary-ink);
}
.bare--signin :is(.btn-primary, button[type="submit"]:not(.btn, .btn-google)):hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--accent-strong);
  color: var(--signin-primary-ink);
}

/* Google and seeded Preview share a light button even when the card is dark. */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin: 0 auto;
  padding: 0 0.9rem;
  height: 40px;
  background: var(--on-accent);
  color: var(--chrome-3);
  border: 1px solid #747775;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn-google:hover {
  background: color-mix(in srgb, var(--chrome-3) 3%, var(--on-accent));
  color: var(--chrome-3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
}
.btn-google:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-google__icon {
  display: inline-flex;
  flex: 0 0 auto;
}

/* Two sign-in options. A ruled "or" separates the provider button(s) from the
   work-email one-time-code form, so the form reads as a second way in rather than
   an extra field the Google button needs. */
.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--line);
}
.login-email label {
  margin: 0 0 0.6rem;
  color: var(--ink);
  font-weight: 600;
}
.login-email input {
  margin-top: 0;
}
.login-email__hint {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
/* The form sits inside .login, not directly under .bare-card, so it misses the
   shared `.bare-card > form > button` rule and needs its own width and spacing. */
.login-email button {
  width: 100%;
  margin-top: 1rem;
  justify-content: center;
}

/* The theme switcher sits on its own line beneath the button, centred by the
   .login text-align. */
.login .theme-switch {
  margin-top: 2rem;
}
