/* The sign-in page. One idea: the mark is a lattice of nodes, and here it is switched on. It lights up
   from its centre, then every few seconds sends a pulse through its own nodes and on across the dot
   grid of the page behind it (that part is drawn by login-scene.js). The words and the form arrive
   once, in order, and then keep still: what goes on moving is the mark and the page behind it, and
   both are quiet enough to type in front of.

   Every colour comes from the variables of theme.js / theme.css, so the light look needs nothing
   here but a few strengths. Nothing below is needed to sign in: with scripts off, or with motion
   turned down in the system settings, the page is the same page standing still. */

@property --mq-turn { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.mq-login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; overflow-x: hidden; }

/* ── Behind everything: two slow lights and the lattice ── */
.mq-aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.mq-aurora i { position: absolute; width: 52vmax; height: 52vmax; border-radius: 50%; filter: blur(72px); opacity: .2; will-change: transform; }
.mq-aurora i:first-child { left: -14vmax; top: -18vmax; background: radial-gradient(circle, rgb(var(--glow)) 0%, transparent 62%); animation: mq-drift-a 28s ease-in-out infinite alternate; }
.mq-aurora i:last-child { right: -16vmax; bottom: -22vmax; background: radial-gradient(circle, rgb(var(--glow-2)) 0%, transparent 62%); animation: mq-drift-b 34s ease-in-out infinite alternate; }
html.light .mq-aurora i { opacity: .26; }
#lattice { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; animation: mq-appear 1.4s ease-out .2s both; }

.mq-stage { position: relative; z-index: 10; width: 100%; max-width: 25rem; padding: 2.5rem 1.5rem; }

/* ── The mark ── */
.mq-hero { text-align: center; margin-bottom: 1.75rem; }
.mq-emblem { position: relative; width: 8.25rem; height: 8.25rem; margin: 0 auto 1.1rem; animation: mq-float 7s ease-in-out 1.6s infinite alternate; }
.mq-emblem > * { position: absolute; inset: 0; width: 100%; height: 100%; }
/* a ring of brand light turning slowly behind it */
.mq-halo { inset: -22% !important; width: auto !important; height: auto !important; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 18%, rgb(var(--glow) / .55) 32%, transparent 46% 62%, rgb(var(--glow-2) / .5) 78%, transparent 92%);
  filter: blur(22px); opacity: .55; animation: mq-appear 1.2s ease-out .2s both, mq-turn 16s linear infinite; }
html.light .mq-halo { opacity: .4; }
/* the pulse leaving the mark */
.mq-ring { border-radius: 50%; border: 1px solid rgb(var(--glow) / .7); box-shadow: 0 0 18px rgb(var(--glow) / .35), inset 0 0 18px rgb(var(--glow) / .2);
  opacity: 0; animation: mq-ping 4.2s cubic-bezier(.2, .6, .3, 1) 1.1s infinite; }
.mq-emblem-mark { animation: mq-reveal 1s cubic-bezier(.3, .7, .2, 1) .15s both; }
/* light on the nodes, and three signals running the lattice's lines */
.mq-signal { overflow: visible; }
.mq-signal .node { fill: rgb(var(--glow)); opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: mq-node 4.2s ease-out infinite; animation-delay: calc(1.1s + var(--d, 0) * 70ms); }
.mq-signal .node.b { fill: rgb(var(--glow-2)); }
.mq-signal .pulse { fill: rgb(var(--c-white)); filter: drop-shadow(0 0 4px rgb(var(--glow))) drop-shadow(0 0 9px rgb(var(--glow) / .8)); }
html.light .mq-signal .pulse { fill: rgb(var(--glow)); }
/* with the script running, the pulse is started by it, in step with the one drawn on the page */
.mq-live .mq-ring, .mq-live .mq-signal .node { animation: none; }
.mq-live.mq-beat .mq-ring { animation: mq-ping 1.9s cubic-bezier(.2, .6, .3, 1) both; }
.mq-live.mq-beat .mq-signal .node { animation: mq-node 1.5s ease-out both; animation-delay: calc(var(--d, 0) * 70ms); }

/* ── The name and what it is (both stand above the ring that widens out of the mark) ── */
.mq-title { position: relative; z-index: 1; font-size: 2.1rem; line-height: 1.15; font-weight: 600; color: rgb(var(--c-white)); animation: mq-rise .8s cubic-bezier(.2, .7, .2, 1) .45s both; }
.mq-title b { background: linear-gradient(100deg, rgb(var(--glow)) 0%, rgb(var(--glow-2)) 38%, rgb(var(--c-white)) 50%, rgb(var(--glow-2)) 62%, rgb(var(--glow)) 100%);
  background-size: 260% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: mq-sheen 7s ease-in-out 1.6s infinite; }
.mq-tagline { position: relative; z-index: 1; display: inline-block; margin-top: .6rem; padding-bottom: .85rem; font-size: .7rem; line-height: 1rem; font-weight: 500;
  letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; white-space: nowrap; color: rgb(var(--c-slate-400));
  animation: mq-rise .8s cubic-bezier(.2, .7, .2, 1) .6s both; }
.mq-tagline::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 4.5rem; height: 1px; margin-left: -2.25rem;
  background: linear-gradient(90deg, transparent, rgb(var(--glow) / .9), rgb(var(--glow-2) / .9), transparent); transform-origin: center;
  animation: mq-line 1s cubic-bezier(.2, .7, .2, 1) 1.5s both; }
/* a narrow phone (320–375 wide): the line, which does not wrap, is set a little tighter to stay inside the page */
@media (max-width: 380px) { .mq-tagline { font-size: .62rem; letter-spacing: .2em; text-indent: .2em; } }
.mq-tagline.is-spelled { text-indent: 0; }   /* each letter now sits centred in a cell of its own width */
.mq-tagline .ch { display: inline-block; text-align: center; text-indent: 0; }
.mq-tagline .ch.is-loose { color: rgb(var(--glow)); }

/* ── The form: a pane of glass with a light going round its edge ── */
.mq-card { position: relative; padding: 1.4rem 1.35rem 1.2rem; border-radius: 1.1rem; background: rgb(var(--b-slate-900) / .58);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgb(var(--c-slate-800)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), 0 30px 60px -32px rgb(0 0 0 / .85), 0 0 60px -30px rgb(var(--glow) / .35);
  animation: mq-rise .9s cubic-bezier(.2, .7, .2, 1) .7s both; }
html.light .mq-card { background: rgb(255 255 255 / .78); border-color: rgb(var(--c-slate-700)); box-shadow: 0 1px 2px rgb(15 23 42 / .06), 0 30px 60px -34px rgb(15 23 42 / .35), 0 0 60px -30px rgb(var(--glow) / .3); }
.mq-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--mq-turn), transparent 0 62%, rgb(var(--glow) / .95) 78%, rgb(var(--glow-2) / .95) 88%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: mq-edge 7s linear 1.4s infinite, mq-appear 1.2s ease-out 1.2s both; }
.mq-card.is-refused { animation: mq-rise .9s cubic-bezier(.2, .7, .2, 1) .7s both, mq-shake .45s ease-in-out 1.7s 1; }

.mq-fields > * + * { margin-top: .8rem; }
.mq-rise { animation: mq-rise .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(.95s + var(--i, 0) * 80ms); }
.mq-field { position: relative; }
.mq-field svg { position: absolute; left: .85rem; top: 50%; width: 1.15rem; height: 1.15rem; margin-top: -.575rem; pointer-events: none;
  fill: none; stroke: rgb(var(--c-slate-500)); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke 180ms ease; }
.mq-field input { width: 100%; height: 2.95rem; padding: 0 .9rem 0 2.65rem; border-radius: .7rem; font-size: 1rem; line-height: 1.5rem;
  color: rgb(var(--c-white)); background: rgb(var(--b-slate-800) / .72); border: 1px solid rgb(var(--c-slate-700));
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease; }
.mq-field input::placeholder { color: rgb(var(--c-slate-500)); }
.mq-field input:hover { border-color: rgb(var(--c-slate-600)); }
.mq-field input:focus { outline: none; border-color: rgb(var(--glow) / .85); background: rgb(var(--b-slate-800) / .95);
  box-shadow: 0 0 0 3px rgb(var(--glow) / .2), 0 0 22px -6px rgb(var(--glow) / .6); }
.mq-field:focus-within svg { stroke: rgb(var(--glow)); }
@media (min-width: 640px) { .mq-field input { font-size: .9375rem; } }   /* a phone keeps 1rem: smaller and iOS zooms the page on focus */
.mq-hint { margin-top: .35rem; padding-left: .2rem; font-size: .72rem; line-height: 1rem; color: rgb(var(--c-slate-500)); }

/* Tailwind's reset ([type='submit'] { background-image: none }) reaches the page after this file and
   weighs as much as one class, so the button's rules are written with the card's class as well. */
.mq-card .mq-submit { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; height: 2.95rem; border-radius: .7rem;
  font-size: .9375rem; font-weight: 600; letter-spacing: .01em; color: #fff; cursor: pointer;
  background: linear-gradient(100deg, #2563eb 0%, #4f46e5 100%); box-shadow: inset 0 1px 0 rgb(255 255 255 / .18), 0 10px 26px -12px rgb(79 70 229 / .9);
  transition: filter 180ms ease, box-shadow 180ms ease, transform 120ms ease; }
.mq-card .mq-submit::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .28), transparent); transition: left 600ms ease; }
.mq-card .mq-submit:hover { filter: brightness(1.1); box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 14px 30px -12px rgb(79 70 229 / 1); }
.mq-card .mq-submit:hover::after { left: 120%; }
.mq-card .mq-submit:active { transform: translateY(1px); }
.mq-card .mq-submit svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease; }
.mq-card .mq-submit:hover svg { transform: translateX(3px); }
.mq-spinner { display: none; width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 2px solid rgb(255 255 255 / .35); border-top-color: #fff; animation: mq-turn .7s linear infinite; }
.mq-card .mq-submit[aria-busy="true"] { cursor: progress; filter: saturate(.8) brightness(.95); }
.mq-card .mq-submit[aria-busy="true"] svg { display: none; }
.mq-card .mq-submit[aria-busy="true"] .mq-spinner { display: block; }

.mq-refusal { margin-top: .8rem; padding: .55rem .75rem; border-radius: .6rem; font-size: .8125rem; line-height: 1.25rem; text-align: center;
  color: rgb(var(--c-red-300)); background: rgb(var(--b-red-500) / .12); border: 1px solid rgb(var(--c-red-500) / .35); }
.mq-secure { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: 1rem; font-size: .72rem; line-height: 1rem; letter-spacing: .04em; color: rgb(var(--c-slate-500)); }
.mq-secure svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

@keyframes mq-appear { from { opacity: 0; } }
@keyframes mq-turn { to { transform: rotate(360deg); } }
@keyframes mq-edge { to { --mq-turn: 360deg; } }
@keyframes mq-float { from { transform: translateY(-3px); } to { transform: translateY(4px); } }
@keyframes mq-reveal { from { opacity: 0; clip-path: circle(0% at 50% 50%); transform: scale(.86) rotate(-8deg); } 60% { opacity: 1; } to { clip-path: circle(75% at 50% 50%); } }
@keyframes mq-ping { 0% { opacity: 0; transform: scale(.35); } 12% { opacity: .9; } 45%, 100% { opacity: 0; transform: scale(2.3); } }
@keyframes mq-node { 0%, 100% { opacity: 0; transform: scale(.4); } 9% { opacity: 1; transform: scale(1.25); } 30% { opacity: 0; transform: scale(.8); } }
@keyframes mq-rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
@keyframes mq-sheen { 0%, 55% { background-position: 100% 0; } 100% { background-position: 0% 0; } }
@keyframes mq-line { from { opacity: 0; transform: scaleX(0); } }
@keyframes mq-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes mq-drift-a { to { transform: translate(16vmax, 10vmax) scale(1.15); } }
@keyframes mq-drift-b { to { transform: translate(-14vmax, -12vmax) scale(1.2); } }

/* theme.css stops animations on elements for those who asked for less motion; these are the ones it
   cannot reach (drawn in ::before / ::after) and the signals the SVG moves by itself. */
@media (prefers-reduced-motion: reduce) {
  .mq-login *::before, .mq-login *::after { animation: none !important; transition: none !important; }
  .mq-signal .pulse, .mq-ring { display: none; }
}
