:root {
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --border: #e5e5ea;
  --text: #111111;
  --muted: #6e6e73;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  --radius: 22px;
  --primary: #34c759;
  --secondary: #007aff;
  --danger: #ff3b30;
  text-decoration: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page-shell {
  width: min(960px, 100% - 32px);
  margin: 0 auto;
  padding: 40px 0 80px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 40px);
}

.booking-card h1 {
  font-size: clamp(28px, 5vw, 42px);
  margin: 0 0 12px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.6;
}

form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field-grid {
  display: grid;
  gap: 16px;
}

.field-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.people-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.people-block-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.people-block-header h2 {
  margin: 0;
  font-size: 22px;
}

.people-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.person-card {
  background: #f8f8fb;
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.person-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.person-title {
  font-weight: 600;
  font-size: 18px;
}

.icon-button {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.icon-button:hover {
  background: rgba(255, 59, 48, 0.12);
  transform: translateY(-1px);
}

.icon-button[hidden] {
  display: none;
}

.btn {
  border: none;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(52, 199, 89, 0.35);
}

.btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn.secondary {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 122, 255, 0.25);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 600;
}

.total-row span {
  font-size: 20px;
}

.helper-text {
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.helper-text.error {
  color: #b00020;
}

.helper-text.success {
  color: #0a7a30;
}

.message {
  display: none;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
}

.message.show {
  display: block;
}

.message.error {
  background: #ffeceb;
  color: #b00020;
}

.message.success {
  background: #ecfdf3;
  color: #0a7a30;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

/* Admin page */
body.admin-body {
  background: #f0f1f5;
}

.admin-shell .card {
  margin-bottom: 32px;
}

.admin-actions {
  justify-content: flex-end;
}

.admin-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.checkin-row {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.checkin-row h3 {
  margin: 0;
  font-size: 17px;
}

.checkin-meta {
  font-size: 14px;
  color: var(--muted);
}

.admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(52, 199, 89, 0.15);
  color: #1f7d3d;
  font-size: 13px;
  font-weight: 600;
}

#qr-reader {
  width: 100%;
  max-width: 420px;
  margin: 12px auto;
  border-radius: 16px;
  overflow: hidden;
}

.scanner-block {
  align-items: center;
}

.scanner-block .button-row {
  width: 100%;
  justify-content: center;
}

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

/* Success & cancel pages */
.status-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 24px;
}

.status-card {
  max-width: 480px;
  text-align: center;
}

.status-card h1 {
  margin-bottom: 10px;
}

.status-card p {
  color: var(--muted);
  margin: 0 0 24px;
}

.status-card.success {
  border-top: 6px solid var(--primary);
}

.status-card.cancel {
  border-top: 6px solid var(--danger);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  text-align: center;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}

.login-card .message {
  text-align: left;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 640px) {
  .card {
    padding: 24px;
  }

  .button-row {
    flex-direction: column;
  }

  .people-block-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
