@font-face { font-family: "Euclid"; src: url("fonts/EuclidTriangle-Regular.woff2?v=2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Euclid"; src: url("fonts/EuclidTriangle-Medium.woff2?v=2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Euclid"; src: url("fonts/EuclidTriangle-Semibold.woff2?v=2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --night: #0f1928; --night-deep: #0a111c; --night-soft: #1a2940;
  --snow: #f3f6fa; --frost: #dce6f2; --ice: #7dbef0; --glow: #faaf1e; --ember: #f56e37;
  --pine: #69b400; --danger: #c8321e; --muted: #4a5a70; --border: #c9d6e5;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Euclid", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--night); background: var(--night-deep);
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(125, 190, 240, .28), transparent 60%),
    radial-gradient(circle at 15% 85%, rgba(250, 175, 30, .12), transparent 40%);
}
.hero { width: 100%; max-width: 560px; padding: 48px 20px 24px; color: var(--snow); }
.eyebrow { color: var(--glow); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; margin: 0 0 12px; text-wrap: balance; }
h1 { font-size: clamp(28px, 6vw, 38px); line-height: 1.1; margin: 0 0 12px; font-weight: 600; text-wrap: balance; }
.meta { color: var(--frost); font-size: 16px; margin: 0; display: flex; gap: 8px 20px; flex-wrap: wrap; }
.meta b { color: var(--snow); font-weight: 500; }

.card {
  width: calc(100% - 24px); max-width: 560px; background: var(--snow); border-radius: 20px;
  padding: 28px 24px; margin: 0 12px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.card h2 { font-size: 20px; margin: 0 0 4px; font-weight: 600; }
.card p.lead { margin: 0 0 22px; color: var(--muted); font-size: 15px; line-height: 1.45; }

label.field { display: block; margin-bottom: 16px; }
label.field span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=email] {
  width: 100%; font: inherit; font-size: 17px; padding: 13px 14px; border-radius: 12px;
  border: 1.5px solid var(--border); background: #fff; color: var(--night); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--ice); box-shadow: 0 0 0 4px rgba(125, 190, 240, .25); }
input.code { text-transform: none; letter-spacing: .06em; font-weight: 500; }
.hint { font-size: 13px; margin-top: 6px; min-height: 18px; color: var(--muted); }
.hint.ok { color: #3f7d00; }
.hint.err { color: var(--danger); }
input.is-ok { border-color: var(--pine); }
input.is-err { border-color: var(--danger); }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); line-height: 1.4; margin: 6px 0 20px; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ember); flex: none; }
.consent a { color: var(--night); }

button.primary {
  width: 100%; font: inherit; font-size: 17px; font-weight: 600; color: #fff; border: 0; border-radius: 14px;
  padding: 15px 18px; cursor: pointer; background: linear-gradient(135deg, var(--ember), var(--glow));
  box-shadow: 0 8px 24px rgba(245, 110, 55, .35); transition: transform .1s, opacity .15s;
}
button.primary:hover { transform: translateY(-1px); }
button.primary:disabled { opacity: .55; cursor: default; transform: none; }
.error-box { background: #fdecea; color: var(--danger); border-radius: 12px; padding: 12px 14px; font-size: 15px; margin-bottom: 16px; display: none; }
.error-box.show { display: block; }

.status { text-align: center; padding: 8px 0; }
.status .icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; font-size: 30px; }
.status.ok .icon { background: rgba(105, 180, 0, .15); color: #3f7d00; }
.status.wait .icon { background: rgba(125, 190, 240, .2); }
.status.fail .icon { background: #fdecea; color: var(--danger); }
.status h2 { margin-bottom: 8px; }
.status p { color: var(--muted); margin: 0 0 18px; line-height: 1.45; }
.status a.btn { display: inline-block; text-decoration: none; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--frost); border-top-color: var(--ice); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

footer { color: var(--frost); opacity: .75; font-size: 13px; padding: 8px 20px 32px; text-align: center; max-width: 560px; line-height: 1.5; }
footer a { color: inherit; }

/* ---------- Новогоднее оформление ---------- */
body { position: relative; overflow-x: hidden; }
.decor-snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.snow-sway { position: absolute; inset: 0; animation: snow-sway ease-in-out infinite alternate; }
.snow-fall { position: absolute; left: 0; right: 0; bottom: 0; animation: snow-fall linear infinite; will-change: transform; }
@keyframes snow-fall { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, var(--tile), 0); } }
@keyframes snow-sway { from { transform: translate3d(-18px, 0, 0); } to { transform: translate3d(18px, 0, 0); } }

.decor-garland { position: absolute; top: 0; left: 0; right: 0; display: flex; overflow: hidden; pointer-events: none; z-index: 2; }
.garland-seg { width: 160px; height: 48px; flex: none; }
.bulb {
  opacity: .25;
  animation: bulb-on .5s ease-out forwards, bulb-twinkle 4.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * 70ms + 500ms), calc(var(--i) * 70ms + 1400ms + var(--j) * 600ms);
}
@keyframes bulb-on { to { opacity: 1; } }
@keyframes bulb-twinkle { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(.55); } }

.hero, .card, footer { position: relative; z-index: 1; }
.hero { padding-top: 72px; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.brand img { height: 34px; width: auto; display: block; }
.brand .flake { width: 26px; height: 26px; color: var(--ice); opacity: .9; flex: none; animation: flake-spin 24s linear infinite; }
.brand .flake.small { width: 18px; height: 18px; color: var(--glow); animation-duration: 32s; animation-direction: reverse; }
.brand .flake svg { width: 100%; height: 100%; display: block; }
@keyframes flake-spin { to { transform: rotate(360deg); } }

.star-rule { display: flex; align-items: center; gap: 10px; color: var(--glow); margin: 18px 0 0; max-width: 320px; }
.star-rule span { height: 1px; flex: 1; background: currentColor; opacity: .5; }
.star-rule svg { width: 14px; height: 14px; flex: none; animation: star-glow 3s ease-in-out infinite; }
@keyframes star-glow { 50% { opacity: .45; transform: scale(.85); } }

.card { overflow: hidden; }
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--ember), var(--glow), var(--pine), var(--ice), var(--ember));
}
.card-flake { position: absolute; right: -26px; top: -26px; width: 120px; height: 120px; color: var(--ice); opacity: .14; pointer-events: none; }
.card-flake svg { width: 100%; height: 100%; display: block; }
.card > *:not(.card-flake) { position: relative; }

.rise { animation: rise .7s ease-out .2s both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  .snow-fall, .snow-sway, .brand .flake, .star-rule svg, .rise { animation: none; }
  .bulb { animation: none; opacity: 1; }
}
@media (max-width: 480px) {
  .hero { padding-top: 64px; }
  .brand img { height: 28px; }
  .garland-seg { width: 128px; height: 40px; }
}

/* ---------- Форма по шагам ---------- */
[hidden] { display: none !important; }
.step { margin-bottom: 22px; }
.step-head { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 14px; color: #fff; background: var(--night-soft);
}
.step.done .step-num { background: var(--pine); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; }
input[readonly] { background: #f0f7e6; color: var(--night); }
button.secondary {
  font: inherit; font-size: 16px; font-weight: 600; padding: 0 18px; border-radius: 12px; cursor: pointer; flex: none;
  border: 1.5px solid var(--night-soft); background: var(--night-soft); color: #fff; transition: opacity .15s, background .15s;
}
button.secondary:hover { opacity: .9; }
button.secondary.ghost { background: transparent; color: var(--night); border-color: var(--border); }
button.secondary:disabled { opacity: .5; cursor: default; }
#step-details { animation: step-in .35s ease-out; }
@keyframes step-in { from { opacity: 0; transform: translateY(-6px); } }
.step-pay { margin-bottom: 0; }
.pay-hint { text-align: center; font-size: 14px; color: var(--muted); margin-top: 10px; min-height: 20px; }
.pay-hint.ready { color: #3f7d00; }
@media (prefers-reduced-motion: reduce) { #step-details { animation: none; } }

/* ---------- Выбор сеанса ---------- */
.dates { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 6px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt {
  font: inherit; color: var(--night); background: #fff; border: 1.5px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; text-align: center; line-height: 1.2;
}
.opt:hover:not(:disabled) { border-color: var(--ice); }
.opt:focus-visible { outline: none; border-color: var(--ice); box-shadow: 0 0 0 4px rgba(125, 190, 240, .25); }
.opt[aria-checked=true] { border-color: var(--ember); background: #fff4ec; box-shadow: inset 0 0 0 1px var(--ember); }
.opt:disabled { cursor: default; color: #9aa7b8; background: #eef2f7; border-color: #e1e8f0; }
.opt small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.opt:disabled small { color: #9aa7b8; }
.opt.date { flex: none; width: 64px; padding: 8px 4px; scroll-snap-align: start; }
.opt.date small:first-child { margin: 0 0 2px; text-transform: lowercase; }
.opt.date b { display: block; font-size: 20px; font-weight: 600; }
.opt.time { padding: 10px 4px; font-size: 16px; font-weight: 600; }
.opt.time small.few { color: var(--ember); }
.opt.cat { padding: 12px 8px; font-size: 15px; font-weight: 500; }
@media (max-width: 400px) { .times { grid-template-columns: repeat(2, 1fr); } }
