:root {
  color-scheme: light;
  --ink: #171513;
  --muted: #6f675d;
  --paper: #f7f3ec;
  --panel: #fffaf1;
  --line: #ded1bf;
  --brand: #8d2f24;
  --brand-2: #1f6f6b;
  --gold: #c69240;
  --shadow: 0 24px 70px rgba(50, 32, 20, .18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

body {
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: inherit; }

button, input, textarea, select {
  font: inherit;
}

.hero {
  position: relative;
  min-height: min(720px, 88vh);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero__media,
.checkout__photo {
  background-image: url("/static/budapest-view.jpg");
  background-size: cover;
  background-position: center;
}

.hero__media,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__shade {
  background:
    linear-gradient(180deg, rgba(19, 18, 16, .16), rgba(19, 18, 16, .76)),
    linear-gradient(90deg, rgba(22, 15, 10, .75), rgba(22, 15, 10, .1));
}

.hero__content {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0 56px;
  color: #fffaf0;
}

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

.hero h1,
.checkout h1,
.admin-header h1 {
  margin: 0;
  line-height: .96;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 860px;
  font-size: clamp(54px, 8vw, 118px);
}

.hero p:not(.eyebrow) {
  max-width: 560px;
  font-size: 20px;
  line-height: 1.5;
}

.hero__stats,
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 760px;
  margin-top: 34px;
  border: 1px solid rgba(255, 250, 240, .28);
  background: rgba(255, 250, 240, .2);
  backdrop-filter: blur(16px);
}

.hero__stats span,
.admin-stats div {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 18px;
  background: rgba(35, 25, 17, .38);
}

.hero__stats strong,
.admin-stats strong {
  display: block;
  font-size: 24px;
  color: #fffaf0;
}

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

.intro {
  padding: 42px 0 64px;
}

.intro h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.intro p,
.muted,
.fineprint {
  color: var(--muted);
}

.ticket-page {
  min-height: 100vh;
  background: #f4f6f8;
  color: #111827;
}

.ticket-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  padding: 0 max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid #d8dde4;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(17, 24, 39, .04);
}

.ticket-header a {
  color: #0346b6;
  font-weight: 900;
  text-decoration: none;
}

.ticket-header span {
  color: #5b6472;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.ticket-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.ticket-main {
  display: grid;
  gap: 18px;
}

.event-strip,
.purchase-card,
.delivery-card,
.summary-card {
  border: 1px solid #d8dde4;
  background: #ffffff;
}

.event-strip {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 172px;
}

.event-strip__image {
  background-image: url("/static/budapest-view.jpg");
  background-size: cover;
  background-position: center;
}

.event-strip > div:last-child {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 26px 30px;
}

.event-strip h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1;
}

.event-strip p:not(.eyebrow) {
  margin: 0;
  color: #4b5563;
  font-size: 18px;
}

.purchase-card,
.delivery-card,
.summary-card {
  padding: 22px;
}

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

.purchase-card h2,
.delivery-card h2,
.summary-card h2 {
  margin: 0;
  font-size: 21px;
}

.purchase-card p,
.delivery-card p,
.summary-note {
  margin: 6px 0 0;
  color: #5b6472;
  line-height: 1.45;
}

.purchase-card__top > strong {
  white-space: nowrap;
  color: #0346b6;
  font-size: 18px;
}

.delivery-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #d8dde4;
  background: #f8fafc;
}

.delivery-row strong {
  color: #0f766e;
  text-align: right;
}

.summary-card {
  position: sticky;
  top: 88px;
  align-self: start;
  box-shadow: 0 18px 40px rgba(17, 24, 39, .12);
}

.summary-line,
.summary-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

.summary-line span,
.summary-note {
  color: #5b6472;
}

.summary-total {
  align-items: end;
  border-bottom: 0;
}

.summary-total span {
  font-weight: 900;
}

.summary-total strong {
  color: #111827;
  font-size: 32px;
  line-height: 1;
}

.mobile-total {
  display: none;
}

.checkout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 540px);
}

.checkout__photo {
  min-height: 100vh;
}

.checkout__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 52px;
  background:
    linear-gradient(160deg, rgba(255, 250, 241, .94), rgba(250, 239, 223, .98)),
    var(--panel);
  box-shadow: var(--shadow);
}

.checkout h1 {
  font-size: clamp(46px, 6vw, 82px);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.slot-button,
button,
.primary,
.ghost {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 48px;
  padding: 0 18px;
  background: #fffaf1;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.danger {
  border-color: #b91c1c;
  background: #fff5f5;
  color: #991b1b;
}

.danger:hover {
  background: #b91c1c;
  color: #ffffff;
}

.slot-button {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 76px;
  border-color: #cbd5e1;
  background: #ffffff;
}

.slot-button strong {
  font-size: 24px;
}

.slot-button span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.slot-button.is-active,
.primary {
  border-color: #0346b6;
  background: #0346b6;
  color: white;
}

.slot-button.is-active span {
  color: rgba(255, 255, 255, .86);
}

.amount-card {
  display: grid;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .45);
}

.amount-card strong {
  font-size: clamp(42px, 6vw, 66px);
  line-height: 1;
}

.amount-card small {
  color: var(--muted);
  line-height: 1.4;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.actions > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.summary-card .primary,
.summary-card button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
}

.is-disabled,
button:disabled {
  opacity: .42;
  pointer-events: none;
}

.mini-ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  padding: 0;
  margin: 22px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.mini-ledger div {
  padding: 14px;
  background: var(--panel);
}

.mini-ledger dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.mini-ledger dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.notice {
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--brand-2);
  background: rgba(31, 111, 107, .1);
}

.admin-shell {
  padding: 42px 0 72px;
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: clamp(42px, 6vw, 78px);
}

.admin-stats {
  max-width: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-color: var(--line);
  background: var(--line);
  backdrop-filter: none;
  margin-bottom: 20px;
}

.admin-stats div {
  background: var(--brand);
  color: white;
}

.admin-card {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}

.admin-card h2 {
  margin: 0 0 18px;
  font-size: 22px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.wide {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  background: #fffaf1;
  color: var(--ink);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.friend-list {
  display: grid;
  gap: 10px;
}

.friend-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(76px, .4fr)) minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, .64);
}

.friend-row a {
  display: block;
  margin-top: 4px;
  color: var(--brand-2);
  overflow-wrap: anywhere;
  font-size: 13px;
}

footer {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 860px) {
  .hero {
    min-height: 88vh;
  }

  .ticket-shell,
  .event-strip,
  .hero__stats,
  .admin-stats,
  .actions,
  .checkout,
  .admin-form,
  .friend-row {
    grid-template-columns: 1fr;
  }

  .ticket-shell {
    width: 100%;
    gap: 12px;
    padding: 0 0 28px;
  }

  .ticket-header {
    padding: 0 18px;
  }

  .event-strip,
  .purchase-card,
  .delivery-card,
  .summary-card {
    border-left: 0;
    border-right: 0;
  }

  .event-strip__image {
    min-height: 210px;
  }

  .summary-card {
    position: static;
    box-shadow: none;
  }

  .mobile-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 16px 0 0;
    border-top: 1px solid #e5e7eb;
  }

  .mobile-total strong {
    font-size: 26px;
  }

  .purchase-card__top,
  .delivery-row {
    display: grid;
  }

  .delivery-row strong {
    text-align: left;
  }

  .checkout__photo {
    min-height: 34vh;
  }

  .checkout__panel {
    min-height: auto;
    padding: 28px 18px 38px;
  }

  .slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
