/* Экран входа справочника. Токены совпадают с CRM (styles.css), но экран
   самостоятельный — стили CRM сюда не подключаются. */

:root {
  --accent-h: 160;
  --accent:      oklch(0.68 0.16 var(--accent-h));
  --accent-2:    oklch(0.62 0.17 var(--accent-h));
  --accent-soft: oklch(0.95 0.04 var(--accent-h));
  --on-accent:   #fff;

  --bg:       oklch(0.985 0.005 250);
  --surface:  #ffffff;
  --border:   oklch(0.92 0.008 250);
  --border-2: oklch(0.88 0.010 250);
  --text:     oklch(0.22 0.02 260);
  --text-2:   oklch(0.45 0.02 260);
  --text-3:   oklch(0.62 0.02 260);
  --danger:   oklch(0.58 0.19 25);

  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-lg: 0 18px 40px -18px oklch(0.35 0.05 250 / 0.28), 0 4px 12px -6px oklch(0.35 0.05 250 / 0.10);

  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* Фон: два мягких пятна в акцентном тоне. Единственный «эффект» на странице. */
.field { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.glow-a {
  width: 46vw; height: 46vw; min-width: 380px; min-height: 380px;
  top: -14vw; left: -10vw;
  background: oklch(0.86 0.13 var(--accent-h));
  animation: drift-a 26s ease-in-out infinite alternate;
}
.glow-b {
  width: 40vw; height: 40vw; min-width: 320px; min-height: 320px;
  bottom: -16vw; right: -8vw;
  background: oklch(0.88 0.08 230);
  animation: drift-b 32s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(5vw, 4vw, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-4vw, -5vw, 0) scale(1.08); } }

.gate {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px 36px 24px;
}
@media (max-width: 520px) { .gate { padding: 24px 20px 18px; } }

.gate-head { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.mark {
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  display: grid; place-items: center;
  font-weight: 700; font-size: 20px;
}
.wordmark { display: flex; flex-direction: column; line-height: 1.25; }
.wordmark b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.wordmark span { font-size: 13px; color: var(--text-3); }

h1 { margin: 0 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.lede { margin: 0 0 22px; color: var(--text-2); font-size: 14.5px; }

/* ── Плитки сотрудников ───────────────────────────────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.tiles-loading { grid-column: 1 / -1; color: var(--text-3); font-size: 14px; padding: 12px 0; }

.tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font: inherit; color: inherit;
  transition: border-color .15s, background .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-name { font-size: 12.5px; line-height: 1.3; text-align: center; color: var(--text-2); }

.avatar {
  width: 48px; height: 48px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 17px;
  color: #fff;
  background: var(--accent-2);
  object-fit: cover;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }

/* ── Шаг с паролем ────────────────────────────────────────────────────── */
.step[hidden] { display: none; }
.step { animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.chosen { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.chosen-name { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }

.form { display: flex; gap: 10px; }
.form-col { flex-direction: column; }

.input {
  flex: 1; min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit; font-size: 15px; color: var(--text);
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn {
  height: 44px; padding: 0 22px;
  border: none; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent);
  font: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: .6; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.link-btn {
  margin-top: 4px;
  background: none; border: none; padding: 4px 0;
  color: var(--text-3); font: inherit; font-size: 13.5px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent-2); }

.err { margin: 12px 0 0; color: var(--danger); font-size: 13.5px; }
.err[hidden] { display: none; }

.gate-foot {
  margin-top: 26px; padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 12.5px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .glow { animation: none; }
  .step { animation: none; }
  * { transition-duration: .01ms !important; }
}
