/* qr-auth — тёмная тема, без внешних ресурсов */
:root {
  --bg: #0b0f14;
  --bg-2: #121822;
  --panel: #161e2a;
  --panel-2: #1c2634;
  --border: #263345;
  --text: #e8eef7;
  --muted: #93a2b8;
  --accent: #4da3ff;
  --accent-2: #2f7fe0;
  --ok: #3ddc97;
  --warn: #ffc857;
  --err: #ff6b6b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #16202e 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: 0.2px; }
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ok), var(--accent));
  box-shadow: 0 0 12px rgba(77, 163, 255, 0.6);
}
.brand small { color: var(--muted); font-weight: 400; }

.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

h1 { font-size: 1.45rem; margin: 0 0 6px; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
p.lead { color: var(--muted); margin: 0 0 18px; }

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  color: var(--text);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent-2); text-decoration: none; }
.tile .ico { font-size: 1.5rem; }
.tile .name { font-weight: 620; }
.tile .hint { color: var(--muted); font-size: 0.87rem; }
.tile .badge {
  align-self: flex-start;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.tile.authed { border-color: rgba(61, 220, 151, 0.45); }
.tile.authed .badge { color: var(--ok); border-color: rgba(61, 220, 151, 0.45); }

.code {
  font: 700 2.6rem/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.32rem;
  text-align: center;
  padding: 14px 10px;
  background: #0e141c;
  border: 1px dashed var(--border);
  border-radius: 12px;
  user-select: all;
}

.qr {
  display: flex;
  justify-content: center;
  padding: 14px;
  background: #fff;
  border-radius: 12px;
  width: fit-content;
  margin: 0 auto;
  min-width: 240px;
  min-height: 240px;
}
.qr svg { width: 240px; height: 240px; display: block; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.btn {
  appearance: none;
  border: 1px solid var(--accent-2);
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #06121f;
  font-weight: 650;
  font-size: 1rem;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn.wide { width: 100%; }
.btn.big { font-size: 1.08rem; padding: 15px 20px; }

.status {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: #0e141c;
  color: var(--muted);
  font-size: 0.93rem;
}
.status.ok { border-color: rgba(61, 220, 151, 0.5); color: var(--ok); }
.status.warn { border-color: rgba(255, 200, 87, 0.5); color: var(--warn); }
.status.err { border-color: rgba(255, 107, 107, 0.5); color: var(--err); }

.pill {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}

pre.snippet {
  margin: 0;
  padding: 12px 14px;
  background: #0e141c;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.88rem;
}

details.help { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
details.help summary { cursor: pointer; color: var(--muted); }

footer.foot { margin-top: 26px; color: var(--muted); font-size: 0.8rem; text-align: center; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: var(--accent);
  display: inline-block;
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.steps { counter-reset: s; margin: 0; padding-left: 0; list-style: none; }
.steps li { counter-increment: s; margin-bottom: 8px; color: var(--muted); }
.steps li::before {
  content: counter(s);
  display: inline-flex;
  width: 22px; height: 22px;
  margin-right: 8px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
}

@media (max-width: 560px) {
  .wrap { padding: 18px 12px 40px; }
  .code { font-size: 2rem; letter-spacing: 0.22rem; }
  .qr { min-width: 0; }
  .qr svg { width: min(72vw, 240px); height: min(72vw, 240px); }
  h1 { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
