/* BeatFractal pages outside the studio: sign-in, account, admin. The
   studio's palette (css/studio.css), the logo's violet as the one accent. */

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-latin.4c98b9d4.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --ground: #191b21;
  --raised: #20232b;
  --well: #121419;
  --rule: #2d313b;
  --rule-strong: #3b404c;
  --ink: #edeae3;
  --ink-2: #a8abb4;
  --ink-3: #888b94; /* ≥4.5:1 on ground, raised and well (WCAG AA) */
  --accent: #8b4cfa;
  --accent-hover: #9d63fb;
  --link: #a270fb; /* the accent, lifted to ≥4.5:1 for text on the dark surfaces */
  --link-hover: #b68dfc;
  --accent-ink: #ffffff;
  --accent-soft: rgb(139 76 250 / 0.14);
  --focus: #c79bff;
  --error: #ff8a80;
  --ok: #7fd6a4;
  --radius: 6px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --ground: #f6f5f2;
    --raised: #ffffff;
    --well: #ffffff;
    --rule: #d2d6de;
    --rule-strong: #b9bec9;
    --ink: #17181d;
    --ink-2: #4c505b;
    --ink-3: #6a6e7b;
    --accent: #7432e8;
    --accent-hover: #6424d6;
    --link: #7432e8;
    --link-hover: #6424d6;
    --accent-soft: rgb(116 50 232 / 0.1);
    --focus: #7432e8;
    --error: #b42318;
    --ok: #17803d;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.5 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.logo { height: 40px; width: auto; display: block; align-self: flex-start; }
.logo-on-light { display: none; }
@media (prefers-color-scheme: light) {
  .logo-on-dark { display: none; }
  .logo-on-light { display: block; mix-blend-mode: multiply; }
}

h1 { margin: 0 0 8px; font-weight: 750; font-stretch: 112%; font-size: 32px; line-height: 1.1; letter-spacing: -0.015em; }
h2 { margin: 0 0 4px; font-weight: 700; font-stretch: 108%; font-size: 19px; line-height: 1.25; }
.lede, .hint { color: var(--ink-2); }
.lede { margin: 0 0 24px; max-width: 34em; }
.hint { margin: 0; font-size: 13.5px; }

form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select {
  height: 44px; padding: 0 12px; width: 100%;
  font: inherit; font-size: 16px;
  color: var(--ink); background: var(--well);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
.field input:hover { border-color: var(--ink-3); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 35%, transparent); }
.field input[aria-invalid='true'] { border-color: var(--error); }
.field.code input { font-variant-numeric: tabular-nums; letter-spacing: 0.3em; font-size: 22px; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 18px;
  font: inherit; font-weight: 650; font-size: 15px; text-decoration: none;
  color: var(--ink); background: transparent;
  border: 1px solid var(--rule-strong); border-radius: var(--radius); cursor: pointer;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--error); border-color: color-mix(in oklab, var(--error) 50%, transparent); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13.5px; font-weight: 600; }
.btn:disabled { cursor: progress; opacity: 0.65; }
.btn svg { width: 18px; height: 18px; flex: none; }
.link { padding: 0; font: inherit; color: var(--link); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.status { margin: 0; font-size: 14px; color: var(--error); }
.status:empty { display: none; }
.status.ok { color: var(--ok); }
.notice { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent); font-size: 14px; }
.notice.error { background: color-mix(in oklab, var(--error) 12%, transparent); border-color: color-mix(in oklab, var(--error) 40%, transparent); }

.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--rule); }

.fine { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.fine a { color: var(--ink-2); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12.5px; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule); }
td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--rule-strong); color: var(--ink-2); }
.tag.pro { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 50%, transparent); }
.tag.off { color: var(--error); border-color: color-mix(in oklab, var(--error) 50%, transparent); }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13.5px; }

/* The language menu in the top bar (written by tools/i18n-pages.mjs; closed on
   an outside click or Escape by ui/langmenu.js). Plain links, so it works
   without JavaScript and search engines follow every language. */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lang-menu .lm-caret { opacity: 0.7; transition: transform 0.15s; }
.lang-menu[open] .lm-caret { transform: rotate(180deg); }
.lang-menu .lm-code { display: none; }
.lang-menu .lm-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 170px;
  margin: 0; padding: 6px; list-style: none; display: grid; gap: 2px;
  background: var(--raised); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.35);
}
.lang-menu .lm-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 500;
}
.lang-menu .lm-list a:hover, .lang-menu .lm-list a:focus-visible { background: var(--accent-soft); }
.lang-menu .lm-list a[aria-current]::after { content: "✓"; color: var(--accent); font-weight: 700; }
@media (max-width: 520px) {
  .lang-menu .lm-name { display: none; }
  .lang-menu .lm-code { display: inline; }
}
@media (prefers-reduced-motion: reduce) { .lang-menu .lm-caret { transition: none; } }
