:root {
  color-scheme: dark;
  --bg: #08070f;
  --panel: #12111d;
  --panel-2: #181621;
  --text: #ffffff;
  --muted: #9b96a8;
  --line: rgba(255, 255, 255, 0.12);
  --purple: #8d4dff;
  --pink: #dc45aa;
  --green: #16d978;
  --danger: #ff5d6c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 80% 0%, rgba(141, 77, 255, 0.28), transparent 30%),
    radial-gradient(circle at 15% 90%, rgba(220, 69, 170, 0.16), transparent 28%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.primary-link {
  color: var(--text);
  text-decoration: none;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
}

.brand span,
.landing h1 span {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.ghost-button,
.icon-button,
.link-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
}

.link-button {
  border: 0;
  background: transparent;
  color: #b895ff;
  padding: 8px;
}

.event-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}

.hero-card,
.checkout-card,
.details-section,
.state-card,
.panel-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(18, 17, 29, 0.9);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
}

.hero-card {
  position: relative;
  min-height: 520px;
  overflow: hidden;
}

.event-image {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, #24003e, #681169 58%, #22001c),
    var(--panel);
  background-size: cover;
  background-position: center;
}

.event-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 7, 15, 0.05), rgba(8, 7, 15, 0.18) 38%, rgba(8, 7, 15, 0.92));
}

.hero-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 34px;
}

.tag,
.eyebrow {
  margin: 0 0 12px;
  color: #c7a9ff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 900;
}

.hero-overlay h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-meta span {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 800;
}

.checkout-card {
  position: sticky;
  top: 18px;
  padding: 22px;
}

.ticket-list {
  display: grid;
  gap: 12px;
}

.ticket-card {
  width: 100%;
  display: grid;
  gap: 6px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.ticket-card.selected {
  border-color: rgba(184, 149, 255, 0.9);
  background: linear-gradient(135deg, rgba(141, 77, 255, 0.28), rgba(220, 69, 170, 0.16));
}

.ticket-card strong {
  font-size: 20px;
}

.ticket-card span,
.quantity-row span,
.referral-field span,
.terms-box,
.total-box span,
.message,
.hint,
.details-section p,
.organizer span {
  color: var(--muted);
}

.ticket-benefits,
.empty-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 14px;
  line-height: 1.45;
}

.ticket-benefits strong {
  color: var(--text);
}

.ticket-benefits:not(.visible) {
  display: none;
}

.quantity-row,
.total-box > div,
.organizer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.quantity-row {
  margin-top: 18px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.stepper strong {
  min-width: 24px;
  text-align: center;
}

.referral-field,
.modal-card label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 14px 15px;
  outline: none;
}

input:focus {
  border-color: rgba(184, 149, 255, 0.9);
}

.terms-box {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.terms-box label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.terms-box input {
  width: auto;
  margin-top: 3px;
}

.terms-box button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: #b895ff;
  padding: 0;
  font-weight: 850;
}

.total-box {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.grand-total {
  font-size: 22px;
}

.primary-button,
.secondary-button,
.google-button,
.primary-link {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 16px 18px;
  margin-top: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  font-size: 17px;
  font-weight: 950;
}

.secondary-button,
.google-button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.message {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 14px;
}

.message.error {
  color: var(--danger);
}

.message.ok {
  color: var(--green);
}

.details-section {
  grid-column: 1 / 2;
  padding: 28px;
}

.details-section h2,
.panel-card h2,
.modal-card h2,
.state-card h1 {
  margin: 0 0 14px;
  font-size: 28px;
  letter-spacing: 0;
}

.details-section p {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
}

.organizer {
  justify-content: flex-start;
  margin-bottom: 24px;
}

.avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  background-size: cover;
  background-position: center;
}

.organizer strong {
  display: block;
  font-size: 18px;
}

.lineup {
  margin-top: 28px;
}

.lineup-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.state-card {
  width: min(520px, 100%);
  margin: 80px auto;
  padding: 34px;
  text-align: center;
}

.loader {
  width: 42px;
  height: 42px;
  margin: 0 auto 18px;
  border: 4px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.payment-panel,
.success-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 7, 15, 0.78);
  backdrop-filter: blur(14px);
}

.panel-card,
.modal-card {
  width: min(520px, 100%);
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal {
  width: min(520px, calc(100% - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(8, 7, 15, 0.78);
  backdrop-filter: blur(14px);
}

.modal-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.terms-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.qr-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.qr-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.qr-card canvas {
  max-width: 100%;
  border-radius: 18px;
  background: #fff;
  padding: 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  transform: translateX(-50%);
  max-width: min(460px, calc(100% - 32px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 14px 16px;
  color: #fff;
  background: rgba(18, 17, 29, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  font-weight: 800;
}

.landing {
  display: grid;
  place-items: center;
  padding: 24px;
}

.landing-shell {
  width: min(520px, 100%);
  text-align: center;
}

.landing h1 {
  margin: 0;
  font-size: clamp(54px, 12vw, 96px);
  line-height: 0.9;
}

.landing-copy {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.landing-copy.small {
  font-size: 15px;
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 24px, 560px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
  }

  .auth-status {
    align-items: flex-end;
    flex-direction: column;
  }

  .event-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .hero-card {
    order: 1;
    min-height: 440px;
    border-radius: 26px;
  }

  .hero-overlay {
    padding: 24px;
  }

  .checkout-card {
    order: 3;
    position: static;
    margin-top: 0;
  }

  .details-section {
    order: 2;
    margin-top: 0;
  }
}
