:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --card: rgba(255,255,255,0.08);
  --text: #f5f7fb;
  --muted: #aab2c0;
  --line: rgba(255,255,255,0.15);
  --primary: #7c5cff;
  --primary2: #17d4a7;
  --danger: #ff5c7a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    radial-gradient(circle at 18% 8%, rgba(124,92,255,.38), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(23,212,167,.24), transparent 32%),
    radial-gradient(circle at 50% 92%, rgba(56,117,255,.14), transparent 34%),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto, auto, auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body:has(.card:not(.flat)) { display: grid; place-items: center; }
.page { width: min(1180px, 100%); margin: 0 auto; }
.hero { padding: 48px 0 24px; max-width: 860px; }
.card {
  width: min(900px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(124,92,255,.10), rgba(23,212,167,.055)),
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.055));
  box-shadow: 0 28px 90px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.10);
  backdrop-filter: blur(18px);
}
.token-card { position: relative; overflow: hidden; }
.token-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: radial-gradient(circle at 8% 0%, rgba(124,92,255,.16), transparent 30%), radial-gradient(circle at 95% 8%, rgba(23,212,167,.11), transparent 28%);
}
.token-card > * { position: relative; }
.flat { width: 100%; margin: 28px 0 60px; }
.narrow { width: min(640px, 100%); }
.badge {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(124,92,255,.18);
  color: #d9d1ff;
  font-size: 13px;
  border: 1px solid rgba(124,92,255,.35);
}
.badge.danger { background: rgba(255,92,122,.18); color: #ffd5dc; border-color: rgba(255,92,122,.35); }
h1 { font-size: clamp(34px, 6vw, 70px); line-height: .96; margin: 18px 0 16px; letter-spacing: -0.06em; }
h2 { margin-top: 26px; }
.lead { font-size: 18px; color: var(--muted); line-height: 1.6; }
.muted { color: var(--muted); line-height: 1.55; }
.small { font-size: 13px; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 20px 0; }
.style-card { border: 1px solid var(--line); border-radius: 26px; overflow: hidden; background: rgba(255,255,255,.075); box-shadow: 0 18px 60px rgba(0,0,0,.22); }
.style-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; transition: transform .2s ease; }
.style-card:hover img { transform: scale(1.025); }
.style-body { padding: 18px; }
.style-body h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.03em; }
.style-body p { color: var(--muted); min-height: 50px; line-height: 1.45; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.price { font-weight: 900; color: #fff; font-size: 20px; }
.price.big { font-size: 34px; margin: 18px 0; }
.product-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 28px; align-items: center; }
.product-cover { width: 100%; border-radius: 24px; border: 1px solid var(--line); }
.back { margin: 0 0 20px; }
.bullets { color: var(--muted); line-height: 1.8; padding-left: 20px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 24px 0; }
.steps div { padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.05); }
.steps b { display: block; font-size: 22px; color: var(--primary2); }
.steps span { color: var(--muted); font-size: 13px; }
.upload {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  border: 1px dashed rgba(255,255,255,.34);
  border-radius: 24px;
  padding: 26px;
  margin: 22px 0;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.upload:hover, .upload.dragging {
  transform: translateY(-1px);
  border-color: rgba(23,212,167,.72);
  background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(23,212,167,.09));
  box-shadow: 0 18px 50px rgba(0,0,0,.24);
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.upload-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(23,212,167,.18);
}
.upload-copy { display: grid; gap: 6px; color: var(--muted); }
.upload-copy strong { color: #fff; font-size: 18px; }
.file-name {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #dbe2ee;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.check { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); line-height: 1.45; font-size: 14px; }
.custom-check input { width: 18px; height: 18px; accent-color: var(--primary2); margin-top: 2px; }
.form-error {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,92,122,.13);
  border: 1px solid rgba(255,92,122,.34);
  color: #ffd4dc;
  font-size: 14px;
}
button, .button, .secondary {
  display: inline-block;
  border: 0;
  margin-top: 20px;
  padding: 15px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
  font-weight: 800;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 16px 42px rgba(23,212,167,.16);
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
button:hover, .button:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 20px 52px rgba(23,212,167,.22); }
.small-btn { padding: 11px 14px; margin-top: 0; font-size: 14px; }
button:disabled { opacity: .6; cursor: wait; }
.secondary { background: transparent; border: 1px solid var(--line); color: var(--text); }
.alert { margin: 18px 0; padding: 14px 16px; border-radius: 16px; background: rgba(255,92,122,.12); border: 1px solid rgba(255,92,122,.3); color: #ffd4dc; }
.queue-note { margin: 18px 0; padding: 13px 15px; border-radius: 16px; background: rgba(23,212,167,.10); border: 1px solid rgba(23,212,167,.28); color: #d9fff5; }
.progress-box { display: flex; gap: 16px; align-items: center; margin: 24px 0; padding: 18px; border-radius: 18px; background: rgba(255,255,255,.055); border: 1px solid var(--line); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--primary2); animation: spin 1s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.results img { width: auto; max-width: min(100%, 560px); max-height: 62vh; object-fit: contain; display: block; border-radius: 22px; border: 1px solid var(--line); margin: 18px 0 0; box-shadow: 0 18px 52px rgba(0,0,0,.28); }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
details { color: var(--muted); line-height: 1.55; }
summary { color: var(--text); cursor: pointer; font-weight: 700; }
@media (max-width: 900px) { .gallery { grid-template-columns: 1fr; } .product-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  body { padding: 14px; }
  .card { padding: 22px; border-radius: 22px; }
  .upload { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .style-body p { min-height: auto; }
}
