:root {
  --red: #d71920;
  --red-dark: #a81218;
  --ink: #171717;
  --muted: #6f6460;
  --line: #e8e1dc;
  --paper: #fff7ef;
  --panel: #ffffff;
  --green: #197a4b;
  --amber: #a35f00;
  --shadow: 0 24px 70px rgba(64, 31, 24, 0.14);
  --soft-shadow: 0 10px 26px rgba(64, 31, 24, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(215, 25, 32, 0.11), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), transparent 35%),
    linear-gradient(315deg, rgba(25, 122, 75, 0.08), transparent 38%),
    var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
.iti {
  font: inherit;
}

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

.shell.narrow {
  width: min(920px, calc(100% - 32px));
}

.shell.compact {
  width: min(680px, calc(100% - 32px));
}

.purchase-panel {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
  align-items: center;
  gap: 44px;
}

.brand-block h1,
.status-hero h1,
.content-card h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.content-card h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.brand-block h1,
.status-hero h1,
.content-card h1,
.ticket-card h2,
.form-heading strong {
  font-family: Sora, Manrope, ui-sans-serif, system-ui, sans-serif;
}

.lead,
.status-hero p,
.muted {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 650px;
}

.brand-mark {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.brand-mark.large {
  width: min(210px, 42vw);
  height: auto;
  margin-bottom: 24px;
  box-shadow: var(--soft-shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quick-facts,
.buyer-row,
.ticket-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-facts span,
.buyer-row span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-weight: 800;
  box-shadow: var(--soft-shadow);
}

.form-card,
.content-card,
.notice,
.status-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.form-card {
  padding: 30px;
  display: grid;
  gap: 16px;
  position: relative;
}

.form-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--red), #171717, var(--green));
}

.form-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
}

.form-heading span {
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-heading strong {
  font-size: 1.35rem;
}

label {
  display: grid;
  gap: 8px;
  color: #333;
  font-weight: 800;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input:not([type]),
.iti {
  width: 100%;
}

input {
  min-height: 52px;
  border: 1px solid #d8d0ca;
  border-radius: 8px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(23, 23, 23, 0.03);
}

input:focus,
.iti:focus-within input {
  outline: 3px solid rgba(215, 25, 32, 0.18);
  border-color: var(--red);
}

.iti input {
  width: 100%;
}

.iti__selected-country {
  border-radius: 8px 0 0 8px;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 900;
}

.primary-btn {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: 0 12px 24px rgba(215, 25, 32, 0.24);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--soft-shadow);
}

.danger-btn {
  background: #2b2b2b;
  color: #fff;
}

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.brand-link img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.status-hero,
.content-card,
.notice {
  padding: 26px;
  margin-bottom: 18px;
}

.status-hero.approved {
  border-color: rgba(25, 122, 75, 0.35);
}

.status-hero.pending_review {
  border-color: rgba(163, 95, 0, 0.35);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.section-title h2,
.upload-box h2 {
  margin: 0;
  font-size: 1.35rem;
}

.qr-frame {
  width: min(420px, 100%);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  cursor: zoom-in;
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-box {
  margin-top: 22px;
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.ticket-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 18px;
  color: #fff;
  background: linear-gradient(135deg, #171717, #3a1214 48%, #d71920);
  box-shadow: var(--shadow);
}

.ticket-card h2 {
  margin: 0;
  font-size: clamp(2.4rem, 10vw, 5.5rem);
  letter-spacing: 0;
}

.ticket-card p {
  margin: 8px 0 32px;
  font-size: 1.1rem;
}

.ticket-card img {
  position: absolute;
  right: 22px;
  top: 22px;
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.ticket-footer {
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  padding-top: 18px;
  font-weight: 800;
}

.qr-modal {
  width: min(760px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.qr-modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.qr-modal img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.icon-btn {
  margin-left: auto;
  width: 42px;
  padding: 0;
  background: #111;
  color: #fff;
}

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

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid #999;
  border-radius: 8px;
  background: #fff;
}

.admin-row.pending_review {
  border-left-color: var(--amber);
}

.admin-row.approved {
  border-left-color: var(--green);
}

.admin-row strong,
.admin-row span,
.admin-row small {
  display: block;
}

.admin-row small {
  color: var(--muted);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-actions form {
  margin: 0;
}

.qr-admin-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.qr-preview {
  width: 220px;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

@media (max-width: 820px) {
  .purchase-panel {
    min-height: auto;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .brand-block h1,
  .status-hero h1 {
    font-size: clamp(2.3rem, 12vw, 3.5rem);
  }

  .section-title,
  .topbar,
  .admin-row {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .admin-actions {
    justify-content: stretch;
  }

  .admin-actions > *,
  .admin-actions button,
  .admin-actions a {
    width: 100%;
  }

  .qr-admin-grid {
    grid-template-columns: 1fr;
  }

  .qr-preview {
    width: 100%;
    max-width: 280px;
  }

  .ticket-card {
    padding-top: 128px;
  }

  .ticket-card img {
    left: 24px;
    right: auto;
  }
}
