/* Sign-in page (index.html): wordmark, headline and a small card on the left, a tall art panel on the right.
   Page-scoped on top of style.css. The art is decorative, cycled by login.js and hidden below 900px. */

:root {
  --lg-card: #fff;
  --lg-card-line: oklch(14.5% 0 0 / .09);
  --lg-soft: #fff;
  --lg-soft-hover: oklch(97% 0 0);
  --lg-soft-ring: oklch(14.5% 0 0 / .12);
  --lg-main: oklch(17% 0 0);
  --lg-main-hover: oklch(28% 0 0);
  --lg-main-ink: #fff;
  --lg-field: #fff;
  --lg-ring: var(--brand);
  /* Art: a warm sand grey that deepens slightly towards the bottom, with graphite ink and one amber accent. */
  --lg-art: linear-gradient(162deg, oklch(96% .014 80) 0%, oklch(92.5% .02 72) 46%, oklch(88% .026 64) 100%);
  --lg-art-ink: oklch(26% .02 60);
  --lg-art-edge: oklch(40% .04 60 / .1);
  --lg-glow: oklch(100% 0 0 / .55);
  --lg-hatch: oklch(45% .05 60 / .09);
  --lg-note: oklch(100% 0 0 / .62);
  --lg-note-edge: oklch(40% .04 60 / .1);
  --lg-note-line: oklch(40% .04 60 / .14);
  --lg-note-chip: oklch(40% .04 60 / .08);
  --lg-note-shadow: 0 1.5cqmin 4cqmin -2cqmin oklch(35% .05 60 / .18);
  --lg-chip: oklch(100% 0 0 / .5);
  --lg-chip-edge: oklch(40% .04 60 / .12);
  --lg-chip-ink: oklch(34% .02 60);
  --lg-chip-on: oklch(22% .012 60);
  --lg-chip-on-ink: #fff;
  --lg-page: #fff;
  --lg-page-edge: oklch(40% .04 60 / .1);
  --lg-page-shadow: oklch(35% .06 60 / .28);
  --lg-page-ink: oklch(20% .01 60);
  --lg-page-muted: oklch(50% .015 60);
  --lg-page-line: oklch(93% .01 70);
  --lg-page-soft: oklch(97% .01 75);
  --lg-page-chip: oklch(95% .04 70);
  --lg-page-chip-ink: oklch(46% .11 52);
  --lg-cta: oklch(22% .012 60);
  --lg-tick: oklch(70% .17 52);
}
:root[data-theme="dark"] {
  --lg-card: oklch(17% 0 0);
  --lg-card-line: oklch(100% 0 0 / .08);
  --lg-soft: oklch(25% 0 0);
  --lg-soft-hover: oklch(29% 0 0);
  --lg-soft-ring: transparent;
  --lg-main: oklch(97% 0 0);
  --lg-main-hover: #fff;
  --lg-main-ink: oklch(15% 0 0);
  --lg-field: oklch(14% 0 0);
  --lg-ring: oklch(70% .17 262);
  --lg-art: linear-gradient(162deg, oklch(31% .014 72) 0%, oklch(26% .012 66) 46%, oklch(21% .01 60) 100%);
  --lg-art-ink: oklch(96% .008 80);
  --lg-art-edge: oklch(100% 0 0 / .08);
  --lg-glow: oklch(100% .02 75 / .07);
  --lg-hatch: oklch(100% .02 75 / .06);
  --lg-note: oklch(100% .02 75 / .07);
  --lg-note-edge: oklch(100% 0 0 / .09);
  --lg-note-line: oklch(100% 0 0 / .16);
  --lg-note-chip: oklch(100% 0 0 / .1);
  --lg-note-shadow: 0 1.5cqmin 4cqmin -2cqmin oklch(0% 0 0 / .3);
  --lg-chip: oklch(100% .02 75 / .06);
  --lg-chip-edge: oklch(100% 0 0 / .1);
  --lg-chip-ink: oklch(100% 0 0 / .78);
  --lg-chip-on: oklch(96% .008 80);
  --lg-chip-on-ink: oklch(20% .01 60);
  --lg-page: oklch(18% .006 65);
  --lg-page-edge: oklch(100% 0 0 / .09);
  --lg-page-shadow: oklch(0% 0 0 / .5);
  --lg-page-ink: oklch(96% .005 80);
  --lg-page-muted: oklch(72% .012 70);
  --lg-page-line: oklch(28% .01 65);
  --lg-page-soft: oklch(22% .008 65);
  --lg-page-chip: oklch(32% .06 60);
  --lg-page-chip-ink: oklch(86% .09 70);
  --lg-cta: oklch(96% .008 80);
  --lg-tick: oklch(72% .16 55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lg-card: oklch(17% 0 0);
    --lg-card-line: oklch(100% 0 0 / .08);
    --lg-soft: oklch(25% 0 0);
    --lg-soft-hover: oklch(29% 0 0);
    --lg-soft-ring: transparent;
    --lg-main: oklch(97% 0 0);
    --lg-main-hover: #fff;
    --lg-main-ink: oklch(15% 0 0);
    --lg-field: oklch(14% 0 0);
    --lg-ring: oklch(70% .17 262);
    --lg-art: linear-gradient(162deg, oklch(31% .014 72) 0%, oklch(26% .012 66) 46%, oklch(21% .01 60) 100%);
    --lg-art-ink: oklch(96% .008 80);
    --lg-art-edge: oklch(100% 0 0 / .08);
    --lg-glow: oklch(100% .02 75 / .07);
    --lg-hatch: oklch(100% .02 75 / .06);
    --lg-note: oklch(100% .02 75 / .07);
    --lg-note-edge: oklch(100% 0 0 / .09);
    --lg-note-line: oklch(100% 0 0 / .16);
    --lg-note-chip: oklch(100% 0 0 / .1);
    --lg-note-shadow: 0 1.5cqmin 4cqmin -2cqmin oklch(0% 0 0 / .3);
    --lg-chip: oklch(100% .02 75 / .06);
    --lg-chip-edge: oklch(100% 0 0 / .1);
    --lg-chip-ink: oklch(100% 0 0 / .78);
    --lg-chip-on: oklch(96% .008 80);
    --lg-chip-on-ink: oklch(20% .01 60);
    --lg-page: oklch(18% .006 65);
    --lg-page-edge: oklch(100% 0 0 / .09);
    --lg-page-shadow: oklch(0% 0 0 / .5);
    --lg-page-ink: oklch(96% .005 80);
    --lg-page-muted: oklch(72% .012 70);
    --lg-page-line: oklch(28% .01 65);
    --lg-page-soft: oklch(22% .008 65);
    --lg-page-chip: oklch(32% .06 60);
    --lg-page-chip-ink: oklch(86% .09 70);
    --lg-cta: oklch(96% .008 80);
    --lg-tick: oklch(72% .16 55);
  }
}

/* Layout */
main.login {
  max-width: none; width: auto; margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 3.5vw, 56px); padding: 24px clamp(24px, 3vw, 40px);
}
.login-side { display: flex; flex-direction: column; min-width: 0; }
.login-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 4px 0 0 clamp(0px, 4vw, 64px); }
.login-logo { display: inline-flex; align-items: center; color: var(--strong); }
.login-logo:hover { text-decoration: none; }
.login-logo .logo-wordmark { display: block; width: 110px; height: 26px; color: var(--strong); fill: currentColor; }
.login-lang { display: inline-flex; min-height: 36px; }
.login-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; text-align: center; padding: 40px 0 32px; }
.login-title {
  margin: 0; max-width: 18ch; font-family: var(--font); font-weight: 500; font-size: clamp(36px, 4.2vw, 58px); line-height: 1.05;
  letter-spacing: -.03em; color: var(--strong); text-wrap: balance;
}
.login-sub { margin: 14px 0 32px; max-width: 34ch; font-size: 17px; line-height: 1.45; color: var(--subtle); text-wrap: balance; }
.login-card {
  width: 100%; max-width: 432px; padding: 26px; text-align: left; border-radius: 22px;
  background: var(--lg-card); border: 1px solid var(--lg-card-line);
  box-shadow: 0 1px 2px oklch(0% 0 0 / .03), 0 12px 32px -18px oklch(0% 0 0 / .14);
}
.login-lead { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--text); text-align: center; text-wrap: pretty; }
.login-lead:empty { display: none; }
.login-stack { display: flex; flex-direction: column; gap: 12px; }
.login-card input:not([type="checkbox"]) {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 11px; font-size: 15px; background: var(--lg-field);
}
/* The brand blue is too dark to read as a focus ring on the dark card. */
.login-card input:focus { border-color: transparent; box-shadow: 0 0 0 1.5px var(--lg-ring); }
.login-card .otp { flex: none; }
.login-card .otp-slots { gap: 8px; }
.login-card .otp-slots i { height: 50px; border-radius: 11px; background: var(--lg-field); }
.login-card .otp-slots i.on { box-shadow: 0 0 0 2px var(--lg-ring); }

/* Buttons: soft (passkey, second choice) and main (full-width ink). */
.login-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 46px; padding: 0 16px;
  border: 0; border-radius: 11px; font-size: 15px; font-weight: 500; line-height: 1.2; cursor: pointer; transition: background-color .12s, box-shadow .12s;
}
.login-btn .ic { width: 18px; height: 18px; vertical-align: 0; }
.login-btn.soft { background: var(--lg-soft); color: var(--strong); box-shadow: 0 0 0 1px var(--lg-soft-ring), 0 1px 2px oklch(0% 0 0 / .04); }
.login-btn.soft:hover { background: var(--lg-soft-hover); }
.login-btn.main { background: var(--lg-main); color: var(--lg-main-ink); box-shadow: 0 1px 2px oklch(0% 0 0 / .12); }
.login-btn.main:hover { background: var(--lg-main-hover); }
.login-btn:focus-visible { outline: 2px solid var(--lg-ring); outline-offset: 2px; box-shadow: none; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; font-size: 12px; color: var(--subtle); }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--lg-card-line); }
.login-card #message .notice { margin: 12px 0 0; }
.login-card #passkey-step { margin-top: 12px; }
.login-legal { margin: 16px 0 0; font-size: 12px; line-height: 1.5; color: var(--subtle); text-align: center; text-wrap: balance; }
.login-legal:empty { display: none; }
.login-legal a { color: var(--link); }
.login-note { margin: 22px 0 0; max-width: 40ch; font-size: 13px; line-height: 1.5; color: var(--subtle); text-wrap: balance; }
.login-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding-bottom: 4px; font-size: 12.5px; color: var(--subtle); }
.login-links a { color: var(--subtle); }
.login-links a:hover { color: var(--text); }

/* Art panel: two finished-task notes behind a browser window whose card cycles through tasks,
   the module list with the current one lit, and a caption. Sizes use cqmin so short windows shrink evenly.
   The 45° hatch (soft stops, so thin lines do not alias into stray strokes) is the same line language as the setup art and the globe cards. */
.login-art {
  position: sticky; isolation: isolate; overflow: hidden; container-type: size; align-self: start; top: max(24px, calc((100dvh - min(800px, 100dvh - 48px)) / 2));
  width: min(640px, 46vw); height: min(800px, calc(100dvh - 48px)); min-height: 560px; border-radius: 20px;
  background: var(--lg-art); color: var(--lg-art-ink);
  /* clip-path keeps the rounded corners clean even while children animate on their own layers. */
  clip-path: inset(0 round 20px);
}
/* The hairline sits above the art so nothing paints over the panel edge. */
.login-art::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--lg-art-edge); pointer-events: none; }
.art-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.art-glow::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 42% at 50% 32%, var(--lg-glow), transparent 70%); }
.art-glow::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 .25px, var(--lg-hatch) .75px 1.25px, transparent 1.75px 8px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 38%, #000 100%); mask-image: linear-gradient(to bottom, transparent 38%, #000 100%);
}
.art-stage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6cqmin 7cqmin; }
.art-notes, .art-window, .art-chips { width: min(100%, 86cqmin); }
.art-notes { position: relative; height: 22cqmin; margin-bottom: -5cqmin; }
.art-note {
  position: absolute; top: 0; width: 47%; padding: 2.8cqmin 3.2cqmin 3.4cqmin; border-radius: 2.4cqmin;
  background: var(--lg-note); box-shadow: inset 0 0 0 1px var(--lg-note-edge), var(--lg-note-shadow); color: var(--lg-art-ink);
  animation: art-drift 11s ease-in-out infinite alternate;
}
.art-note.n1 { left: 0; rotate: -3deg; }
.art-note.n2 { right: 0; top: 2cqmin; rotate: 3deg; animation-delay: -5.5s; }
.art-note b { display: block; margin-top: 1.6cqmin; font-weight: 500; font-size: 3.2cqmin; line-height: 1.15; letter-spacing: -.02em; }
.art-note i { display: block; height: .9cqmin; margin-top: 1.5cqmin; border-radius: 1cqmin; background: var(--lg-note-line); }
.art-note i.s { width: 56%; }
.art-chip {
  display: inline-block; padding: .45cqmin 1.5cqmin; border-radius: 99px; font-size: 1.8cqmin; font-weight: 600; line-height: 1.4; letter-spacing: 0;
  background: var(--lg-page-chip); color: var(--lg-page-chip-ink);
}
.art-note .art-chip { background: var(--lg-note-chip); color: var(--lg-art-ink); }

.art-window {
  position: relative; z-index: 1; height: 50cqmin; border-radius: 2.6cqmin; overflow: hidden;
  background: var(--lg-page); color: var(--lg-page-ink);
  box-shadow: 0 0 0 1px var(--lg-page-edge), 0 3cqmin 8cqmin -3cqmin var(--lg-page-shadow);
  animation: art-drift 13s ease-in-out -3s infinite alternate;
}
.art-bar { display: flex; align-items: center; gap: 1.1cqmin; height: 7cqmin; padding: 0 2.8cqmin; border-bottom: 1px solid var(--lg-page-line); }
.art-bar span { width: 1.3cqmin; height: 1.3cqmin; border-radius: 50%; background: var(--lg-page-line); }
.art-bar em {
  flex: 1; min-width: 0; margin-left: 1.6cqmin; padding: .6cqmin 2cqmin; border-radius: 99px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: var(--lg-page-soft); color: var(--lg-page-muted); font-style: normal; font-size: 1.9cqmin; letter-spacing: 0;
}
.art-body { display: grid; grid-template-columns: minmax(0, 1fr) 34%; align-items: center; gap: 4cqmin; height: calc(100% - 7cqmin); padding: 0 4.6cqmin; }
.art-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.art-text b { display: block; margin-top: 2cqmin; font-weight: 500; font-size: 5.2cqmin; line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }
.art-text i { display: block; width: 100%; height: 1cqmin; margin-top: 1.8cqmin; border-radius: 1cqmin; background: var(--lg-page-line); }
.art-text i:first-of-type { margin-top: 2.6cqmin; }
.art-text i.s { width: 62%; }
.art-cta { width: 15cqmin; height: 4.6cqmin; margin-top: 3cqmin; border-radius: 99px; background: var(--lg-cta); }
.art-text .art-chip, .art-text b { transition: opacity .3s ease, translate .4s cubic-bezier(.2, .7, .2, 1); }
.art-window.swap .art-text .art-chip, .art-window.swap .art-text b { opacity: 0; translate: 0 1cqmin; }
/* A document tile: a hatched sheet with a done tick, in the page's own colours. */
.art-doc { position: relative; aspect-ratio: 1 / 1.25; border-radius: 2cqmin; background: var(--lg-page-soft); overflow: hidden; }
.art-doc::before {
  content: ""; position: absolute; inset: 14% 16% 20%; border-radius: 1.2cqmin; background: var(--lg-page);
  box-shadow: 0 0 0 1px var(--lg-page-line);
  /* One diagonal per square tile: the corners meet, so the lines run on without repeating-gradient aliasing. */
  background-image: linear-gradient(45deg, transparent calc(50% - .7px), var(--lg-page-line) calc(50% - .7px) calc(50% + .7px), transparent calc(50% + .7px));
  background-size: 2cqmin 2cqmin;
}
.art-doc::after {
  content: ""; position: absolute; right: 9%; bottom: 10%; width: 9cqmin; height: 9cqmin; border-radius: 50%; background: var(--lg-tick);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E");
  background-size: 55%; background-position: center; background-repeat: no-repeat;
}

.art-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 1cqmin; margin: 6cqmin 0 0; padding: 0; list-style: none; }
.art-chips li {
  padding: .8cqmin 1.7cqmin; border-radius: 99px; font-size: 1.95cqmin; line-height: 1.35; color: var(--lg-chip-ink);
  background: var(--lg-chip); box-shadow: inset 0 0 0 1px var(--lg-chip-edge); transition: background-color .6s ease, color .6s ease;
}
.art-chips li.on { background: var(--lg-chip-on); color: var(--lg-chip-on-ink); box-shadow: none; }
.art-caption { margin: 5cqmin 0 0; max-width: 30ch; font-size: 3.3cqmin; font-weight: 500; line-height: 1.3; letter-spacing: -.02em; color: var(--lg-art-ink); text-align: center; text-wrap: balance; }
@keyframes art-drift { from { translate: 0 0; } to { translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) {
  .art-note, .art-window { animation: none; }
  .art-text .art-chip, .art-text b, .art-chips li { transition: none; }
}
:root[data-motion="reduce"] :is(.art-note, .art-window) { animation: none; }
:root[data-motion="reduce"] :is(.art-text .art-chip, .art-text b, .art-chips li) { transition: none; }

/* Mid widths: the wordmark lines up with the card edge. Phones: the card only. */
@media (max-width: 1180px) {
  .login-head { padding-left: 0; }
}
@media (max-width: 899px) {
  main.login { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; }
  .login-art { display: none; }
  .login-center { padding: 40px 0 24px; }
  .login-title { font-size: clamp(32px, 9vw, 42px); }
  .login-sub { font-size: 16px; margin-bottom: 24px; }
  .login-card { padding: 20px; border-radius: 18px; }
  .login-card .otp-slots { gap: 6px; }
  .login-card input:not([type="checkbox"]) { font-size: 16px; } /* iOS zooms into smaller fields */
  .login-note { font-size: 13px; }
}

/* Framer pass: a faint hairline grid (style.css .hairgrid) behind the title and form, fading out around them. */
.login-center.hairgrid::before { inset: 0 -24px; -webkit-mask: radial-gradient(55% 50% at 50% 42%, #000 15%, transparent 78%); mask: radial-gradient(55% 50% at 50% 42%, #000 15%, transparent 78%); }
