/* VALBLOX sign-in (login.html, and the sign-in modal on every other page), on top of styles.css + pages.css. As plain as
   a sign-in can be: one narrow key panel (the heavy Norse notch), the title, one field, one button, the 18+ line, one
   short line for new players; every explanation folded into "Why a code?" under it. Markup: brand/viking/src/page/
   build_login.py; behaviour: assets/js/login.js (the demo) and assets/server/login-server.js (the server).
   In the modal the dialog's head carries the title (vb-signin.css). */

.lg { width: 100%; max-width: 460px; margin: clamp(8px, 5vh, 56px) auto 0; }
.lg .ic--fwd { transform: scaleX(-1); }
.lg [hidden] { display: none !important; }   /* the panes, the step and the button rows set display, which would beat hidden */
.lg-card { display: flex; flex-direction: column; gap: 24px; padding: 30px 30px 24px; }

/* ---------------------------------------------------------------- the title (login.html only) */
.lg-head { display: flex; flex-direction: column; gap: 4px; }
.lg-title { font-size: 30px; line-height: 36px; letter-spacing: 1.2px; color: var(--lilac-light); text-transform: uppercase; text-shadow: 0 0 22px rgba(var(--lilac-rgb), .28); }
.lg-sub { font-family: "Skranji", sans-serif; font-size: 15px; line-height: 20px; letter-spacing: .3px; color: var(--muted); }

/* ---------------------------------------------------------------- the steps */
.lg-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.lg-pane { display: flex; flex-direction: column; gap: 14px; }
.lg-pane__t { align-self: flex-start; max-width: 100%; font-size: 19px; line-height: 25px; letter-spacing: 1px; color: var(--white); text-transform: uppercase; }   /* hugs its text, so the focus ring does too */
.lg-pane__t:focus { outline: none; }
.lg-pane__t:focus-visible { outline: 2px solid rgba(var(--lilac-rgb), .7); outline-offset: 4px; }
.lg-form { display: flex; flex-direction: column; gap: 16px; }
.lg-fs { min-width: 0; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 14px; }
.lg-fs:disabled .minput { opacity: .55; }
.lg-fs:disabled .btn { filter: saturate(.35) brightness(.78); cursor: default; }
.lg-step { display: flex; flex-direction: column; gap: 14px; }
.lg-user { height: 54px; }
.lg-user input { font-size: 17px; }
.lg-fs .fld, .lg-form > .fld { gap: 8px; }
.lg-fs .fld__msg:empty, .lg-form > .fld .fld__msg:empty { min-height: 0; margin-top: -8px; }   /* no message: no gap for it either */
.lg-go .ic { width: 20px; height: 20px; }

/* the second route's slot (login-server.js fills it; empty, it takes no room): route buttons stacked full width, or
   the email form. With a field in it, it keeps the room of one field (label 20 + 8 + 54), one button (52) and one
   message line (18), so the email and code states do not make the panel jump */
.lg-routes { display: flex; flex-direction: column; gap: 12px; }
.lg-routes:empty { display: none; }
.lg-routes:has(input) { min-height: calc(20px + 8px + 54px + 12px + 52px + 8px + 18px); }
.lg-routes .minput { height: 54px; }
.lg-routes .minput input { font-size: 17px; }

/* the 18+ tick: one line, a real checkbox (named by its label), a small recessed box that turns green when ticked */
.lg-age { display: flex; flex-direction: column; gap: 6px; }
.lg-age .fld__msg:empty { display: none; }
.lg-age__l { position: relative; align-self: flex-start; display: flex; align-items: center; gap: 10px; min-height: 28px; cursor: pointer;
  font-family: "Skranji", sans-serif; font-size: 14px; line-height: 20px; letter-spacing: .3px; color: var(--muted); }
.lg-age__l input { position: absolute; left: 0; top: 2px; width: 24px; height: 24px; margin: 0; opacity: 0; cursor: pointer; }
.lg-age__box {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center; color: transparent;
  background: linear-gradient(180deg, #19202B 0%, #1D2531 100%); box-shadow: inset 0 2px 0 rgba(5, 8, 12, .55), inset 0 0 0 1px #333C4B;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.lg-age__box .ic { width: 15px; height: 15px; }
.lg-age__l input:checked + .lg-age__box { color: #0F2A21; background: linear-gradient(180deg, #8DFFD6 0 50%, var(--green) 50% 100%); box-shadow: none; }
.lg-age__l:hover .lg-age__box { box-shadow: inset 0 2px 0 rgba(5, 8, 12, .55), inset 0 0 0 1px #4A5568; }
.lg-age__l:has(input:focus-visible) { outline: 2px solid var(--lilac); outline-offset: 4px; }
.lg-age.is-err .lg-age__box { box-shadow: inset 0 2px 0 rgba(5, 8, 12, .55), inset 0 0 0 1px var(--salmon); }
.lg-age__l a { color: var(--lilac); text-decoration: underline; text-underline-offset: 2px; }
.lg-age__l a:hover { color: var(--lilac-lighter); }
.lg-after { font-family: "Skranji", sans-serif; font-size: 13px; line-height: 18px; letter-spacing: .3px; color: var(--muted); }

/* the code: big gold words that wrap when the box is narrow, copy and make-a-new-one at the right */
.lg-code { height: auto; min-height: 60px; padding: 9px 9px 10px 16px; }
.lg-code__v { flex: 1; min-width: 0; padding-bottom: 2px; font-family: "Skranji", sans-serif; font-size: 19px; line-height: 26px; letter-spacing: .6px;
  color: var(--gold); text-shadow: 0 0 12px rgba(var(--gold-rgb), .22); overflow-wrap: anywhere; user-select: all; }
.lg-code .btn--icon { width: 40px; height: 40px; }
.lg-code .btn--icon .ic { width: 18px; height: 18px; }
.lg-code .btn--sm { height: 40px; }
.lg-code .btn.is-copied { color: var(--green); }

/* how: three short lines, a small number each */
.lg-how { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lg-how li { display: flex; align-items: baseline; gap: 10px; font-family: "Skranji", sans-serif; font-size: 14px; line-height: 20px; letter-spacing: .3px; color: var(--muted); }
.lg-how b { font-weight: 400; color: var(--white); }
.lg-how__n { flex: none; width: 18px; font-family: "GoldenSmile", sans-serif; font-size: 13px; line-height: 20px; color: var(--gold); text-align: center; }
.lg-acts { display: flex; align-items: center; gap: 12px; }
.lg-acts .btn--lg { flex: 1; }
.lg-acts > .btn:not(.btn--lg) { height: 52px; gap: 8px; --c: 12px; --n: 5px; }
.lg-acts .btn .ic { width: 18px; height: 18px; }
.lg-done { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lg-again {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px; border: 0; background: none; cursor: pointer;
  font-family: "Skranji", sans-serif; font-size: 14px; line-height: 20px; letter-spacing: .3px; color: var(--muted);
}
.lg-again .ic { width: 15px; height: 15px; }
.lg-again:hover { color: var(--lilac-lighter); }
.lg-again:hover span { text-decoration: underline; text-underline-offset: 2px; }
.lg-again:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; color: var(--lilac-lighter); }

/* the check: the picture with a turning ring while it looks, a green badge once it is found */
.lg-check { position: relative; isolation: isolate; display: flex; align-items: center; gap: 16px; min-height: 104px; padding: 16px 18px 18px; }
.lg-check > .plate { --c: 11px; --n: 4px; --bt: rgba(5, 8, 12, .5); --bb: rgba(var(--hi), .3); --face: linear-gradient(180deg, #19202B 0%, #1D2531 100%); }
.lg-check.is-ok > .plate { --rim: rgba(var(--green-rgb), .45); --glow: inset 0 0 18px rgba(var(--green-rgb), .1); }
.lg-check__pic { position: relative; width: 72px; height: 72px; flex: none; display: grid; place-items: center; }
.lg-check__pic .avatar { width: 58px; height: 58px; padding: 3px; transition: background .3s;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px); }
.lg-check__pic .avatar img { width: 52px; height: 52px;
  clip-path: polygon(12.4px 0, calc(100% - 12.4px) 0, 100% 12.4px, 100% calc(100% - 12.4px), calc(100% - 12.4px) 100%, 12.4px 100%, 0 calc(100% - 12.4px), 0 12.4px); }
.lg-check__ring {
  position: absolute; inset: 0; border-radius: 50%; display: none;
  background: conic-gradient(from 0deg, rgba(var(--lilac-rgb), 0) 0deg, rgba(var(--lilac-rgb), .95) 290deg, rgba(var(--lilac-rgb), 0) 291deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: lg-turn .9s linear infinite;
}
.lg-check.is-busy .lg-check__ring { display: block; }
.lg-check.is-busy .avatar { background: rgba(var(--lilac-rgb), .45); }
.lg-check.is-ok .avatar { background: rgba(var(--green-rgb), .75); }
.lg-check__ok {
  position: absolute; right: 1px; bottom: 1px; width: 26px; height: 26px; display: none; place-items: center; color: #0F2A21;
  background: linear-gradient(180deg, #8DFFD6 0 50%, var(--green) 50% 100%);
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
}
.lg-check__ok .ic { width: 15px; height: 15px; }
.lg-check.is-ok .lg-check__ok { display: grid; }
.lg-check__txt { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lg-check__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; line-height: 25px; letter-spacing: 1.2px;
  color: var(--player); text-transform: uppercase; text-shadow: 0 0 8px rgba(var(--player-glow), .3); }
.lg-check__s { font-family: "Skranji", sans-serif; font-size: 14px; line-height: 20px; letter-spacing: .3px; color: var(--muted); }
.lg-check.is-ok .lg-check__s { color: var(--green); }
.lg-check__hint { font-family: "Skranji", sans-serif; font-size: 13px; line-height: 18px; letter-spacing: .3px; color: var(--muted); }
@keyframes lg-turn { to { transform: rotate(1turn); } }

/* ---------------------------------------------------------------- "Why a code?": the explanations, folded */
.lg-why { margin-top: 2px; padding-top: 14px; box-shadow: inset 0 2px 0 var(--rule), inset 0 3px 0 rgba(var(--hi), .3); }
.lg-why > summary {
  list-style: none; display: flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer;
  font-family: "Skranji", sans-serif; font-size: 14px; line-height: 20px; letter-spacing: .3px; color: var(--muted);
}
.lg-why > summary::-webkit-details-marker { display: none; }
.lg-why > summary > .ic:first-child { width: 16px; height: 16px; flex: none; color: var(--lilac); }
.lg-why > summary .ic--chev { width: 16px; height: 16px; flex: none; margin-left: auto; opacity: .8; }
@media (prefers-reduced-motion: no-preference) { .lg-why > summary .ic--chev { transition: transform .25s cubic-bezier(.3, 1.3, .4, 1); } }
.lg-why[open] > summary { color: var(--lilac-light); }
.lg-why[open] > summary .ic--chev { transform: rotate(180deg); }
.lg-why > summary:hover { color: var(--lilac-lighter); }
.lg-why > summary:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.lg-why__in { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 2px 24px; }
.lg-why__in p { font-family: "Skranji", sans-serif; font-size: 13px; line-height: 19px; letter-spacing: .3px; color: var(--muted); }
.lg-why__in b { font-weight: 400; color: var(--white); }
.lg-why__demo b { color: var(--gold); }
.lg-main:has(> [data-pane="3"]:not([hidden])) > .lg-why { display: none; }   /* signed in: nothing left to explain */
.lg-fine { margin-top: -8px; font-family: "Skranji", sans-serif; font-size: 12px; line-height: 18px; letter-spacing: .3px; color: var(--muted); opacity: .8; }
.lg-fine a { color: var(--lilac); text-decoration: underline; text-underline-offset: 2px; }
.lg-fine a:hover { color: var(--lilac-lighter); }
.lg-fine a:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.lg noscript .note { margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  .lg-check__ring { animation: none; }
  .lg-check__pic .avatar { transition: none; }
}

/* ---------------------------------------------------------------- phones */
@container page (max-width: 560px) {
  .lg { margin-top: 4px; }
  .lg-card { padding: 22px 18px 18px; gap: 20px; }
  .lg-title { font-size: 26px; line-height: 32px; }
  .lg-pane__t { font-size: 17px; line-height: 23px; }
  .lg-code { padding-left: 14px; }
  .lg-code__v { font-size: 18px; line-height: 25px; letter-spacing: .4px; }
  .lg-code .btn--sm span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* icon only, still named */
  .lg-code .btn--sm { width: 40px; padding: 0 0 3px; }
  .lg-check { gap: 14px; padding: 14px 14px 16px; }
  .lg-acts > .btn:not(.btn--lg) { padding: 0 16px 4px; }
}

/* "Where is my About?": three drawn steps, loaded only when opened */
.lg-where { margin-top: -4px; }
.lg-where > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer;
  font-family: "Skranji", sans-serif; font-size: 14px; line-height: 20px; letter-spacing: .3px; color: var(--lilac); }
.lg-where > summary::-webkit-details-marker { display: none; }
.lg-where > summary .ic { width: 16px; height: 16px; flex: none; }
.lg-where > summary .ic--chev { opacity: .8; }
@media (prefers-reduced-motion: no-preference) { .lg-where > summary .ic--chev { transition: transform .25s cubic-bezier(.3, 1.3, .4, 1); } }
.lg-where[open] > summary .ic--chev { transform: rotate(180deg); }
.lg-where > summary:hover { color: var(--lilac-lighter); }
.lg-where > summary:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.lg-where__in { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lg-where__in li { display: flex; flex-direction: column; gap: 6px; }
.lg-where__in img { display: block; width: 100%; height: auto; border-radius: 8px; }
.lg-where__in span { font-family: "Skranji", sans-serif; font-size: 12px; line-height: 17px; letter-spacing: .3px; color: var(--muted); }
.lg-where__in span b { font-weight: 400; color: var(--white); }
.lg-where__in span > b:first-child { color: var(--gold); margin-right: 4px; }
@media (max-width: 560px) { .lg-where__in { grid-template-columns: 1fr; } .lg-where__in img { max-width: 300px; } }
