:root {
  --bg: #f4f6fb; --card: #ffffff; --ink: #111c2f; --muted: #5b6577; --line: #e2e7f0;
  --navy: #111c2f; --gold: #d4a437; --gold-soft: #fbf3df; --green: #0f8a55; --green-soft: #e3f6ec;
  --red: #c0352b; --red-soft: #fdecea; --shadow: 0 10px 30px rgba(17, 28, 47, .08), 0 2px 6px rgba(17, 28, 47, .05);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --card: #131c2e; --ink: #eef2f8; --muted: #9aa6ba; --line: #24314a;
    --gold-soft: #2c2512; --green-soft: #10291e; --red-soft: #2e1513; --green: #43d394; --red: #ff7b72; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 500px at 85% -10%, rgba(212, 164, 55, .16), transparent 60%), var(--bg);
  color: var(--ink); font: 16px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; min-height: 100vh;
  display: flex; flex-direction: column;
}
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; flex: none; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 4vw, 40px); }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 42px; height: 42px; border-radius: 12px; background: var(--navy); color: var(--gold); display: grid; place-items: center; }
.logo svg { width: 28px; height: 28px; }
.brand-name { font-weight: 750; letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-size: 13px; }
.ship { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 600; box-shadow: var(--shadow); max-width: 55vw; }
.ship span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ship svg { color: var(--gold); }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 32px; display: flex; flex-direction: column; justify-content: center; }
.view { animation: rise .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 32px); }
h1 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -.02em; }
h2 { font-size: 21px; margin: 0 0 6px; letter-spacing: -.01em; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 18px; max-width: 60ch; }
.muted { color: var(--muted); margin: 0 0 8px; }
.small { font-size: 13px; }

.hero { text-align: center; max-width: 680px; margin: 0 auto; }
.hero .lead { margin-left: auto; margin-right: auto; }
.hero-icon { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 22px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; }
.hero-icon svg { width: 44px; height: 44px; }
.steps { list-style: none; padding: 0; margin: 0 auto 24px; display: grid; gap: 10px; text-align: left; max-width: 460px; }
.steps li { display: flex; gap: 12px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.steps span { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 14px; font: inherit; font-weight: 700; padding: 13px 20px; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn:focus-visible, input:focus-visible, .link:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.primary { background: var(--navy); color: #fff; box-shadow: 0 8px 20px rgba(17, 28, 47, .25); }
.btn.primary svg { color: var(--gold); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 10px 26px rgba(17, 28, 47, .32); transform: translateY(-1px); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
@media (prefers-color-scheme: dark) { .btn.primary { background: var(--gold); color: #111c2f; } .btn.primary svg { color: #111c2f; } }
.btn.big { width: 100%; padding: 16px 22px; font-size: 18px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); margin-top: 14px; }
.btn.danger-ghost { background: transparent; color: var(--red); width: 100%; margin-top: 8px; }
.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; padding: 6px 0; text-decoration: underline; }

.code-card { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
.qr-wrap { position: relative; display: grid; place-items: center; }
.qr-frame { position: relative; z-index: 1; background: #fff; padding: 14px; border-radius: 20px; border: 3px solid var(--gold); width: 100%; aspect-ratio: 1; }
.qr-frame img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.pulse { position: absolute; inset: -10px; border-radius: 28px; border: 3px solid var(--gold); opacity: .0; animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { 0% { opacity: .55; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.06); } }
.digits { font-size: clamp(40px, 6vw, 58px); font-weight: 800; letter-spacing: .18em; font-variant-numeric: tabular-nums; margin: 6px 0 14px; color: var(--ink); }
.wait { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.wait #waitText { margin-left: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: blink 1.2s infinite; }
.dot:nth-child(2) { animation-delay: .2s; } .dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.timer { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.timer .bar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), #e8c66e); transition: width 1s linear; }

.grid { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 20px; align-items: stretch; }
.person { position: relative; display: flex; flex-direction: column; }
.checks-title { margin-top: auto; padding-top: 16px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; background: var(--green-soft); color: var(--green); border-radius: 10px; padding: 8px 12px; }
.checks li.warn { background: var(--gold-soft); color: #9a6f0e; }
.checks li svg { width: 18px; height: 18px; }
@media (prefers-color-scheme: dark) { .checks li.warn { color: var(--gold); } .logo { background: #1b2740; box-shadow: inset 0 0 0 1px rgba(212,164,55,.45); } }
.person figure { margin: 0 0 14px; }
.person img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; background: var(--line); display: block; }
.person figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; text-align: center; }
.person dl { margin: 0; display: grid; gap: 0; }
.person dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.person dt { color: var(--muted); }
.person dd { margin: 0; font-weight: 650; text-align: right; }
.badge { position: absolute; top: 30px; left: 30px; z-index: 1; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.badge.warn { background: var(--gold-soft); color: #9a6f0e; }
.q { font-size: 24px; }
label { display: block; font-size: 14px; font-weight: 650; margin: 16px 0 6px; }
.opt { color: var(--muted); font-weight: 400; }
input[type=text], input:not([type]) { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); }
.pad-wrap { position: relative; }
canvas { width: 100%; height: 190px; border: 2px dashed var(--line); border-radius: 14px; background: #fff; touch-action: none; display: block; cursor: crosshair; }
.pad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #b4bccb; font-size: 20px; pointer-events: none; transition: opacity .2s; }
.row-between { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; margin: 10px 0 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--navy); flex: none; }
.error { color: var(--red); margin-top: 8px; font-weight: 600; }
.error:empty { display: none; }

.done { text-align: center; max-width: 620px; margin: 0 auto; }
.tick { width: 96px; height: 96px; margin: 0 auto 16px; }
.tick svg { width: 96px; height: 96px; }
.tick circle { stroke: var(--green); stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .6s ease forwards; }
.tick path { stroke: var(--green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .5s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.tick.no circle, .tick.no path { stroke: var(--red); }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }

@media (max-width: 760px) {
  .code-card, .grid { grid-template-columns: 1fr; }
  .qr-wrap { max-width: 300px; margin: 0 auto; width: 100%; }
  .code-side { text-align: center; }
  .wait { justify-content: center; }
  .ship { max-width: 50vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tick circle, .tick path { stroke-dashoffset: 0; }
}
