/* Страница входа в панель. Токены — те же, что в /admin/admin.css (тёмная по умолчанию, синий акцент). */

@font-face {
  font-family: "Onest";
  src: url("/fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("/fonts/onest-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215;
}

:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d11; --surface: #12151b; --surface-2: #181c24; --border: #262b36; --border-strong: #3a4150;
  --text: #e8eaef; --muted: #9aa2b1;
  --accent: #4b8bff; --accent-hover: #6a9fff; --accent-ink: #06122b; --accent-soft: rgba(75, 139, 255, .14);
  --brand: #f0b232; --err: #ff7a85; --err-soft: rgba(255, 122, 133, .12); --warn: #f5b544;
  --glow: radial-gradient(60% 50% at 50% 0%, rgba(75, 139, 255, .10), transparent 70%);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f7; --surface: #ffffff; --surface-2: #f6f7f9; --border: #dde1e7; --border-strong: #b9c0cb;
  --text: #14171c; --muted: #525a68;
  --accent: #1f5fd6; --accent-hover: #174cb0; --accent-ink: #ffffff; --accent-soft: rgba(31, 95, 214, .1);
  --brand: #c98a0c; --err: #b42330; --err-soft: rgba(180, 35, 48, .08); --warn: #9a5b00;
  --glow: radial-gradient(60% 50% at 50% 0%, rgba(31, 95, 214, .07), transparent 70%);
}

* { box-sizing: border-box; }
/* Атрибут hidden сильнее любых display у компонентов (иначе пустая плашка ошибки видна сразу) */
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--glow), var(--bg); color: var(--text);
  font: 15px/1.5 "Onest", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.card {
  width: min(400px, 100%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px; display: grid; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand); color: #1c1400; font-size: 12px; font-weight: 800;
}
h1 { margin: 6px 0 0; font-size: 22px; line-height: 1.25; font-weight: 650; }
.lead { margin: -10px 0 0; color: var(--muted); font-size: 14px; }

form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
label { font-size: 13px; font-weight: 550; }
input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 15px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
input:hover { border-color: var(--border-strong); }
input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid="true"] { border-color: var(--err); }
.input-affix { position: relative; }
.input-affix input { padding-right: 48px; }
.reveal {
  position: absolute; right: 4px; top: 4px; width: 36px; height: 36px;
  display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer;
}
.reveal:hover { background: var(--surface); color: var(--text); }
.reveal[aria-pressed="true"] { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.hint { font-size: 12.5px; color: var(--muted); }
.hint.warn { color: var(--warn); }
.error-text { font-size: 12.5px; color: var(--err); }
.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--err) 45%, var(--border)); border-radius: 12px;
  background: var(--err-soft); color: var(--text); font-size: 14px;
}
.alert svg.i { color: var(--err); margin-top: 1px; }

.btn-primary {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; margin-top: 4px; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 650; font-size: 15px; cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(.985); }
.btn-primary[disabled] { opacity: .7; cursor: progress; transform: none; }
.spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}
.btn-primary[aria-busy="true"] .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

@media (max-width: 420px) { .card { padding: 22px 18px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 2s !important; } }
