:root {
  --deep: #071f1d;
  --green: #0b3f39;
  --green-2: #0e554d;
  --cream: #f5dec5;
  --paper: #fffaf3;
  --paper-2: #f8f0e6;
  --ink: #152d2a;
  --muted: #6e7f7c;
  --line: rgba(18, 55, 51, 0.13);
  --gold: #cda875;
  --burgundy: #8e1c2b;
  --success: #247d59;
  --danger: #a32937;
  --shadow: 0 28px 80px rgba(5, 31, 29, 0.18);
  --soft-shadow: 0 14px 44px rgba(5, 31, 29, 0.09);
}

* { box-sizing: border-box; }
html { font-family: "Segoe UI", Tahoma, Arial, sans-serif; background: var(--paper); color: var(--ink); }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.music-mark { color: var(--gold); font-size: 36px; line-height: 0.8; }
.eyebrow { color: var(--burgundy); font-size: 11px; font-weight: 900; letter-spacing: 0.2em; }
.alert { border-radius: 14px; margin: 0 0 18px; padding: 13px 15px; font-size: 14px; font-weight: 700; }
.alert.error { background: #f9e5e6; border: 1px solid #ebc7ca; color: #85202b; }
.primary-button, .secondary-button {
  align-items: center;
  border-radius: 14px;
  display: inline-flex;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.primary-button { background: var(--burgundy); border: 1px solid var(--burgundy); box-shadow: 0 10px 24px rgba(142, 28, 43, 0.2); color: #fff; font-weight: 900; }
.secondary-button { background: #fff; border: 1px solid var(--line); color: var(--green); font-weight: 800; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.primary-button:focus-visible, .secondary-button:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(205, 168, 117, 0.45); outline-offset: 2px; }
.primary-button.compact { min-height: 42px; padding: 9px 14px; }

/* Registration */
.registration-page { background: var(--paper); overflow-x: hidden; }
.registration-shell { display: grid; grid-template-columns: minmax(430px, 0.95fr) minmax(520px, 1.05fr); min-height: 100vh; }
.poster-panel { align-items: center; background: var(--deep); display: flex; justify-content: center; min-height: 100vh; overflow: hidden; padding: 44px; position: sticky; top: 0; }
.poster-backdrop { background: linear-gradient(180deg, rgba(5, 20, 18, 0.25), rgba(4, 35, 31, 0.72)), url("/assets/antika-poster.jpeg") center / cover; filter: blur(24px) saturate(0.86); inset: -45px; opacity: 0.78; position: absolute; transform: scale(1.08); }
.poster-panel::after { background: linear-gradient(90deg, rgba(5, 28, 25, 0.36), transparent 40%, rgba(7, 31, 29, 0.28)); content: ""; inset: 0; position: absolute; }
.poster-frame { border: 1px solid rgba(245, 222, 197, 0.32); border-radius: 38px; box-shadow: 0 34px 110px rgba(0, 0, 0, 0.44); max-width: 610px; overflow: hidden; position: relative; width: min(78%, 610px); z-index: 1; }
.poster-frame img { display: block; height: auto; width: 100%; }
.poster-copy { bottom: 58px; color: #fff; left: 58px; position: absolute; text-align: left; z-index: 2; }
.poster-copy .kicker { color: var(--cream); font-size: 10px; font-weight: 900; letter-spacing: 0.22em; }
.poster-copy h1 { font-family: Georgia, serif; font-size: clamp(30px, 3vw, 52px); margin: 8px 0 4px; }
.poster-copy p { color: rgba(255, 255, 255, 0.78); margin: 0; }
.form-panel { align-items: center; background: radial-gradient(circle at 85% 10%, rgba(205, 168, 117, 0.13), transparent 27%), var(--paper); display: flex; min-height: 100vh; padding: clamp(36px, 6vw, 88px); }
.form-wrap { margin: auto; max-width: 720px; width: 100%; }
.form-header { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; margin-bottom: 40px; padding-bottom: 24px; }
.secure-chip { align-items: center; background: rgba(11, 63, 57, 0.07); border: 1px solid rgba(11, 63, 57, 0.1); border-radius: 999px; color: var(--green); display: inline-flex; font-size: 12px; font-weight: 800; gap: 7px; padding: 8px 11px; }
.secure-chip i, .status-pill i { background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(36, 125, 89, 0.1); display: inline-block; height: 7px; width: 7px; }
.form-intro h2 { color: var(--ink); font-size: clamp(35px, 4vw, 54px); letter-spacing: -0.045em; line-height: 1; margin: 10px 0 13px; }
.form-intro p { color: var(--muted); margin: 0 0 28px; }
.registration-form { display: grid; gap: 17px 14px; grid-template-columns: 1fr 1fr; }
.field { color: #324642; display: grid; font-size: 13px; font-weight: 800; gap: 8px; }
.field.full, .registration-form .full { grid-column: 1 / -1; }
.field span b { color: var(--burgundy); }
.field input, .table-tools input, .table-tools select, .manual-scan input {
  appearance: none;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(21, 66, 61, 0.17);
  border-radius: 13px;
  color: var(--ink);
  min-height: 50px;
  padding: 12px 14px;
  width: 100%;
}
.field input::placeholder, .manual-scan input::placeholder { color: #9ba6a3; }
.field input:focus, .table-tools input:focus, .table-tools select:focus, .manual-scan input:focus { background: #fff; border-color: var(--gold); outline: 3px solid rgba(205, 168, 117, 0.18); }
.field small { color: var(--muted); font-size: 10px; font-weight: 600; }
.registration-form .primary-button { justify-content: space-between; margin-top: 3px; min-height: 56px; padding-inline: 22px; }
.registration-form .primary-button b { font-size: 23px; }
.privacy { color: var(--muted); font-size: 11px; line-height: 1.65; margin: -3px auto 0; max-width: 580px; text-align: center; }
.event-facts { border-top: 1px solid var(--line); display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); margin-top: 34px; padding-top: 24px; }
.event-facts div { display: grid; gap: 5px; }
.event-facts span { color: var(--muted); font-size: 10px; font-weight: 700; }
.event-facts strong { color: var(--green); font-size: 12px; }
.venue-link { color: inherit; text-decoration: none; }
.venue-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.venue-link small { color: var(--burgundy); display: inline-block; font-size: 10px; font-style: normal; margin-inline-start: 4px; white-space: nowrap; }

/* Ticket */
.ticket-body { background: radial-gradient(circle at 15% 15%, #155d54 0, var(--deep) 38%, #031513 100%); color: #fff; padding: 44px 20px; }
.ticket-page { align-items: center; display: flex; justify-content: center; min-height: calc(100vh - 88px); }
.ticket-stage { display: grid; grid-template-columns: minmax(420px, 610px) minmax(300px, 500px); margin: auto; max-width: 1080px; width: 100%; }
.ticket-card { background: var(--paper); border-radius: 30px 0 0 30px; color: var(--ink); padding: 34px 50px; text-align: center; }
.ticket-brand { align-items: center; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; margin-bottom: 22px; padding-bottom: 19px; }
.ticket-id { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: 0.18em; }
.ticket-status-icon { align-items: center; background: var(--green); border: 7px solid rgba(11, 63, 57, 0.09); border-radius: 50%; box-shadow: 0 0 0 1px rgba(11, 63, 57, 0.2); color: var(--cream); display: flex; font-size: 30px; font-weight: 900; height: 69px; justify-content: center; margin: 0 auto 18px; width: 69px; }
.ticket-card h1 { font-size: clamp(30px, 4vw, 47px); letter-spacing: -0.04em; margin: 8px 0 6px; }
.ticket-message { color: var(--muted); margin: 0 auto 18px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: 25px; box-shadow: var(--soft-shadow); margin: 14px auto 8px; padding: 10px; width: min(270px, 100%); }
.qr-card img { display: block; height: auto; width: 100%; }
.qr-note { color: var(--muted); font-size: 12px; font-weight: 700; }
.status-pill { align-items: center; border-radius: 999px; display: inline-flex; font-size: 12px; font-weight: 900; gap: 9px; padding: 8px 13px; }
.status-pill.registered { background: #e4f2eb; color: #1e684b; }
.status-pill.entered { background: #e8eceb; color: #40524f; }
.ticket-card .event-facts { text-align: right; }
.ticket-actions { display: flex; gap: 10px; justify-content: center; margin-top: 26px; }
.ticket-poster { background: var(--green); border-radius: 0 30px 30px 0; min-height: 650px; overflow: hidden; position: relative; }
.ticket-poster img { height: 100%; object-fit: cover; width: 100%; }
.ticket-poster::after { border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 22px; content: ""; inset: 17px; pointer-events: none; position: absolute; }

/* Authentication */
.auth-body { background: radial-gradient(circle at 20% 0, #155a51 0, var(--deep) 48%, #041614 100%); padding: 28px; }
.auth-page { align-items: center; display: flex; justify-content: center; min-height: calc(100vh - 56px); }
.auth-card { background: var(--paper); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 28px; box-shadow: 0 35px 90px rgba(0, 0, 0, 0.3); max-width: 480px; padding: 42px; width: 100%; }
.auth-card > .wordmark { margin-bottom: 36px; }
.auth-card h1 { font-size: 40px; letter-spacing: -0.04em; margin: 9px 0; }
.auth-card > p { color: var(--muted); line-height: 1.7; margin: 0 0 24px; }
.auth-form { display: grid; gap: 16px; }
.text-link { color: var(--green); display: inline-block; font-size: 13px; font-weight: 800; margin-top: 24px; text-decoration: none; }
.error-code { color: var(--burgundy); font-family: Georgia, serif; font-size: 64px; font-weight: 800; }

/* Admin */
.admin-body { background: #f3eee7; }
.admin-header { align-items: center; background: var(--deep); color: #fff; display: flex; justify-content: space-between; min-height: 76px; padding: 14px max(24px, calc((100% - 1320px) / 2)); }
.admin-header > div { align-items: center; display: flex; gap: 18px; }
.admin-header .wordmark { color: var(--cream); }
.admin-header > div > span { border-right: 1px solid rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.63); font-size: 11px; padding-right: 18px; }
.admin-header nav { align-items: center; display: flex; gap: 6px; }
.admin-header nav a, .admin-header nav button { background: transparent; border: 0; border-radius: 9px; color: rgba(255, 255, 255, 0.78); font-size: 12px; font-weight: 800; padding: 9px 11px; text-decoration: none; }
.admin-header nav a:hover, .admin-header nav button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.admin-header nav form { margin: 0; }
.admin-main { margin: 0 auto; max-width: 1320px; padding: 42px 24px 60px; }
.admin-title { align-items: flex-end; display: flex; justify-content: space-between; margin-bottom: 27px; }
.admin-title h1 { font-size: 43px; letter-spacing: -0.04em; margin: 8px 0 5px; }
.admin-title p { color: var(--muted); margin: 0; }
.stats-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); margin-bottom: 20px; }
.stats-grid article { background: var(--paper); border: 1px solid var(--line); border-radius: 21px; box-shadow: var(--soft-shadow); display: grid; gap: 6px; padding: 21px 24px; position: relative; }
.stats-grid article::before { background: var(--gold); border-radius: 0 3px 3px 0; content: ""; inset: 20px 0 20px auto; position: absolute; width: 3px; }
.stats-grid span { color: var(--muted); font-size: 12px; font-weight: 700; }
.stats-grid strong { color: var(--green); font-size: 38px; line-height: 1; }
.stats-grid i { color: var(--burgundy); font-size: 10px; font-style: normal; font-weight: 900; position: absolute; left: 23px; top: 23px; }
.guests-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 23px; box-shadow: var(--soft-shadow); overflow: hidden; }
.table-tools { align-items: end; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: 1fr 200px auto; padding: 18px; }
.table-tools label { color: var(--muted); display: grid; font-size: 10px; font-weight: 800; gap: 6px; }
.table-tools input, .table-tools select { min-height: 43px; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; min-width: 960px; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 15px 17px; text-align: right; vertical-align: middle; }
th { background: rgba(11, 63, 57, 0.035); color: var(--muted); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; }
td { font-size: 13px; }
td strong { display: block; }
td small { color: var(--muted); display: block; font-size: 10px; margin-top: 4px; }
td a { text-decoration: none; }
.row-number { color: var(--muted); font-size: 11px; }
.table-status { border-radius: 999px; display: inline-flex; font-size: 10px; font-weight: 900; padding: 6px 9px; }
.table-status.entered { background: #dff1e8; color: #1e6b4d; }
.table-status.registered { background: #f4e8d6; color: #8a5b24; }
.icon-link, .inline-checkin button { background: #fff; border: 1px solid var(--line); border-radius: 9px; color: var(--green); display: inline-flex; font-size: 10px; font-weight: 900; margin-left: 5px; min-height: 31px; padding: 7px 9px; }
.inline-checkin { display: inline; }
.inline-checkin button { background: var(--green); color: #fff; }
.empty-state { color: var(--muted); display: grid; gap: 7px; padding: 55px; text-align: center; }
.empty-state strong { color: var(--green); font-size: 18px; }

/* Scanner */
.scanner-body { background: var(--deep); color: #fff; min-height: 100vh; }
.scanner-body .admin-header { border-bottom: 1px solid rgba(255, 255, 255, 0.09); }
.scanner-main { margin: 0 auto; max-width: 1240px; padding: 40px 24px 60px; }
.scanner-copy h1 { font-size: 44px; margin: 8px 0; }
.scanner-copy p { color: rgba(255, 255, 255, 0.63); margin: 0 0 27px; }
.scanner-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr); }
.camera-card, .scan-result, .manual-scan { background: rgba(255, 255, 255, 0.055); border: 1px solid rgba(245, 222, 197, 0.15); border-radius: 23px; padding: 16px; }
.camera-stage { aspect-ratio: 16 / 10; background: #020c0b; border-radius: 17px; overflow: hidden; position: relative; }
.camera-stage video { height: 100%; object-fit: cover; width: 100%; }
.camera-placeholder { align-items: center; background: radial-gradient(circle at 50% 30%, #174b44, #041513 70%); display: flex; flex-direction: column; inset: 0; justify-content: center; position: absolute; }
.camera-placeholder b { color: var(--cream); font-size: 44px; }
.camera-placeholder strong { font-size: 19px; margin: 11px 0 5px; }
.camera-placeholder span { color: rgba(255, 255, 255, 0.55); font-size: 12px; }
.camera-stage.live .camera-placeholder { display: none; }
.scan-frame { inset: 19%; pointer-events: none; position: absolute; }
.scan-frame i { border-color: var(--cream); border-style: solid; height: 54px; position: absolute; width: 54px; }
.scan-frame i:nth-child(1) { border-radius: 13px 0 0; border-width: 4px 0 0 4px; left: 0; top: 0; }
.scan-frame i:nth-child(2) { border-radius: 0 13px 0 0; border-width: 4px 4px 0 0; right: 0; top: 0; }
.scan-frame i:nth-child(3) { border-radius: 0 0 0 13px; border-width: 0 0 4px 4px; bottom: 0; left: 0; }
.scan-frame i:nth-child(4) { border-radius: 0 0 13px; border-width: 0 4px 4px 0; bottom: 0; right: 0; }
.scan-frame span { animation: scan 2.1s infinite ease-in-out; background: linear-gradient(90deg, transparent, var(--burgundy), transparent); box-shadow: 0 0 16px rgba(142, 28, 43, 0.8); height: 2px; left: 7%; position: absolute; right: 7%; top: 12%; }
@keyframes scan { 50% { top: 88%; } }
.camera-actions { display: flex; gap: 9px; margin-top: 13px; }
.scanner-body .secondary-button { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.15); color: #fff; }
.scanner-body button:disabled { cursor: not-allowed; opacity: 0.42; }
.scan-result { align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 300px; text-align: center; }
.result-icon { align-items: center; border: 1px solid rgba(245, 222, 197, 0.22); border-radius: 50%; color: var(--cream); display: flex; font-size: 43px; height: 86px; justify-content: center; width: 86px; }
.scan-result h2 { font-size: 28px; margin: 16px 0 7px; }
.scan-result p { color: rgba(255, 255, 255, 0.6); margin: 0; }
.scan-result.success { background: rgba(36, 125, 89, 0.21); border-color: rgba(80, 191, 139, 0.4); }
.scan-result.warning { background: rgba(142, 28, 43, 0.24); border-color: rgba(216, 84, 100, 0.38); }
.result-meta { border-top: 1px solid rgba(255, 255, 255, 0.12); display: grid; gap: 8px; margin-top: 17px; padding-top: 15px; width: 100%; }
.result-meta span { color: rgba(255, 255, 255, 0.68); font-size: 12px; }
.manual-scan { margin-top: 18px; }
.manual-scan h2 { font-size: 17px; margin: 2px 0 13px; }
.manual-scan form { display: flex; gap: 10px; }
.manual-scan input { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); color: #fff; }

/* Public gate pass */
.gate-body { background: radial-gradient(circle at 50% 0, #16594f, var(--deep) 52%); padding: 25px; }
.gate-page { align-items: center; display: flex; justify-content: center; min-height: calc(100vh - 50px); }
.gate-card { background: var(--paper); border-radius: 27px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34); color: var(--ink); max-width: 560px; padding: 39px; text-align: center; width: 100%; }
.gate-icon { align-items: center; background: var(--green); border-radius: 50%; color: #fff; display: flex; font-size: 34px; height: 76px; justify-content: center; margin: 0 auto 17px; width: 76px; }
.gate-card.entered .gate-icon { background: var(--success); }
.gate-card h1 { font-size: 39px; margin: 9px 0; }
.gate-card > p { color: var(--muted); }
.guest-details { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); margin: 24px 0; text-align: right; }
.guest-details div { display: flex; gap: 20px; justify-content: space-between; padding: 12px 0; }
.guest-details div + div { border-top: 1px solid var(--line); }
.guest-details span { color: var(--muted); font-size: 12px; }
.guest-details strong { font-size: 12px; }
.gate-card form .primary-button { width: 100%; }
.gate-help { font-size: 12px; }

@media (max-width: 1080px) {
  .registration-shell { grid-template-columns: minmax(350px, 0.85fr) minmax(480px, 1.15fr); }
  .poster-panel { padding: 28px; }
  .poster-frame { width: 86%; }
  .poster-copy { bottom: 35px; left: 35px; }
  .form-panel { padding: 44px; }
  .ticket-stage { grid-template-columns: minmax(430px, 1fr) 360px; }
}

@media (max-width: 820px) {
  .registration-shell { display: block; }
  .poster-panel { min-height: auto; padding: 24px; position: relative; }
  .poster-frame { max-width: 460px; width: 76%; }
  .poster-copy { display: none; }
  .form-panel { min-height: auto; padding: 38px 24px 55px; }
  .form-header { margin-bottom: 30px; }
  .ticket-stage { display: block; max-width: 620px; }
  .ticket-card { border-radius: 28px; padding: 30px; }
  .ticket-poster { display: none; }
  .admin-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .admin-header nav { flex-wrap: wrap; }
  .admin-header > div > span { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .scanner-grid { grid-template-columns: 1fr; }
  .table-tools { grid-template-columns: 1fr 1fr; }
  .table-tools .secondary-button { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .poster-panel { padding: 16px; }
  .poster-frame { border-radius: 24px; width: 100%; }
  .form-panel { padding: 28px 18px 45px; }
  .form-header { margin-bottom: 25px; }
  .secure-chip { display: none; }
  .registration-form { grid-template-columns: 1fr; }
  .field.full, .registration-form .full { grid-column: 1; }
  .event-facts { grid-template-columns: 1fr; }
  .form-intro h2 { font-size: 39px; }
  .ticket-body { padding: 12px; }
  .ticket-card { padding: 24px 18px; }
  .ticket-actions { flex-direction: column; }
  .ticket-brand .wordmark { font-size: 23px; }
  .auth-body { padding: 16px; }
  .auth-card { padding: 30px 23px; }
  .admin-main, .scanner-main { padding-inline: 14px; }
  .admin-title { align-items: stretch; flex-direction: column; gap: 15px; }
  .admin-title h1, .scanner-copy h1 { font-size: 36px; }
  .table-tools { grid-template-columns: 1fr; }
  .table-tools .secondary-button { grid-column: auto; }
  .manual-scan form { flex-direction: column; }
  .gate-body { padding: 12px; }
  .gate-card { padding: 30px 20px; }
}

@media print {
  body { background: #fff !important; padding: 0 !important; }
  .ticket-page { min-height: auto; }
  .ticket-stage { display: block; max-width: 650px; }
  .ticket-card { border: 1px solid #ddd; border-radius: 20px; box-shadow: none; }
  .ticket-poster, .ticket-actions { display: none; }
}
