:root {
  --bg: #0d0618;
  --bg2: #170a2b;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.11);
  --text: #f6f1ff;
  --muted: #b7a8d6;
  --faint: #7f6fa3;
  --violet: #8b5cf6;
  --violet2: #6d28d9;
  --pink: #ec4899;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --radius: 22px;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #c026d3 55%, #ec4899 100%);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 "Manrope", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(60% 45% at 85% 0%, rgba(168, 85, 247, 0.38), transparent 70%),
    radial-gradient(55% 40% at 0% 100%, rgba(236, 72, 153, 0.28), transparent 70%),
    radial-gradient(70% 50% at 50% 50%, rgba(109, 40, 217, 0.18), transparent 75%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* мерцающие звёздочки на фоне */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sky i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff;
  opacity: 0; animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: .85; transform: scale(1.2); } }

.wrap {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  padding: calc(20px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
}

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); box-shadow: 0 8px 24px rgba(192, 38, 211, .45); font-size: 20px;
}
.brand-name { font: 700 15px/1.1 "Unbounded", sans-serif; letter-spacing: .2px; }
.brand-sub { color: var(--muted); font-size: 12px; }

h1, h2, h3 { font-family: "Unbounded", sans-serif; letter-spacing: -.2px; margin: 0; }
h1 { font-size: 26px; line-height: 1.15; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; margin: 28px 0 12px; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.card + .card { margin-top: 14px; }

.btn {
  appearance: none; border: 0; width: 100%; cursor: pointer;
  padding: 16px 20px; border-radius: 16px;
  font: 700 16px/1 "Manrope", sans-serif; color: #fff;
  background: var(--grad); background-size: 160% 160%;
  box-shadow: 0 12px 30px rgba(192, 38, 211, .4);
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  animation: shimmer 6s ease infinite;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.ghost { background: rgba(255, 255, 255, .08); box-shadow: none; animation: none; }
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .3px;
  background: rgba(251, 191, 36, .14); color: var(--gold); border: 1px solid rgba(251, 191, 36, .3);
}
.badge.ok { background: rgba(52, 211, 153, .14); color: var(--green); border-color: rgba(52, 211, 153, .3); }
.badge.bad { background: rgba(248, 113, 113, .14); color: var(--red); border-color: rgba(248, 113, 113, .3); }

.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }

.notice {
  margin-top: 40px; text-align: center; padding: 28px 20px;
}
.notice .emoji { font-size: 46px; margin-bottom: 10px; }

/* строки чека */
.rows { margin: 6px 0 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed rgba(255, 255, 255, .1); }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--muted); font-size: 14px; }
.row .v { font-weight: 700; text-align: right; }
.copy { cursor: pointer; border-bottom: 1px dotted var(--faint); }

/* тексты документов */
.doc h2 { margin-top: 24px; }
.doc p, .doc li { color: #e6dcfb; }
.doc ul { padding-left: 20px; margin: 0 0 10px; }

/* лоадер */
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .15); border-top-color: #fff;
  animation: spin .8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translate(-50%, 30px);
  background: rgba(30, 16, 54, .92); border: 1px solid var(--card-border); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .25s; z-index: 10;
  backdrop-filter: blur(12px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.fade-in { animation: fadeIn .45s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
