/* Chopik · Neon Glass — спільні токени й компоненти для сторінки завантаження й адмінки.
   Без зовнішніх шрифтів: Space Grotesk / Inter / JetBrains Mono беруться, якщо встановлені, інакше — системні. */

:root {
  --bg0: #05060B;
  --bg1: #0A0F1F;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-hi: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.10);
  --stroke-hi: rgba(255, 255, 255, 0.18);
  --text: #E8ECFF;
  --muted: #8A93B8;
  --cyan: #22D3EE;
  --violet: #8B5CF6;
  --magenta: #F472B6;
  --rose: #FB7185;
  --lime: #A3E635;
  --amber: #FBBF24;
  --brand: linear-gradient(135deg, var(--cyan), var(--violet));
  --danger: linear-gradient(135deg, var(--magenta), var(--rose));
  --radius: 22px;
  --radius-sm: 14px;
  --blur: 18px;
  --font-display: "Space Grotesk", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-text: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg0);
  color: var(--text);
  font: 400 15px/1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: 0.02em; }
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

/* ---- AuroraBackground: повільна аврора, сітка й зорі ---- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 85% -10%, #131a3d 0%, transparent 60%),
    radial-gradient(900px 700px at -10% 110%, #170f35 0%, transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 75%);
}
.aurora i {
  position: absolute;
  display: block;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.36;
  will-change: transform;
}
.aurora i:nth-child(1) {
  top: -24vmax; left: -14vmax;
  background: radial-gradient(circle at 35% 35%, var(--cyan), transparent 62%);
  animation: aurora-a 28s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) {
  top: -14vmax; right: -22vmax;
  background: radial-gradient(circle at 55% 45%, var(--violet), transparent 60%);
  animation: aurora-b 34s ease-in-out infinite alternate;
}
.aurora i:nth-child(3) {
  bottom: -34vmax; left: 18vmax;
  opacity: 0.22;
  background: radial-gradient(circle at 50% 50%, var(--magenta), transparent 58%);
  animation: aurora-c 40s ease-in-out infinite alternate;
}
/* Зорі: кілька крапок градієнтами, повільне мерехтіння. */
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, rgba(232, 236, 255, 0.75), transparent 60%),
    radial-gradient(1px 1px at 28% 68%, rgba(34, 211, 238, 0.8), transparent 60%),
    radial-gradient(1.4px 1.4px at 47% 14%, rgba(232, 236, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 63% 82%, rgba(139, 92, 246, 0.9), transparent 60%),
    radial-gradient(1.2px 1.2px at 78% 36%, rgba(232, 236, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 88% 74%, rgba(34, 211, 238, 0.7), transparent 60%),
    radial-gradient(1px 1px at 6% 88%, rgba(232, 236, 255, 0.5), transparent 60%),
    radial-gradient(1.3px 1.3px at 93% 9%, rgba(244, 114, 182, 0.7), transparent 60%);
  animation: twinkle 7s ease-in-out infinite alternate;
}
@keyframes aurora-a {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(16vmax, 9vmax) scale(1.15) rotate(35deg); }
  100% { transform: translate(6vmax, 20vmax) scale(0.95) rotate(70deg); }
}
@keyframes aurora-b {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-14vmax, 12vmax) scale(1.2); }
  100% { transform: translate(-22vmax, -4vmax) scale(1.05); }
}
@keyframes aurora-c {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-16vmax, -12vmax) scale(1.25); }
}
@keyframes twinkle {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

.grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 0%, transparent 75%);
  animation: grid-drift 60s linear infinite;
}
@keyframes grid-drift {
  to { background-position: 56px 56px, 56px 56px; }
}

/* ---- GlassCard: скло з розмиттям і тонкою градієнтною рамкою ---- */
.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.55), rgba(139, 92, 246, 0.35) 35%, rgba(255, 255, 255, 0.07) 62%, rgba(244, 114, 182, 0.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.glass-lite {
  background: rgba(5, 6, 11, 0.45);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px var(--stroke);
}

/* ---- NeonButton ---- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  font: 600 15px/1 var(--font-display);
  letter-spacing: 0.01em;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.2s ease, background-color 0.2s ease;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-neon {
  background: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 30px -10px rgba(34, 211, 238, 0.65), 0 12px 40px -14px rgba(139, 92, 246, 0.85);
  text-shadow: 0 1px 8px rgba(5, 6, 11, 0.35);
}
.btn-neon::after, .btn-danger::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.38) 50%, transparent 70%);
  background-size: 250% 100%;
  background-position: 150% 0;
  transition: background-position 0.8s ease;
  pointer-events: none;
}
.btn-neon:hover, .btn-danger:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-neon:hover::after, .btn-danger:hover::after { background-position: -50% 0; }
.btn-neon:hover {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 14px 36px -10px rgba(34, 211, 238, 0.8), 0 14px 50px -12px rgba(139, 92, 246, 0.95);
}
.btn-neon:active {
  transform: translateY(0) scale(0.98);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 0 26px rgba(34, 211, 238, 0.85), 0 0 52px rgba(139, 92, 246, 0.65);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--stroke);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.5), 0 0 22px -6px rgba(34, 211, 238, 0.55);
}
.btn-ghost:active { transform: scale(0.98); }
.btn-danger {
  background: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 30px -12px rgba(244, 114, 182, 0.75);
}
.btn-danger-ghost {
  background: rgba(244, 114, 182, 0.08);
  color: var(--magenta);
  box-shadow: inset 0 0 0 1px rgba(244, 114, 182, 0.35);
}
.btn-danger-ghost:hover { background: rgba(244, 114, 182, 0.16); box-shadow: inset 0 0 0 1px rgba(244, 114, 182, 0.6), 0 0 20px -6px rgba(244, 114, 182, 0.6); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 0.4em; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 16px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: saturate(0.6);
}
.btn.copied { box-shadow: inset 0 0 0 1px rgba(163, 230, 53, 0.7), 0 0 24px -6px rgba(163, 230, 53, 0.7); }

/* ---- Поля ---- */
.field { display: grid; gap: 7px; }
.field > span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(5, 6, 11, 0.55);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.input::placeholder { color: rgba(138, 147, 184, 0.7); }
.input:hover { border-color: var(--stroke-hi); }
.input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.75);
  background: rgba(5, 6, 11, 0.75);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16), 0 0 26px -6px rgba(34, 211, 238, 0.6);
}

/* ---- Дрібниці ---- */
.grad-text {
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }
.eyebrow {
  font: 600 11px/1.4 var(--font-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}

/* StatusPill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font: 600 12px/1.3 var(--font-text);
  white-space: nowrap;
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px currentColor;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.pill > span { color: var(--text); }
.pill-cyan { color: var(--cyan); }
.pill-violet { color: var(--violet); }
.pill-lime { color: var(--lime); }
.pill-amber { color: var(--amber); }
.pill-magenta { color: var(--magenta); }
.pill-muted { color: var(--muted); }
.pill-live::before { animation: live 1.8s ease-in-out infinite; }
@keyframes live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* Логотип: щит-шестикутник із градієнтом */
.logo-mark { display: block; width: 36px; height: 36px; filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.45)); }
.logo-anim { animation: logo-glow 5s ease-in-out infinite; }
@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.45)); }
  50% { filter: drop-shadow(0 0 22px rgba(139, 92, 246, 0.75)); }
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(10, 15, 31, 0.92);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.45), 0 0 30px -8px rgba(34, 211, 238, 0.7), 0 20px 40px -12px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { box-shadow: inset 0 0 0 1px rgba(244, 114, 182, 0.6), 0 0 30px -8px rgba(244, 114, 182, 0.7), 0 20px 40px -12px rgba(0, 0, 0, 0.8); }

/* Текст для копіювання без Clipboard API (поза екраном). */
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* QR: білий модуль у неоновій рамці */
.qr {
  display: block;
  width: min(240px, 100%);
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 0 36px -6px rgba(34, 211, 238, 0.6), 0 0 80px -20px rgba(139, 92, 246, 0.75);
}
.qr svg, .qr img { display: block; width: 100%; height: 100%; border-radius: 10px; image-rendering: pixelated; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(138, 147, 184, 0.25); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.4); background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
