:root {
  color-scheme: light dark;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --text: #1d2824;
  --muted: #66766d;
  --line: #d9e1dc;
  --green: #176b49;
  --red: #a13d2d;
  --telegram: #2aabee;
  --telegram-dark: #1d93d2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101513;
    --surface: #18201d;
    --text: #e6ece9;
    --muted: #93a39a;
    --line: #2a3530;
    --green: #4cc38a;
    --red: #ff8a75;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--green) 14%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--telegram) 14%, transparent), transparent 60%),
    var(--bg);
  color: var(--text);
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px 22px;
  box-shadow: 0 20px 50px -24px rgb(0 0 0 / 0.25);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.mark {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--green); color: #fff; font-weight: 700; letter-spacing: 0.5px;
}
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-sub { color: var(--muted); font-size: 0.9rem; }
h1 { font-size: 1.45rem; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 24px; }
.state { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
.telegram {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 18px; border: 0; border-radius: 12px;
  background: var(--telegram); color: #fff; font-weight: 600; font-size: 1rem;
  transition: background 0.15s ease, transform 0.05s ease;
}
.telegram:hover { background: var(--telegram-dark); }
.telegram:active { transform: translateY(1px); }
.telegram:disabled { opacity: 0.6; cursor: progress; }
.telegram svg { width: 22px; height: 22px; fill: currentColor; }
.secondary {
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--text); font-weight: 600;
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--telegram);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.check {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); font-size: 1.4rem; font-weight: 700;
}
.status { margin: 0; font-weight: 600; }
.status.problem { color: var(--red); }
.hint { margin: 0; color: var(--muted); }
.hint.small { font-size: 0.85rem; }
a { color: var(--telegram-dark); }
footer {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  color: var(--muted); font-size: 0.82rem;
}
.langs { display: inline-flex; gap: 4px; }
.langs button {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 2px 6px; border-radius: 6px; font-size: 0.78rem;
}
.langs button[aria-pressed="true"] { border-color: var(--line); color: var(--text); }
