/* DreamCoder billing: the pricing page's night-to-dawn palette, calm and plain. */
:root {
  --night: #0c1133;
  --ink: #050717;
  --plum: #3a1546;
  --moonlight: #fff6e9;
  --gold: #ffd86b;
  --gold-deep: #e0ad28;
  --rose: #ffc8b8;
  --text: rgba(255, 238, 230, 0.82);
  --text-quiet: rgba(255, 238, 230, 0.6);
  --hairline: rgba(255, 200, 184, 0.16);
  --hairline-strong: rgba(255, 200, 184, 0.34);
  --field: rgba(5, 7, 23, 0.55);
  --ok: #a8e6c1;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  background: linear-gradient(180deg, var(--night) 0%, #1f1140 55%, var(--plum) 100%);
  overflow-wrap: anywhere;
}
h1, h2, h3, p, ul, dl, dd, fieldset { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--rose); text-underline-offset: 0.18em; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
strong { font-weight: 500; color: var(--moonlight); }

.skip { position: absolute; left: var(--gutter); top: -4rem; padding: 0.5rem 1rem; background: var(--gold); color: var(--night); border-radius: 999px; z-index: 10; }
.skip:focus { top: 0.75rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  width: 100%; max-width: 72rem; margin: 0 auto; padding: 1.25rem var(--gutter);
}
.brand { display: flex; align-items: center; gap: 0.625rem; text-decoration: none; }
.brand span { font: 400 1.125rem var(--serif); letter-spacing: 0.02em; color: #fff4c2; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; font-size: 0.875rem; }
.who-org { color: var(--moonlight); font-weight: 500; }
.who-email { color: var(--text-quiet); }
.link-button { font: inherit; color: var(--rose); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.link-button:hover { color: var(--gold); }
.wrap { flex: 1; width: 100%; max-width: 72rem; margin: 0 auto; padding: 1rem var(--gutter) 4rem; display: flex; flex-direction: column; gap: 1.5rem; }
.foot { padding: 2.5rem var(--gutter) 2rem; text-align: center; font-size: 0.8125rem; color: var(--text-quiet); }

/* ---------- panels and type ---------- */
.panel {
  border: 1px solid var(--hairline);
  border-radius: 1.25rem;
  background: rgba(14, 10, 42, 0.6);
  padding: clamp(1.25rem, 4vw, 2.25rem);
  display: flex; flex-direction: column; gap: 1rem;
}
.narrow { width: 100%; max-width: 38rem; margin-inline: auto; }
h1 { font: 400 clamp(1.75rem, 4vw, 2.5rem)/1.15 var(--serif); color: var(--moonlight); text-wrap: balance; }
h2 { font: 400 1.375rem/1.25 var(--serif); color: var(--moonlight); }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.lede { font-size: 1.0625rem; }
.quiet, .hint, .optional { color: var(--text-quiet); }
.hint { font-size: 0.8125rem; }
.optional { font-weight: 300; }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 0.35rem; width: 100%; }
label { font-weight: 600; font-size: 0.9375rem; color: var(--moonlight); }
input[type="text"], input[type="email"], input[type="number"], input[type="password"], select, .card-input {
  width: 100%; min-height: 2.875rem; padding: 0.625rem 0.875rem;
  font: 400 1rem var(--sans); color: var(--moonlight);
  background: var(--field); border: 1px solid var(--hairline-strong); border-radius: 0.75rem;
}
select { appearance: none; padding-right: 2.5rem; background-image: linear-gradient(45deg, transparent 50%, var(--rose) 50%), linear-gradient(135deg, var(--rose) 50%, transparent 50%); background-position: calc(100% - 1.25rem) 50%, calc(100% - 0.9rem) 50%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; }
select option { background: var(--night); color: var(--moonlight); }
input:focus-visible, select:focus-visible, .braintree-hosted-fields-focused { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
input:user-invalid, .braintree-hosted-fields-invalid { border-color: var(--rose); }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 0.35rem; font-weight: 600; font-size: 0.9375rem; color: var(--moonlight); }
.check { display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.75rem; align-items: start; font-weight: 400; color: var(--text); cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--gold); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.75rem; padding: 0.75rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  font: 600 0.9375rem/1.1 var(--sans); letter-spacing: 0.01em; text-decoration: none; text-align: center;
  cursor: pointer; transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
}
.btn-gold { color: #1a1340; background: linear-gradient(180deg, var(--gold) 0%, #f5c842 50%, #d49b1c 100%); box-shadow: 0 3px 0 rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.4); }
.btn-gold:hover { color: #1a1340; transform: translateY(-1px); }
.btn-gold:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-line { color: var(--moonlight); background: transparent; border-color: rgba(255,200,184,0.4); }
.btn-line:hover { color: var(--moonlight); border-color: var(--rose); background: rgba(255,200,184,0.08); }
.btn-quiet { color: var(--text-quiet); background: transparent; border-color: var(--hairline); }
.btn-quiet:hover { color: var(--rose); border-color: var(--hairline-strong); }
.btn-danger { color: var(--rose); background: transparent; border-color: var(--rose); }
.btn-danger:hover { color: var(--night); background: var(--rose); }
.btn-small { min-height: 2.25rem; padding: 0.45rem 0.9rem; font-size: 0.8125rem; }
.btn-wide { width: 100%; padding-block: 1rem; font-size: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ---------- messages ---------- */
.status:empty { display: none; }
.status, .notice, .alert { padding: 0.875rem 1rem; border-radius: 0.875rem; border: 1px solid var(--hairline-strong); background: rgba(255,200,184,0.08); color: var(--moonlight); }
.status-warn, .notice-warn, .alert { border-color: rgba(255,200,184,0.6); background: rgba(255,154,133,0.12); }
.notice { border-color: rgba(168,230,193,0.45); background: rgba(168,230,193,0.08); }
.notice.notice-warn { border-color: rgba(255,200,184,0.6); background: rgba(255,154,133,0.12); }
.alert { display: flex; flex-direction: column; gap: 0.875rem; align-items: flex-start; }
.status.is-ok { border-color: rgba(168,230,193,0.45); background: rgba(168,230,193,0.08); }
.chip { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; border: 1px solid var(--hairline-strong); color: var(--rose); white-space: nowrap; }
.chip-ok { color: var(--ok); border-color: rgba(168,230,193,0.4); }
.chip-warn { color: var(--gold); border-color: rgba(255,216,107,0.4); white-space: normal; }
.chip-quiet { color: var(--text-quiet); }

/* ---------- order page ---------- */
.order { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; }
.order-intro { display: flex; flex-direction: column; gap: 1.25rem; padding-top: 0.5rem; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; color: var(--text); }
.price-figure {
  font: 400 clamp(3.5rem, 9vw, 5.5rem)/0.9 var(--serif); letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff4c2 0%, var(--gold) 48%, var(--gold-deep) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.facts { display: flex; flex-direction: column; gap: 0.75rem; }
.facts li { padding-left: 1.25rem; position: relative; }
.facts li::before { content: ''; position: absolute; left: 0; top: 0.65em; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.order-form { gap: 1.25rem; }
/* Disabled while a payment is in flight, so the order cannot change under it. */
.order-fields { display: flex; flex-direction: column; gap: 1.25rem; }
.order-fields:disabled input, .order-fields:disabled select, .order-fields:disabled .card-input { opacity: 0.6; }
.order-check, .country-check { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }
.country-check p:focus { outline: none; }
.field-seats input { max-width: 8rem; }
#card-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 0.5rem; }
#card-form > .field:first-child, #card-form > .field:last-child { grid-column: 1 / -1; }
#card-form:not(.is-ready) .card-input { background: transparent; border: 1px dashed var(--hairline-strong); }
#card-form:not(.is-ready) label { color: var(--text-quiet); }
#card-form:not(.is-ready) iframe { visibility: hidden; }
.card-input { height: 2.875rem; }
.card-error { color: var(--rose); }
#card-waiting { margin-bottom: 0.75rem; }
/* The page is dark and Braintree's field documents are not: matching their scheme keeps
   the iframes transparent instead of painting them white. */
.card-input iframe { color-scheme: light; }
.quote { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 1rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.quote-lines { display: flex; flex-direction: column; gap: 0.35rem; transition: opacity 150ms; }
.quote.is-pending .quote-lines { opacity: 0.45; }
.quote-lines div { display: flex; justify-content: space-between; gap: 1rem; }
.quote-lines dd { font-variant-numeric: tabular-nums; color: var(--moonlight); white-space: nowrap; }
.quote-total { margin-top: 0.35rem; padding-top: 0.6rem; border-top: 1px dashed var(--hairline); font: 400 1.25rem var(--serif); }
.quote-total dt { color: var(--moonlight); }
.quote-total dd { color: var(--gold); }
.quote-renews, .quote-empty { font-size: 0.875rem; line-height: 1.6; }
.quote-renews { color: var(--rose); }
.quote-note, .quote-empty { color: var(--text-quiet); font-size: 0.875rem; }
.consents { display: flex; flex-direction: column; gap: 0.875rem; }
/* Turnstile's widget: invisible unless it needs a click from the buyer. */
.human-check:empty { display: none; }

/* ---------- admin ---------- */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; }
.count { color: var(--text-quiet); font-size: 0.875rem; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.875rem 0; border-top: 1px solid var(--hairline); }
.row:last-child { border-bottom: 1px solid var(--hairline); }
.row-main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; min-width: 0; }
.row-title { color: var(--moonlight); font-weight: 400; }
a.row-title { color: var(--rose); }
.row-sub { color: var(--text-quiet); font-size: 0.875rem; }
.row-actions, .row-figure { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.row-figure { font-variant-numeric: tabular-nums; color: var(--moonlight); }
.forms-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 0.5rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; padding-top: 1rem; border-top: 1px solid var(--hairline); }
.inline-form .field { flex: 1 1 16rem; }
.inline-form input { max-width: 8rem; }

/* ---------- invitation ---------- */
.choice { padding-top: 1.25rem; border-top: 1px solid var(--hairline); }
.decline { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }

/* ---------- invoice ---------- */
.invoice-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; width: 100%; max-width: 48rem; margin-inline: auto; }
.invoice { width: 100%; max-width: 48rem; margin-inline: auto; gap: 1.5rem; }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.invoice-parties { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.invoice-parties h2, .invoice-meta dt { font: 500 0.75rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-quiet); }
.invoice-meta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
.invoice-meta dd { color: var(--moonlight); }
.invoice-lines { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.9375rem; overflow-wrap: normal; }
.invoice-lines th, .invoice-lines td { padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--hairline); text-align: right; vertical-align: top; }
.invoice-lines th:first-child, .invoice-lines td:first-child { text-align: left; padding-left: 0; }
.invoice-lines td:last-child, .invoice-lines th:last-child { padding-right: 0; }
/* Figures and column names never wrap; the description wraps at its spaces. */
.invoice-lines th:not(:first-child), .invoice-lines td:not(:first-child) { white-space: nowrap; }
.invoice-lines thead th { font-weight: 500; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-quiet); }
.invoice-lines tfoot th { font-weight: 300; }
.invoice-lines td { color: var(--moonlight); }
.invoice-total th, .invoice-total td { font: 400 1.25rem var(--serif); color: var(--gold); border-bottom: 0; }
.invoice-note { font-size: 0.875rem; color: var(--text); padding: 0.75rem 1rem; border-left: 2px solid var(--gold); background: rgba(255,216,107,0.06); }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .forms-2, .invoice-parties { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .wrap { padding-top: 2rem; }
  .order { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 4rem; }
  .order-intro { padding-top: 2.5rem; }
  .order-intro h1 { font-size: 3rem; }
}
@media (max-width: 380px) {
  .invoice-lines { font-size: 0.8125rem; }
  .invoice-lines th, .invoice-lines td { padding-inline: 0.2rem; }
  .invoice-lines thead th { font-size: 0.625rem; letter-spacing: 0.02em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- print: a plain invoice on white paper ---------- */
@media print {
  html, body { background: #fff; color: #111; }
  .top .who, .foot, .invoice-tools, .no-print, .skip { display: none !important; }
  .brand span { color: #111; }
  .panel { border: 0; background: none; padding: 0; }
  h1, h2, strong, .invoice-meta dd, .invoice-lines td, .invoice-parties h2 { color: #111; }
  .invoice-total th, .invoice-total td, .eyebrow { color: #111; }
  .invoice-meta dt { color: #111; }
  .invoice-lines th, .invoice-lines td { border-color: #ccc; }
  .invoice-note { background: none; border-color: #111; color: #111; }
  .chip { color: #111; border-color: #999; }
  a { color: #111; }
}
