/* Buy It Here — TempVault-style design system. Everything derives from --accent,
   which app.js sets from BRAND.accent (green here). Swap that one value to retheme. */
:root {
  --bg: #09090b;
  --bg-2: #0d0d11;
  --card: rgba(255, 255, 255, 0.025);
  --card-hover: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ededf2;
  --muted: #9b9ba7;
  --faint: #6b6b78;

  --accent: #22c55e;
  --accent-2: color-mix(in srgb, var(--accent), #ffffff 22%);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-border: color-mix(in srgb, var(--accent) 38%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 45%, #ffffff);
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));

  --danger: #f87171;
  --radius: 16px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: transparent; /* the interactive canvas (bg.js) paints the backdrop */
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.wrap, .container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

/* ---- Nav ---- */
header.site {
  display: flex; align-items: center; gap: 28px;
  height: 64px; padding: 0 24px; max-width: var(--maxw); margin: 0 auto;
  position: sticky; top: 0; z-index: 20;
}
.site-bar {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px); background: rgba(9, 9, 11, 0.7);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; font-size: 15px; color: #fff; flex-shrink: 0;
}
header.site nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
header.site nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
header.site nav a:hover { color: var(--text); }

/* ---- Hero ---- */
.hero { text-align: center; padding: 76px 24px 30px; max-width: 760px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(38px, 6.5vw, 68px); line-height: 1.03; margin: 18px 0 14px;
  font-weight: 800; letter-spacing: -0.02em;
}
.hero p { color: var(--muted); font-size: 18px; max-width: 560px; margin: 0 auto; }
.tabs { display: inline-flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; justify-content: center; }
.tabs a {
  font-size: 13px; font-weight: 600; padding: 8px 15px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-border);
  transition: transform .08s ease;
}
.tabs a:hover { transform: translateY(-1px); }

/* ---- Sections ---- */
section.section { padding: 40px 0 8px; }
.section-head { margin-bottom: 20px; }
.section-head h2 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.02em; }
.section-head p { color: var(--muted); margin: 0; font-size: 15px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

/* ---- Cards ---- */
.card {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.card h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.card .desc { color: var(--muted); font-size: 14px; flex: 1; min-height: 20px; }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.badge {
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.badge.in { color: var(--accent-text); border-color: var(--accent-border); background: var(--accent-soft); }
.badge.out { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 600; font-size: 14px;
  padding: 11px 18px; border-radius: 11px; color: #fff; background: var(--grad);
  transition: transform .08s ease, box-shadow .2s ease;
  box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.ghost { background: transparent; border: 1px solid var(--border-strong); box-shadow: none; color: var(--text); }
.btn.ghost:hover { background: var(--card-hover); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---- Footer ---- */
footer.site { border-top: 1px solid var(--border); margin-top: 56px; padding: 36px 24px; text-align: center; color: var(--muted); font-size: 14px; }
footer.site #socials { display: flex; gap: 16px; justify-content: center; margin-bottom: 10px; }
footer.site a:hover { color: var(--text); }

/* ---- Modal ---- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.66); backdrop-filter: blur(4px); display: none; place-items: center; padding: 20px; z-index: 50; }
.overlay.open { display: grid; }
.modal { background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 26px; width: 100%; max-width: 430px; }
.modal h3 { margin: 0 0 4px; font-size: 20px; }
.field { margin: 16px 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.field input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 11px 13px; font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--accent); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---- Order / delivery page ---- */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-top: 18px; }
.status-pill { display: inline-block; padding: 5px 13px; border-radius: 999px; font-weight: 700; font-size: 13px; text-transform: capitalize; }
.status-pill.pending { background: rgba(234,179,8,.15); color: #eab308; }
.status-pill.delivered, .status-pill.paid { background: var(--accent-soft); color: var(--accent-text); }
.status-pill.expired, .status-pill.failed { background: rgba(248,113,113,.15); color: var(--danger); }
.delivery { background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 11px; padding: 14px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; white-space: pre-wrap; word-break: break-all; }

/* ---- Admin ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text); padding: 11px; font-family: ui-monospace, monospace; font-size: 13px; min-height: 90px; }
textarea:focus { outline: none; border-color: var(--accent); }
.tabbar { display: flex; gap: 10px; margin: 20px 0; }
.tabbar button { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 8px 18px; cursor: pointer; font-size: 14px; font-weight: 600; }
.tabbar button.active { color: #fff; background: var(--grad); border-color: transparent; }
input.adm, select.adm { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; color: var(--text); padding: 9px 11px; font-size: 14px; }
input.adm:focus, select.adm:focus { outline: none; border-color: var(--accent); }

/* ---- Motion / micro-interactions ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.95) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.hero h1 { animation: fadeUp .55s cubic-bezier(.22,.61,.36,1) both; }
.hero p { animation: fadeUp .55s cubic-bezier(.22,.61,.36,1) .07s both; }
.tabs { animation: fadeUp .55s cubic-bezier(.22,.61,.36,1) .14s both; }
section.section { animation: fadeUp .55s cubic-bezier(.22,.61,.36,1) both; }
.card { animation: popIn .5s cubic-bezier(.22,.61,.36,1) both; }
.grid .card:nth-child(2) { animation-delay: .06s; }
.grid .card:nth-child(3) { animation-delay: .12s; }
.grid .card:nth-child(4) { animation-delay: .18s; }
.grid .card:nth-child(n+5) { animation-delay: .24s; }

.btn:active { transform: translateY(1px) scale(.99); }
.tabs a:active { transform: translateY(0) scale(.97); }
.card { transition: border-color .2s, transform .2s, box-shadow .25s; }
.card:hover { box-shadow: 0 18px 50px color-mix(in srgb, var(--accent) 14%, transparent); }

.overlay.open { animation: overlayIn .18s ease both; }
.overlay.open .modal { animation: popIn .22s cubic-bezier(.22,.61,.36,1) both; }

/* ---- Payment screen extras ---- */
.pay-fiat { opacity: .55; }
.pay-fiat:hover { opacity: .8; }
.plug { text-align: center; font-size: 12px; color: var(--faint); margin: 14px 0 0; }
.plug a { color: var(--muted); border-bottom: 1px dotted var(--faint); }
.plug a:hover { color: var(--accent-text); border-color: var(--accent-text); }

/* ---- Telegram floating button ---- */
.fab-tg {
  position: fixed; right: 20px; bottom: 20px; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent); z-index: 60;
  transition: transform .12s ease, box-shadow .2s ease;
}
.fab-tg:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 55%, transparent); }
.fab-tg svg { width: 26px; height: 26px; }
.fab-tg[hidden] { display: none; }

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

@media (max-width: 720px) { .hero { padding-top: 48px; } }
