/* ISS Tickets storefront — public brand surface (tickets.fscv.org). Mobile-
   first premium dark theme: base rules target small screens, @media
   (min-width: ...) blocks widen the layout for tablet/desktop. Deliberately
   self-contained — no external fonts/CDN, system font stack only, same
   reasoning as public-widgets/*/style.css (this ships standalone, must work
   offline-capable and load fast on phones/kiosks). */

:root {
  --bg: #0a0a12;
  --bg-radial-1: #1b1030;
  --bg-radial-2: #0a0a12;
  --surface: #14141f;
  --surface-2: #1b1b2a;
  --surface-3: #232336;
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.05);
  --text: #f5f5fa;
  --text-muted: #a5a5c0;
  --text-faint: #6f6f8c;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --accent-border: rgba(139, 92, 246, 0.4);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gap: 16px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg-radial-1) 0%, transparent 60%),
    var(--bg-radial-2);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

button { font-family: inherit; }

.text-gradient {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.page { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-accent { color: var(--accent); }

.topbar-back {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-back:hover { color: var(--text); }

main { flex: 1; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-footer {
  padding: 28px 20px 40px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

.site-footer a { color: var(--text-faint); text-decoration: underline; }

/* ---------- generic page states ---------- */

.page-state {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 24px;
  text-align: center;
}

.page-state p { margin: 0; color: var(--text-muted); font-size: 14px; }

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: iss-spin 0.8s linear infinite;
}

@keyframes iss-spin { to { transform: rotate(360deg); } }

.page-error h2, .page-empty h2 {
  margin: 0;
  font-size: 18px;
}

.page-error .btn, .page-empty .btn { margin-top: 6px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #ffffff;
  box-shadow: 0 6px 20px var(--accent-soft);
}

.btn-primary:hover { box-shadow: 0 8px 26px var(--accent-soft); }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover { background: var(--surface-2); }

.btn-lg { padding: 15px 28px; font-size: 15px; }

.btn-block { width: 100%; }

/* ---------- landing ---------- */

.hero {
  padding: 56px 20px 40px;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 8vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 0 auto 28px;
  max-width: 560px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
}

.hero-actions { display: flex; justify-content: center; margin-bottom: 56px; }

.hero-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  text-align: left;
}

.hero-features li {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.feature-icon { font-size: 22px; line-height: 1; }

.hero-features h3 { margin: 0 0 4px; font-size: 14px; }

.hero-features p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; }

@media (min-width: 720px) {
  .hero { padding: 96px 20px 64px; }
  .hero-features { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- storefront ---------- */

.storefront { padding: 32px 0 40px; }

.storefront-header { padding: 0 20px 22px; }

.storefront-header h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 5vw, 34px);
  letter-spacing: -0.02em;
}

.storefront-sub { margin: 0; color: var(--text-muted); font-size: 14px; }

.event-grid {
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

@media (min-width: 640px) {
  .event-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .event-grid { grid-template-columns: repeat(3, 1fr); }
}

.event-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.event-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }

.event-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #2a1a4d, #4a1a3d);
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-card-media img { width: 100%; height: 100%; object-fit: cover; }

.event-card-media .media-placeholder { font-size: 36px; opacity: 0.5; }

.date-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(10, 10, 18, 0.78);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-align: center;
  min-width: 46px;
  border: 1px solid var(--border);
}

.date-badge-month {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.date-badge-day { display: block; font-size: 16px; font-weight: 800; line-height: 1.1; }

.ribbon {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--danger);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.event-card-body h2 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }

.event-card-venue, .event-card-when {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.event-card-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-tag { font-size: 14px; font-weight: 700; }

.price-tag.free { color: var(--success); }

/* ---------- event page ---------- */

.event-hero {
  position: relative;
  min-height: 220px;
  background: linear-gradient(135deg, #2a1a4d, #4a1a3d);
  display: flex;
  align-items: flex-end;
}

.event-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-hero-overlay {
  position: relative;
  width: 100%;
  padding: 60px 20px 24px;
  background: linear-gradient(180deg, rgba(10, 10, 18, 0) 0%, rgba(10, 10, 18, 0.92) 90%);
}

.event-hero-inner { max-width: 1080px; margin: 0 auto; }

.event-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 5vw, 34px);
  letter-spacing: -0.02em;
}

.event-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.event-hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

.event-body {
  padding: 24px 20px 140px;
  display: grid;
  gap: 24px;
}

@media (min-width: 860px) {
  .event-body { grid-template-columns: 1.5fr 1fr; align-items: start; padding-bottom: 40px; }
  .event-sidebar { position: sticky; top: 20px; }
}

.event-sold-out-banner {
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card h2 { margin: 0 0 12px; font-size: 16px; }

.event-description { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text-muted); white-space: pre-wrap; }

.ticket-type-list { display: flex; flex-direction: column; gap: 14px; }

.ticket-type-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.ticket-type-row.is-unavailable { opacity: 0.55; }

.ticket-type-info { flex: 1; min-width: 0; }

.ticket-type-info h3 { margin: 0 0 3px; font-size: 14px; }

.ticket-type-info p { margin: 0 0 6px; font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.ticket-type-price { font-size: 14px; font-weight: 700; }

.ticket-type-status-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: #fecaca;
}

.ticket-type-availability {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--warning);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.qty-value { min-width: 20px; text-align: center; font-size: 15px; font-weight: 700; }

.purchaser-form { display: flex; flex-direction: column; gap: 12px; }

.form-field { display: flex; flex-direction: column; gap: 6px; }

.form-field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

.form-field input {
  font-size: 15px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text);
  font-family: inherit;
}

.form-field input:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-field.has-error input { border-color: var(--danger); }

.form-field-error { font-size: 12px; color: var(--danger); }

.checkout-error {
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.order-summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
}

.order-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 800;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid var(--border-soft);
}

.total-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 10, 18, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.total-bar-amount { display: flex; flex-direction: column; }

.total-bar-amount .label { font-size: 11px; color: var(--text-muted); }

.total-bar-amount .value { font-size: 20px; font-weight: 800; }

@media (min-width: 860px) {
  .total-bar { position: static; background: transparent; backdrop-filter: none; border-top: none; padding: 0; margin-top: 16px; }
}

/* ---------- order status page ---------- */

.order-page { padding: 32px 20px 48px; }

.order-status-hero {
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  margin-bottom: 24px;
}

.order-status-hero .status-icon { font-size: 34px; margin-bottom: 10px; }

.order-status-hero h1 { margin: 0 0 6px; font-size: 20px; }

.order-status-hero p { margin: 0; color: var(--text-muted); font-size: 14px; }

.order-status-hero.status-paid { background: var(--success-soft); border-color: rgba(52, 211, 153, 0.3); }
.order-status-hero.status-pending { background: var(--warning-soft); border-color: rgba(251, 191, 36, 0.3); }
.order-status-hero.status-expired,
.order-status-hero.status-cancelled { background: var(--surface); }
.order-status-hero.status-refunded { background: var(--surface); }

.order-meta-card {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.order-meta-card .row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
}

.order-meta-card .row span:first-child { color: var(--text-muted); }

.email-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  margin: 22px 0 4px;
}

.ticket-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

@media (min-width: 640px) {
  .ticket-grid { grid-template-columns: repeat(2, 1fr); }
}

.ticket-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.ticket-qr {
  width: 168px;
  max-width: 100%;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 10px;
}

.ticket-qr svg { display: block; width: 100%; height: 100%; }

.ticket-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.ticket-type-name { font-size: 13px; color: var(--text-muted); }

.ticket-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ticket-status-badge.status-valid { background: var(--success-soft); color: #a7f3d0; }
.ticket-status-badge.status-checked_in { background: var(--accent-soft); color: #ddd6fe; }
.ticket-status-badge.status-void,
.ticket-status-badge.status-refunded { background: var(--danger-soft); color: #fecaca; }
