/* Isolated login styles adapted from web/src/app/globals.css.
   App-wide input and theme overrides must not change the reference login. */
:root {
  --page: #fff;
  --ink: #002157;
  --blue: #002157;
  --muted: hsl(215 16% 43%);
  --border: hsl(215 30% 90%);
  /* The fields' only edge, 3.5:1 on the page (1.4.11). */
  --input: hsl(215 16% 55%);
  --action: #002157;
  --on-action: #fff;
  --action-hover: #19376a;
  --ring: #002157;
  --ground: #9e9e9e;
  --error: #a02929;
  --notice: #3d6248;
  color-scheme: light;
  font: 16px/1.5 'Avenir Next', Avenir, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}
/* Dark, as the viewer's appearance says (boot.js marks the root, the device's by default): the
   Next login's dark palette (web/src/app/globals.css .dark). */
:root.dark {
  --page: #1c1a17;
  --ink: #eee9df;
  --blue: #eee9df;
  --muted: #b6ad9f;
  --border: #484136;
  --input: #7d7464;
  --action: #b8cde5;
  --on-action: #142c49;
  --action-hover: #cfdded;
  --ring: #c8ae68;
  --ground: #776c58;
  --error: #f5a5a5;
  --notice: #b6d0b6;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, p { margin: 0; }
h1 { font-family: 'Publico Banner', Publico, Georgia, 'Times New Roman', serif; font-weight: 400; line-height: 1.15; }
button, input { font: inherit; }

.login-body { background: var(--page); }
.login-body::before { display: none; }
.login-page { margin: 0; min-height: 100dvh; display: grid; place-items: center; padding: 48px 20px; isolation: isolate; }
/* The same shared renderer as Next's TileField, using its splash variant.
   No static login image: the canvas samples and crossfades the shared scene set. */
.login-art { position: fixed; inset: 0 0 auto; height: 100vh; height: calc(100lvh + 8rem); z-index: -1; background: var(--page); pointer-events: none; }
.login-art canvas { background: var(--ground); display: block; width: 100%; height: 100%; }
.login-card { width: 100%; max-width: 448px; padding: 44px 40px; border-radius: 32px; background: var(--page); }
.login-identity, .login-heading { text-align: center; }
.login-identity img { display: block; width: 216px; height: auto; margin: 0 auto 10px; }
/* The reverse logo on the dark card, as the Next login's BrandLogo swaps it. */
.login-identity .login-logo-dark, :root.dark .login-identity .login-logo-light { display: none; }
:root.dark .login-identity .login-logo-dark { display: block; }
.login-identity p { color: var(--muted); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 32px; }
.login-heading h1 { font-size: 39.056px; margin-bottom: 8px; color: var(--blue); }
.login-heading p { color: var(--muted); margin-bottom: 32px; }
#login-form { display: grid; gap: 16px; }
.login-fields { border: 1px solid var(--input); border-radius: 12px; }
.login-field { position: relative; display: grid; align-items: center; padding: 22px 16px 8px; }
.login-field:first-child { border-start-start-radius: inherit; border-start-end-radius: inherit; }
.login-field:last-child { border-end-start-radius: inherit; border-end-end-radius: inherit; }
.login-field:focus-within { outline: 2px solid var(--ring); outline-offset: 0; z-index: 1; }
.login-field label { position: absolute; top: 7px; left: 16px; color: var(--muted); font-size: 11px; line-height: 16px; font-weight: 400; pointer-events: none; transform-origin: left top; transition: transform 150ms ease; }
.login-field input, .login-field input:focus, .login-field input:focus-visible { display: block; width: 100%; border: 0; padding: 0; min-height: 24px; background: transparent; border-radius: 0; color: var(--ink); font: inherit; font-size: 16px; outline: none; box-shadow: none; }
.login-field input:placeholder-shown:not(:focus) + label { transform: translateY(15px) scale(1.4545); }
.login-password { border-top: 1px solid var(--border); animation: login-reveal 220ms ease-out; }
.login-submit { width: 100%; min-height: 44px; border: 0; border-radius: 8px; background: var(--action); color: var(--on-action); font: inherit; font-size: 16px; cursor: pointer; }
.login-start { width: auto; min-width: 144px; margin-inline: auto; padding: 0 24px; }
.login-submit:hover { background: var(--action-hover); }
.login-submit:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
.login-submit:disabled { opacity: .7; cursor: wait; }
.login-error { color: var(--error); font-size: 14px; margin: 0; }
.login-error:empty { display: none; }
.login-notice { color: var(--notice); text-align: center; font-size: 14px; }
/* With ZITADEL, Sign in is a link to the auth SDK (docs/plans/auth-sdk.md), drawn as the button. */
.login-provider { display: grid; gap: 16px; }
a.login-submit { display: flex; align-items: center; justify-content: center; text-decoration: none; }
a.login-start { width: fit-content; }
.login-provider .login-error { text-align: center; }
/* The demo's way in (docs/plans/auth-sdk.md, phase 3): the same shape, outlined. */
.login-secondary { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 24px; border: 1px solid var(--input); border-radius: 8px; color: var(--blue); text-decoration: none; font-size: 16px; }
.login-secondary:hover { border-color: var(--action); }
.login-secondary:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
.login-provider .login-demo { margin-top: 0; }
.login-provider .login-demo a { color: var(--blue); }
.login-demo { text-align: center; color: var(--muted); font-size: 12px; margin: 32px 0 0; }
.login-pending, .htmx-request .login-idle { display: none; }
.htmx-request .login-pending { display: inline; }
@keyframes login-reveal { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 1023px) {
  .login-body { overscroll-behavior: none; }
  .login-page { min-height: 100svh; padding: calc(32px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) calc(20px + env(safe-area-inset-left, 0px)); }
  .login-art { mask-image: linear-gradient(to bottom, transparent 0, #000 max(4rem, env(safe-area-inset-top, 0px)), #000 calc(100svh - 6rem), transparent 100svh); }
  .login-card { max-width: 544px; padding: 24px 20px; }
  .login-identity img { width: 176px; height: auto; }
  .login-identity p, .login-heading p { margin-bottom: 24px; }
  .login-heading h1 { font-size: clamp(28px, 8vw, 40px); }
  .login-heading p { font-size: 14px; }
  .login-demo { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-password { animation: none; }
  .login-field label { transition: none; }
}
