/* Auth pages (login.html, views/google-login-start.html, views/google-auth-callback.html):
   no sidebar, one centred card on a quiet brand backdrop. Copied from the mock's shared/auth.css
   and login.html styles. Scoped to body.auth so nothing leaks into the app pages that share shell.css. */
body.auth {
  min-height: 100vh; min-height: 100dvh; margin: 0;
  display: grid; place-items: center;
  padding: max(40px, env(safe-area-inset-top)) 16px max(88px, env(safe-area-inset-bottom));
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-feature-settings: 'cv11'; font-variant-numeric: tabular-nums;
}
/* Brand moment: the logo gradient as two soft, still pools of light behind the card. */
.auth-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
/* No filter: blur() here: on a 56vmax layer it rendered as visible rings. Long eased stops fade it out instead. */
.auth-bg::before, .auth-bg::after { content: ''; position: absolute; width: 60vmax; aspect-ratio: 1; opacity: 0.16; }
.auth-bg::before { left: -22vmax; top: -26vmax; background: radial-gradient(closest-side, var(--b-magenta), color-mix(in oklch, var(--b-magenta) 45%, transparent) 40%, color-mix(in oklch, var(--b-magenta) 12%, transparent) 72%, transparent); }
.auth-bg::after { right: -24vmax; bottom: -30vmax; background: radial-gradient(closest-side, var(--b-violet), color-mix(in oklch, var(--b-blue) 45%, transparent) 40%, color-mix(in oklch, var(--b-blue) 12%, transparent) 72%, transparent); }
:root[data-theme="dark"] .auth-bg::before, :root[data-theme="dark"] .auth-bg::after { opacity: 0.12; }

.auth-card {
  position: relative; width: min(100%, 420px); padding: 32px;
  border: 1px solid var(--line-soft); border-radius: 22px; background: var(--surface);
  box-shadow: 0 1px 2px oklch(0.2 0.03 285 / 0.04), 0 24px 60px -28px oklch(0.25 0.08 290 / 0.22);
  overflow: hidden; /* height glides between screens */
  animation: auth-in 420ms var(--ease) both;
}
@keyframes auth-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }

.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; color: var(--ink); font-size: 19px; font-weight: 650; letter-spacing: -0.015em; text-decoration: none; width: fit-content; }
.auth-brand svg { width: 34px; height: 34px; flex: none; }
.auth-brand .mark-part { transform-box: fill-box; transform-origin: center; animation: bubble-rise 520ms var(--ease) 120ms backwards; }
.auth-brand .mark-part + .mark-part { animation-delay: 190ms; }
.auth-brand .mark-part + .mark-part + .mark-part { animation-delay: var(--dur-base); }
.auth-card h1 { margin: 0; font-size: 28px; font-weight: 650; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; outline: 0; }
.auth-sub { margin: 8px 0 24px; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; text-wrap: pretty; }

/* Spinner: a ring, spun fast (a quicker spin reads as a quicker load). */
.spin { display: inline-block; width: 18px; height: 18px; flex: none; border: 2px solid color-mix(in oklch, currentColor 22%, transparent); border-top-color: currentColor; border-radius: 50%; animation: auth-spin 700ms linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

body.auth a:focus-visible, body.auth button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Login form ── */
.auth-google {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 46px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform 120ms var(--ease);
}
.auth-google svg { width: 18px; height: 18px; flex: none; }
.auth-google:active:not(:disabled) { transform: scale(0.98); }
.auth-google:disabled { cursor: wait; opacity: 0.6; }
@media (hover: hover) and (pointer: fine) { .auth-google:hover:not(:disabled) { background: var(--hover); border-color: color-mix(in oklch, var(--ink) 25%, var(--line)); } }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-3); font-size: 12.5px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.auth-form .field { width: 100%; height: 44px; border-radius: var(--r-md); font-size: 14.5px; }
.auth-form .field[aria-invalid="true"] { border-color: var(--late); }
.auth-form .field[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--late-soft); }
.auth-submit { width: 100%; height: 46px; margin-top: 4px; border-radius: var(--r-md); font-size: 14.5px; }
.auth-submit .spin { width: 16px; height: 16px; }
.auth-submit:disabled { cursor: wait; }

/* Error: grows open (rows 0fr→1fr) so the form below slides instead of jumping */
.auth-error { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--dur-base) var(--ease), opacity var(--dur-fast) var(--ease), margin-bottom var(--dur-base) var(--ease); }
.auth-error > div { overflow: hidden; min-height: 0; }
.auth-error p { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--late-soft); color: var(--late); font-size: 13px; line-height: 1.45; font-weight: 500; }
.auth-error svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.auth-error.show { grid-template-rows: 1fr; opacity: 1; margin-bottom: 16px; }
.auth-error.shake p { animation: auth-shake var(--dur-slow) var(--ease-in-out); }
@keyframes auth-shake { 20% { transform: translateX(-4px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } }

.auth-footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-soft); color: var(--ink-3); font-size: 12.5px; line-height: 1.6; text-align: center; }
.auth-footer p { margin: 0; }
.auth-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.auth-footer a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; transition: text-decoration-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.auth-footer a:hover { color: var(--ink); text-decoration-color: currentColor; }

/* ── Transfer screens (to Google / back from Google) ── */
.auth-transfer { text-align: center; }
.auth-transfer .auth-brand { margin: 0 auto 28px; }
.auth-transfer h1 { font-size: 24px; }
.auth-transfer .auth-sub { margin: 10px auto 24px; max-width: 32ch; }
.auth-transfer .spin { display: block; width: 34px; height: 34px; margin: 0 auto 24px; border-width: 3px; color: var(--accent); }
.auth-fail-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 20px; border-radius: 50%; background: var(--late-soft); color: var(--late); }
.auth-fail-icon svg { width: 22px; height: 22px; }
.auth-steps { display: flex; justify-content: center; gap: 6px; margin: -8px 0 22px; }
.auth-steps i { width: 18px; height: 4px; border-radius: 2px; background: var(--line); transition: background-color var(--dur-base) var(--ease), width var(--dur-base) var(--ease); }
.auth-steps i.on { width: 28px; background: var(--accent); }
.auth-back { color: var(--ink-2); font-size: 13px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; background: none; border: 0; cursor: pointer; font: inherit; font-weight: 500; }
.auth-back:hover { color: var(--ink); text-decoration-color: currentColor; }
.auth-transfer p:last-child { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: auth-fade var(--dur-base) ease both; }
  .auth-brand .mark-part { animation: none; }
  .spin { animation-duration: 1600ms; }
  .auth-error.shake p { animation: none; }
}
@keyframes auth-fade { from { opacity: 0; } }
