/* ==========================================================================
   The admin sign-in page (design/admin-v2/DESIGN-ADMIN.md 18): the admin's dark look, one panel in
   the middle of the viewport's grid. A file of its own, with tokens.css: the page allows no inline
   style, and admin.css stays behind the sign-in.
   ========================================================================== */

* { box-sizing: border-box; }
html { height: 100%; }
/* The page's texts are put in its language as its script starts: nothing shows in English before
   that. Should the script not run at all, the page still shows after 2 s. */
html:not(.i18n-ready) body { visibility: hidden; animation: i18n-show 0s linear 2s forwards; }
@keyframes i18n-show { to { visibility: visible; } }
/* The admin page's loading screen, as in admin.css (SPEC 5.30; this page may not load that file): it
   shows when signing in goes on to the admin page, which starts with the same screen. */
.boot {
  position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 14px;
  visibility: visible; background: var(--c-viewport); animation: boot-end 0s linear 30s forwards;
}
@keyframes boot-end { to { visibility: hidden; } }
.boot img { display: block; }
.boot-bar { display: block; width: 128px; height: 2px; overflow: hidden; border-radius: 1px; background: rgba(255, 255, 255, 0.12); }
.boot-bar i { display: block; width: 40%; height: 100%; background: var(--c-red); animation: boot-run 1.1s ease-in-out infinite; }
@keyframes boot-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) {
  .boot-bar i { animation: none; width: 100%; opacity: 0.5; }
}
/* The panel's top stays put (a little above the middle): a message that appears grows it
   downwards, so the field never moves under the pointer. */
body {
  min-height: 100%; margin: 0; display: grid; justify-items: center; align-items: start; padding: max(32px, 16vh) 16px 32px;
  background-color: var(--c-viewport); color: var(--c-text);
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px;
  font: var(--fs-sm)/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--c-sel); outline-offset: 1px; }
::selection { background: var(--c-sel-fill); }

/* ===== the panel ===== */
.panel {
  width: 100%; max-width: 360px; overflow: hidden; border-radius: var(--r-3);
  background: var(--c-panel); box-shadow: var(--sh-pop); animation: enter var(--t-slow) var(--ease-out);
}
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* its title strip: the admin's icon and SAMMS Radio Admin, as in the admin's title bar */
.head {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  background: var(--c-chrome); border-bottom: 1px solid var(--c-sep);
}
.app-icon { display: block; width: 24px; height: 24px; flex: none; }
.brand { display: flex; align-items: center; gap: 7px; min-width: 0; }
.brand img { display: block; height: 13px; width: auto; }
.brand .radio { font-size: 15px; font-weight: 300; letter-spacing: 0.02em; color: #EDEDED; white-space: nowrap; transform: translateY(-1px); }

/* the language switch at the strip's right end, as in the admin's title bar */
.lang-seg { display: inline-flex; flex: none; gap: 2px; margin-left: auto; padding: 2px; border: 1px solid var(--c-sep); border-radius: var(--r-2); background: var(--c-well); }
.lang-seg button {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 6px; border: 0; border-radius: 3px;
  background: transparent; color: var(--c-text-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.lang-seg button:hover { color: #fff; background: #353535; }
.lang-seg button[aria-pressed="true"] { background: var(--c-sel-fill); color: #fff; }
.flag-me { display: block; width: 18px; height: 12px; flex: none; border-radius: 1px; }

form { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; }
h1 { margin: 0; font-size: var(--fs-xl); font-weight: 600; line-height: 1.25; }
.where { margin: -8px 0 4px; color: var(--c-muted); overflow-wrap: anywhere; }
.where b { color: var(--c-text-2); font-weight: 400; }

/* ===== the password ===== */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { color: var(--c-text-2); font-size: var(--fs-xs); }
.pw { position: relative; }
.pw input {
  width: 100%; height: 36px; padding: 0 64px 0 10px; outline: none;
  border: 1px solid var(--c-sep); border-radius: var(--r-2); background: var(--c-well);
  font: 15px var(--mono); letter-spacing: 0.04em;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.pw input:hover { border-color: #555; }
.pw input:focus { border-color: var(--c-sel); box-shadow: 0 0 0 1px var(--c-sel); }
.show {
  position: absolute; top: 4px; right: 4px; height: 28px; min-width: 52px; padding: 0 10px;
  border: 0; border-radius: var(--r-1); background: transparent; color: var(--c-text-2);
  font-size: var(--fs-xs); cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.show:hover { background: var(--c-raised); color: var(--c-text); }
.show:active { background: var(--c-press); }
.show.is-on { color: var(--c-link); }
/* "Caps Lock is on.": its line is always there, empty and taking no room while Caps Lock is off
   (the -5 px takes back the field's gap; the note puts it back when it shows) */
.caps { margin: -5px 0 0; color: var(--c-amber); font-size: var(--fs-xs); }
.caps > span { display: flex; align-items: center; gap: 6px; margin-top: 5px; animation: fadein var(--t-med) var(--ease-out); }
.caps svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ===== keep me signed in ===== */
.check { display: flex; align-items: center; gap: 8px; align-self: flex-start; cursor: pointer; }
.check input { width: 15px; height: 15px; margin: 0; flex: none; accent-color: var(--c-sel); cursor: pointer; }
.check-hint { margin: -9px 0 0 23px; color: var(--c-muted); font-size: var(--fs-xs); }

/* ===== the error line: emptied and filled again, so each try shows (and is read out) anew ===== */
.error {
  margin: 0; padding: 8px 10px; border-left: 2px solid var(--c-problem); border-radius: 0 var(--r-1) var(--r-1) 0;
  background: var(--c-problem-tint); color: var(--c-text); font-size: var(--fs-xs); line-height: 1.45;
  animation: slidein var(--t-slow) var(--ease-out);
}
.error:empty { display: none; }
@keyframes slidein { from { opacity: 0; transform: translateY(-4px); } }
@keyframes fadein { from { opacity: 0; } }

/* ===== the button ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; margin-top: 2px; padding: 0 14px;
  border: 1px solid var(--c-sep); border-radius: var(--r-2); background: var(--c-raised); box-shadow: inset 0 1px 0 var(--c-bevel);
  color: var(--c-text); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast);
}
.btn.primary { background: var(--c-sel-fill); border-color: #1B3D5E; color: #fff; }
.btn.primary:hover { background: var(--c-sel-fill-hover); }
.btn:active { box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45); transform: translateY(1px); }
.btn:disabled { cursor: default; transform: none; }
.btn.is-busy::after {
  content: ""; width: 12px; height: 12px; flex: none; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 420px) {
  body { padding: 16px; }
  form { padding: 16px 16px 18px; }
  .head { gap: 6px; padding: 0 10px; }
  .brand .radio { font-size: 13px; }
}
@media (max-width: 370px) {
  .app-icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
