:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #2a2a2a;
  --muted: #6b6b6b;
  --accent: #7a4a2b;
  --accent-dark: #5a3520;
  --border: #e3ddd1;
  --good: #2e7d32;
  --bad: #b00020;
  --warn: #b97a00;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* Optional full-page background image.
   Drop a JPG or PNG at  public/background.jpg  to use it.
   The gradient sits on top of the image to dim it so the cards stay readable.
   Adjust the alpha (0.85) — higher = more dimmed, lower = more visible image.
   If the file is missing, the gradient still renders flat cream — no broken image. */
body {
  background-image:
    linear-gradient(rgba(246, 245, 241, 0.72), rgba(246, 245, 241, 0.72)),
    url('/background.png');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
}

a { color: var(--accent); }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.container.wide {
  max-width: 1100px;
}

header.page-header {
  text-align: center;
  margin-bottom: 24px;
}

header.page-header h1 {
  margin: 0 0 4px;
  font-size: 28px;
  color: var(--accent-dark);
}

header.page-header p {
  margin: 4px 0;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--accent-dark);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}

.field-help {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 540px) {
  .row { grid-template-columns: 1fr; }
}

.tickets {
  display: grid;
  gap: 10px;
}

.ticket-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #faf8f3;
}

.ticket-row .label {
  font-weight: 600;
}

.ticket-row .price {
  color: var(--muted);
  font-size: 14px;
}

.ticket-row input[type="number"] {
  width: 80px;
}

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

.checkbox-row input[type="checkbox"] {
  transform: scale(1.2);
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn.secondary {
  background: #efe9dd;
  color: var(--accent-dark);
}
.btn.secondary:hover { background: #e3dac5; }

.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #8a0017; }

.btn.small { padding: 6px 10px; font-size: 13px; }

.total-line {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 18px;
  margin-top: 8px;
}

.error {
  color: var(--bad);
  margin: 8px 0;
}

.success-banner {
  background: #eaf5ea;
  border: 1px solid #b9deb9;
  color: var(--good);
  padding: 14px 16px;
  border-radius: 10px;
}

.code-pill {
  display: inline-block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  background: #fff7e6;
  border: 1px solid #f0d28d;
  color: #6a4500;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 1px;
}

.summary-pre {
  white-space: pre-wrap;
  background: #faf8f3;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
}

table.regs {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
}

table.regs th, table.regs td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
}

table.regs th {
  background: #efe9dd;
  color: var(--accent-dark);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

table.regs tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.pending { background: #fff1d6; color: var(--warn); }
.badge.confirmed { background: #e6f4ea; color: var(--good); }

.muted { color: var(--muted); font-size: 13px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

table.bank-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 14px;
}
table.bank-table th, table.bank-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.bank-table th {
  font-weight: 600;
  color: var(--accent-dark);
  width: 40%;
  background: #faf8f3;
}
table.bank-table tr:last-child th, table.bank-table tr:last-child td {
  border-bottom: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) {
  .summary-grid { grid-template-columns: 1fr; }
}

.count-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.count-list li {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.count-list li:last-child { border-bottom: none; }
.count-list .pill {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  background: #efe9dd;
  color: var(--accent-dark);
  border-radius: 10px;
  padding: 1px 8px;
  font-weight: 700;
  font-size: 13px;
}
.count-list .pill.zero {
  background: #f3e6e6;
  color: #8a3a3a;
}
