/* 16.09.2026: страница входа приведена к языку основного сайта.
 * Была тёмно-синей с бирюзовым — рядом с сайтом выглядела чужой.
 * Числа взяты из ядра сайта `src/styles/yadro.css`, не подобраны на глаз.
 * 🔴 Правило контраста: белым по светло-зелёному нельзя (2,28:1 при норме 4,5),
 * поэтому смысловой зелёный тут только тёмный, а текст на нём — светлый лишь
 * там, где подложка #0E7A3B и темнее. */
:root {
  color-scheme: light;
  --page: #f8fafb;
  --panel: #ffffff;
  --panel-quiet: #f0f4f7;
  --line: rgba(31, 45, 61, 0.12);
  --text: #1f2d3d;
  --muted: #53637a;
  --quiet: #55637a;
  --accent: #0e7a3b;
  /* Текст поверх заливки цвета --accent. На #0E7A3B белый даёт 5,3:1. */
  --accent-ink: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
}

button { font: inherit; }

.login-shell {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.login-panel {
  display: grid;
  width: min(920px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.login-copy {
  min-height: 500px;
  padding: 54px;
}

.product-name {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

h1 {
  max-width: 18ch;
  margin: 0 0 28px;
  font-size: 2.25rem;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.qr-state {
  display: none;
  max-width: 62ch;
}

[data-qr-state="creating"] [data-qr-view="creating"],
[data-qr-state="waiting"] [data-qr-view="waiting"],
[data-qr-state="authenticated"] [data-qr-view="authenticated"],
[data-qr-state="expired"] [data-qr-view="expired"],
[data-qr-state="cancelled"] [data-qr-view="cancelled"],
[data-qr-state="unbound"] [data-qr-view="unbound"],
[data-qr-state="error"] [data-qr-view="error"] { display: block; }

.lead {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.55;
  text-wrap: pretty;
}

.support,
.login-steps {
  color: var(--muted);
  line-height: 1.65;
}

.support { margin: 0 0 24px; }

.login-steps {
  margin: 20px 0 28px;
  padding-left: 1.3rem;
}

.login-steps li + li { margin-top: 9px; }

.waiting-line {
  display: flex;
  min-height: 28px;
  align-items: center;
  gap: 10px;
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.45;
}

.waiting-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  animation: waiting-pulse 1.4s ease-out infinite;
}

button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out;
}

button:focus-visible {
  outline: 3px solid rgba(67, 216, 232, 0.42);
  outline-offset: 3px;
}

.button-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button-primary:hover { background: #78e5ef; }

.button-secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.login-panel--setup {
  grid-template-columns: minmax(0, 38rem);
  justify-content: center;
}

.setup-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.setup-form p {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.setup-form input {
  min-height: 2.9rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.7rem;
  background: rgba(8, 13, 22, 0.72);
  color: #f7fbff;
  padding: 0.7rem 0.85rem;
  font: inherit;
}

.role-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.role-choice {
  border: 1px solid var(--line);
  background: var(--panel-quiet);
  color: var(--text);
  text-align: left;
}

.role-choice:hover {
  border-color: var(--accent);
  background: rgba(67, 216, 232, 0.1);
}

.button-secondary:hover {
  border-color: var(--quiet);
  color: var(--text);
}

.login-visual {
  display: flex;
  min-height: 500px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px;
  border-left: 1px solid var(--line);
  background: var(--panel-quiet);
}

.qr-frame {
  display: grid;
  width: min(300px, 100%);
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  padding: 10px;
  border-radius: 14px;
  background: #ffffff;
}

[data-qr-image] {
  display: none;
  width: 100%;
  height: auto;
}

[data-qr-state="waiting"] [data-qr-image],
[data-qr-state="authenticated"] [data-qr-image] { display: block; }

[data-qr-state="waiting"] [data-qr-placeholder],
[data-qr-state="authenticated"] [data-qr-placeholder] { display: none; }

.qr-placeholder {
  width: 92%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #dce5e9;
  animation: placeholder-pulse 1.2s ease-out infinite alternate;
}

.qr-caption {
  margin: 14px 0 0;
  color: var(--quiet);
  font-size: 0.82rem;
}

@keyframes waiting-pulse {
  50% { opacity: 0.34; transform: scale(0.78); }
}

@keyframes placeholder-pulse { to { opacity: 0.58; } }

@media (max-width: 760px) {
  .login-shell {
    align-items: flex-start;
    padding: 16px;
  }

  .login-panel { grid-template-columns: 1fr; }

  .login-copy,
  .login-visual {
    min-height: auto;
    padding: 32px 26px;
  }

  .login-visual {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  h1 { font-size: 1.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
