/* The gateway sign-in (/auth/) — the same calm cabinet look as the apps behind it: one face
   (Onest), a white card on the cool canvas, cobalt for the action, the window logo.
   The page CSP allows only same-origin styles, fonts and images: no inline styles, no data: URIs. */
@font-face {
  font-family: Onest;
  src: url('/auth/onest-cyrillic.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Onest;
  src: url('/auth/onest-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --canvas: #f2f4fa;
  --ink: #141a3d;
  --ink-2: #384264;
  --muted: #5b6584;
  --subtle: #828aa6;
  --accent: #2341d8;
  --accent-deep: #1a32b0;
  --accent-tint: #f1f3ff;
  --line: #e4e7f1;
  --border: #e1e5ef;
  --border-strong: #c6cde0;
  --danger: #b4233c;
  --danger-soft: #fdedf0;
  --night: #0c1246;
  --honey: #ffc66e;
  color-scheme: light;
  font-family:
    Onest,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  font-size: 15px;
  line-height: 1.55;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(49, 92, 255, 0.07), transparent 70%),
    var(--canvas);
}
[hidden] {
  display: none !important;
}
h1,
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
  color: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
svg {
  display: block;
}
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(49, 92, 255, 0.34);
}

/* ---------------------------------------------------------------- chrome --- */
.topbar,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(20px, 4vw, 40px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--night);
}
.brand-mark svg {
  width: 26px;
  height: 26px;
}
.brand-word {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}
/* the full stop is a tiny lit window */
.brand-word i {
  display: inline-block;
  width: 0.24em;
  height: 0.24em;
  margin-left: 0.06em;
  border-radius: 0.05em;
  background: var(--honey);
}
.access-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
}
.access-note svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.footer {
  justify-content: center;
  gap: 18px;
  padding-bottom: 24px;
  color: var(--subtle);
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ card --- */
.login-main {
  display: grid;
  place-items: center;
  padding: 16px 20px 40px;
}
.card {
  width: min(420px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 2px 6px rgba(12, 18, 70, 0.06),
    0 20px 40px -24px rgba(12, 18, 70, 0.34);
}
.card h1 {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.form-copy {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}
form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}
.field {
  display: grid;
  gap: 7px;
}
label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}
input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-weight: 450;
  transition:
    border-color 160ms,
    box-shadow 160ms;
}
input::placeholder {
  color: var(--subtle);
  opacity: 1;
}
input:hover {
  border-color: #a3abc4;
}
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 92, 255, 0.34);
}
input[aria-invalid='true'] {
  border-color: var(--danger);
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 48px;
}
.visibility {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.visibility:hover {
  color: var(--ink);
  background: var(--accent-tint);
}
.visibility svg,
.primary-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.eye-slash {
  display: none;
}
.visibility[aria-pressed='true'] .eye-slash {
  display: inline;
}
.caps-lock {
  color: #9a4d0e;
  font-size: 12.5px;
  font-weight: 550;
}
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(26, 50, 176, 0.25);
  transition:
    background-color 160ms,
    transform 140ms;
}
.primary-button:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
.primary-button:active {
  transform: translateY(1px);
}
.primary-button:disabled {
  opacity: 0.55;
  cursor: progress;
}
#signed-in .primary-button {
  margin-top: 22px;
}
.text-button {
  display: block;
  margin: 12px auto 0;
  padding: 6px 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.text-button:hover {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.error {
  padding: 12px 14px;
  border: 1px solid #f5d3da;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
}
#signed-in .error {
  margin-top: 14px;
}
.access-help {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
noscript {
  display: block;
  margin-top: 16px;
  color: var(--danger);
  font-size: 13px;
}

@media (max-width: 560px) {
  .access-note {
    display: none;
  }
  .card {
    padding: 24px 20px;
  }
  .footer {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}
