/* Owner: TIX-10. The ticket office and «Мои билеты» on tickets.colossus.kz, styled as the Colossus site
   (projects/colossus/site/src/app/globals.css): near-black ground, panels with a hairline, no brand hue — the
   accent is the inversion. Inter is served from /static/fonts because the bot's CSP allows fonts only from self. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+20B8, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: #141414;
  --panel-2: #1a1a1a;
  --light: #f2f2f2;
  --text: #f3f3f3;
  --ink: #070707;
  --muted: #8f8f8f;      /* the site's #888 nudged to 6:1 on the panel */
  --hairline: #2a2a2a;
  --accent: #f3f3f3;     /* brand has no hue: accent = inversion */
  --danger: #ff8a7a;     /* error text only, 7:1 on the panel; always with a sign, never colour alone */
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { background: var(--bg); overflow-x: clip; -webkit-tap-highlight-color: rgb(243 243 243 / .2); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: inherit; }
a, button, label, summary { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }
time, .tnum { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ layout */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(8px + var(--safe-top)) 20px 8px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .005em;
  text-decoration: none;
  text-transform: lowercase;
}
/* The real logo file (site/public/media/Colossus-LOGO-horizontal.webp), at the site header's size: 18 px, 20 px wide. */
.wordmark img { display: block; height: 18px; width: auto; }
@media (min-width: 768px) { .wordmark img { height: 20px; } }
.top-nav { display: flex; align-items: center; gap: 4px; }
.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.top-link:hover { color: var(--text); }
.top-link[aria-current="page"] { color: var(--text); pointer-events: none; }

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px calc(48px + var(--safe-bottom));
}
@media (min-width: 768px) {
  .top { padding-inline: 40px; }
  main { padding: 48px 40px 80px; }
}

/* Event page: the event on the left, the purchase on the right; one column on a phone. */
.split { display: grid; gap: 32px; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) 420px; gap: 56px; align-items: start; }
  .split > .card { position: sticky; top: 24px; }
}
.narrow { max-width: 480px; margin: 0 auto; }

/* -------------------------------------------------------------- typography */

.label {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.display {
  margin: 12px 0 0;
  font-size: clamp(44px, 12vw, 104px);
  font-weight: 700;
  letter-spacing: -.032em;
  line-height: .98;
  text-wrap: balance;
}
h1.title { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
h2 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.muted { color: var(--muted); }
.lead { font-size: 18px; }
.facts { margin-top: 24px; display: grid; gap: 6px; font-size: 18px; }
.facts .price { font-weight: 600; display: grid; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 24px 20px;
}
@media (min-width: 768px) { .card { padding: 28px; } }
/* Grid gap, not sibling margins: hidden states (display: none) then leave no stray space. */
.card { display: grid; gap: 20px; }
.card > * { min-width: 0; }

.notice { padding: 16px; border-radius: 8px; background: var(--panel-2); }
.notice { display: grid; gap: 6px; }

/* The poster: under the purchase on a phone (the form comes first), under the event's facts on a wide screen. */
.poster { display: block; width: 100%; max-width: 560px; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 12px; background: var(--panel); }
@media (min-width: 900px) {
  .split > #event { grid-column: 1; grid-row: 1; }
  .split > #buy { grid-column: 2; grid-row: 1 / span 2; }
  .split > .poster { grid-column: 1; grid-row: 2; max-width: 480px; }
}
/* The event's poster beside its title in «Мои билеты» and on the open ticket; small — the QR stays the main thing. */
.event-head { display: flex; align-items: center; gap: 14px; }
.event-head .thumb { flex: none; width: 48px; height: 60px; border-radius: 6px; object-fit: cover; background: var(--panel-2); }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  font: 600 12px/1.25 var(--font);
  letter-spacing: .13em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn-block { display: flex; width: 100%; }
.btn-accent { background: var(--accent); color: var(--bg); }
.btn-accent:hover { background: #e1e1e1; }
.btn-accent:active { background: #cfcfcf; }
.btn-ghost { border-color: var(--hairline); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin .8s linear infinite;
}
.btn .sum { font-variant-numeric: tabular-nums; }
.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------- forms */

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend, .field-label { display: block; margin: 0 0 8px; padding: 0; font-size: 14px; color: var(--muted); }

/* Quantity: radios drawn as chips (a value, not tabs). */
.qty { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qty input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qty label {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}
.qty label:hover { border-color: #4a4a4a; }
.qty input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.qty input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; }
.qty input:disabled + label { color: #4d4d4d; border-style: dashed; cursor: not-allowed; }

.input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #3a3a3a;   /* 3:1 to the panel */
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: 500 18px/1.2 var(--font);
  font-variant-numeric: tabular-nums;
}
.input::placeholder { color: #6b6b6b; }
.input:hover { border-color: #555; }
.input:focus { outline: none; border-color: var(--accent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
/* Space for the message is kept so the form does not jump (UX «Формы»). */
.field-msg { min-height: 20px; margin-top: 6px; font-size: 14px; color: var(--muted); }
.field-msg.error { color: var(--danger); }
.field-msg.error::before { content: "✕ "; }

.check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding-top: 10px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }
.form-error { color: var(--danger); }
.form-error::before { content: "✕ "; }

/* ----------------------------------------------------------------- tickets */

.event-group + .event-group { margin-top: 40px; }
.event-group p { margin-top: 4px; }
.tickets { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 768px) { .tickets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 72px;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
}
button.ticket { cursor: pointer; transition: border-color .18s ease, background-color .18s ease; }
button.ticket:hover { border-color: #3d3d3d; background: var(--panel-2); }
.ticket b { display: block; font-size: 18px; }
.ticket .sub { display: block; color: var(--muted); font-size: 14px; }
.tag {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid var(--hairline);
  color: var(--muted);
}
.tag-valid { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Live QR, full screen. White plate for the scanner; the clock, the refresh bar and the drifting background are
   what the door looks at to tell a live screen from a screenshot (same cues as the mini app, TIX-3). */
.qr-view {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  background: var(--bg);
}
.qr-view .bg { position: fixed; inset: -30%; pointer-events: none; }
.qr-view .bg::before, .qr-view .bg::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); }
.qr-view .bg::before { width: 70vmax; height: 70vmax; left: 10%; top: 5%;
  background: radial-gradient(circle, #5a5a5a 0%, transparent 65%); animation: drift-a 9s ease-in-out infinite alternate; }
.qr-view .bg::after { width: 60vmax; height: 60vmax; right: 5%; bottom: 0;
  background: radial-gradient(circle, #3a3a3a 0%, transparent 65%); animation: drift-b 11s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(28vw, 30vh) scale(1.2); } }
@keyframes drift-b { to { transform: translate(-30vw, -26vh) scale(.85); } }
.qr-inner {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  min-height: 100%;
  padding: calc(12px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.qr-plate { background: var(--light); color: var(--ink); border-radius: 20px; padding: 16px; display: grid; gap: 12px; }
.qr-box { aspect-ratio: 1; width: 100%; display: grid; place-items: center; position: relative; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-box svg path, .qr-box svg rect.m { fill: var(--ink); }
.qr-box.stale svg { opacity: .15; }
.qr-box .note { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 24px;
  font-weight: 600; font-size: 18px; }
.qr-box.stale .note { display: grid; }
.qr-live { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qr-clock { font: 700 28px/1 ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; }
.qr-bar { flex: 1; height: 4px; background: #d6d6d6; border-radius: 2px; overflow: hidden; }
.qr-bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; }
.qr-show { font-size: 20px; font-weight: 700; }

/* ------------------------------------------------------------------ states */

.skeleton-line { display: block; height: 18px; border-radius: 4px; background: var(--panel-2); }
.skeleton-line.big { height: 64px; max-width: 80%; }
.status-icon { font-size: 28px; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .qr-view .bg::before, .qr-view .bg::after { animation: none; }
  .btn[aria-busy="true"]::after { animation-duration: 2.4s; }
}

.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.narrow.mt-32 { margin-left: 0; }
.btn:disabled { opacity: .55; cursor: progress; }
