/* BCR Registration — page layout. Uses tokens.css + bcr.css; no raw colours here. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; }
body.is-admin { background: var(--surface-sunken); }

h1, h2, h3 { font-family: var(--font-display); color: var(--ink-strong); margin: 0; }
h1 { font-size: 35px; line-height: 1.2; font-weight: 700; }
h2 { font-size: 25px; line-height: 1.3; font-weight: 700; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
a { color: var(--orange-text); text-underline-offset: 3px; }
a:hover { color: var(--blue); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95em; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1px 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-4); top: -100px; z-index: 10; background: var(--orange); color: var(--on-orange); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); }
.skip-link:focus { top: var(--space-2); }

/* Shell */
.bcr-header { position: sticky; top: 0; z-index: 5; }
.bcr-header__brand { display: flex; align-items: center; gap: var(--space-3); color: var(--white); text-decoration: none; }
.bcr-header__brand:hover { color: var(--white); }
.bcr-header__app { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--white); border-left: 1px solid var(--slate); padding-left: var(--space-3); }
.bcr-header__nav form { display: contents; }
.bcr-header__nav button { background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font: inherit; color: var(--white); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: var(--space-2) 0; }
.bcr-header__nav button:hover { color: var(--orange); }
.site-main { flex: 1; width: 100%; margin: 0 auto; padding: var(--space-12) var(--space-6) var(--space-15); }
.site-main--narrow { max-width: calc(var(--container-narrow) + 2 * var(--space-6)); }
.site-main--wide { max-width: calc(var(--container) + 2 * var(--space-6)); }
.site-footer { background: var(--black); color: var(--white); font-size: 14px; padding: var(--space-6); }
.site-footer__inner { max-width: var(--container); margin: 0 auto; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); justify-content: space-between; align-items: center; }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--orange); }

/* Page head */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-8); }
.page-head__text { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.page-head__eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
.page-head__eyebrow a { color: var(--orange-text); text-decoration: none; }
.page-head__eyebrow a:hover { color: var(--blue); text-decoration: underline; }
.page-head__lede { color: var(--ink-muted); max-width: 60ch; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.page-head h1.display { font-size: 45px; line-height: 1.15; font-weight: 800; }

/* Event tabs (admin, per-event pages) */
.tabs { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); border-bottom: 1px solid var(--border-control); margin: calc(-1 * var(--space-4)) 0 var(--space-8); }
.tabs a { color: var(--slate); text-decoration: none; font-size: 14px; font-weight: 600; padding: var(--space-3) 0; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); border-bottom-color: var(--border-control); }
.tabs a[aria-current="page"] { color: var(--ink-strong); border-bottom-color: var(--orange); }

/* Content blocks */
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--lg { gap: var(--space-8); }
.form-section { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-8); margin-top: var(--space-8); border-top: 1px solid var(--border); }
.form-section > h2 { margin-bottom: var(--space-1); }
.form-section-title { padding-top: var(--space-4); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-8); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.bcr-card > .stack > h2, .bcr-card > h2 { font-size: 20px; }
.section { margin-top: var(--space-12); }
.bcr-table .is-nowrap { white-space: nowrap; }
.section-title { margin-bottom: var(--space-4); }
.inline-form { display: inline; margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); white-space: nowrap; min-width: 16rem; }
.row-actions .bcr-btn--link { min-height: 0; padding: 0; font-size: 14px; }
.bcr-btn--link.is-danger { color: var(--danger); }
.bcr-btn--link.is-danger:hover { color: var(--danger); }
.empty { text-align: center; padding: var(--space-12) var(--space-6); color: var(--ink-muted); }
.empty p + p { margin-top: var(--space-2); }
.price { font-family: var(--font-display); font-weight: 700; }
.muted { color: var(--ink-muted); }
.form-card { max-width: var(--container-narrow); }
.form-card .form-actions { margin-top: var(--space-4); }
.reorder-error { margin-bottom: var(--space-4); }
.reorder-error:empty { display: none; }
.alert-list { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-6); }

/* Public landing: event cards */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-6); list-style: none; margin: 0; padding: 0; }
.event-grid .bcr-card { display: flex; flex-direction: column; height: 100%; }
.event-grid .bcr-card__body { flex: 1; }
.event-grid .bcr-card__title a { color: inherit; text-decoration: none; }
.event-grid .bcr-card__title a:hover { color: var(--orange-text); }

/* Registration form */
.reg-intro { margin-bottom: var(--space-8); }
.reg-intro p { color: var(--ink); white-space: pre-line; }
.form-section-desc { color: var(--ink-muted); max-width: 70ch; margin-top: var(--space-2); }
.bcr-field__help { color: var(--ink-muted); font-size: 14px; margin: var(--space-1) 0 var(--space-2); }
#square-card-container:not(:empty) { margin-top: var(--space-2); }
#square-card-error:empty { display: none; }
.discount-code-row { display: flex; gap: var(--space-2); align-items: center; }
.discount-code-row .bcr-input { flex: 1; }

/* Form builder: per-option rows */
.option-editor__rows { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.option-row { display: flex; gap: var(--space-2); align-items: center; }
.option-row__text { flex: 1; }
.option-row__branch { flex: 1; max-width: 220px; }
.option-row__quantity { flex: 0 0 auto; width: 4.5em; max-width: 4.5em; text-align: center; }
.option-row__remove { font-size: 18px; line-height: 1; padding: 0 var(--space-2); color: var(--danger); }
.option-editor__branch-toggle { margin-top: var(--space-2); }
.option-editor__quantity-toggle { margin-top: var(--space-2); }

/* Form builder: conditional-reveal editor */
.conditional-editor { margin-top: var(--space-2); }
.conditional-editor__body { margin-top: var(--space-2); display: flex; flex-direction: column; gap: var(--space-2); }
.conditional-editor__value-rows { display: flex; flex-direction: column; gap: var(--space-1); }

/* Auth */
.auth { max-width: 400px; margin: 0 auto; }
.auth .bcr-card { padding: var(--space-8); }
.auth__mark { width: 64px; height: 64px; display: block; margin-bottom: var(--space-4); }

/* Form builder */
.field-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.field-item { display: grid; grid-template-columns: auto auto auto 1fr; gap: var(--space-3); align-items: start; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow-card); }
.field-item:hover { box-shadow: var(--shadow-raised); }
.field-item__handle { cursor: grab; color: var(--ink-muted); padding-top: 2px; user-select: none; font-size: 18px; line-height: 1; }
.field-item__select { padding-top: 2px; }
.field-item__number { color: var(--ink-muted); font-size: 13px; font-weight: 600; padding-top: 3px; min-width: 1.5em; }
.bulk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); padding: var(--space-3); background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-md); }
.bulk-toolbar[hidden] { display: none; }
#bulk-move-controls[hidden] { display: none; }
#bulk-toolbar-count { font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.field-item__summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.field-item__label { font-weight: 600; color: var(--ink-strong); }
.field-item__meta { font-size: 14px; color: var(--ink-muted); }
.field-item details { margin-top: var(--space-2); }
.field-item summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--orange-text); width: max-content; }
.field-item__edit { margin-top: var(--space-4); }
.field-item__footer { display: flex; justify-content: flex-end; margin-top: var(--space-2); }
.field-item.is-section { background: var(--surface-sunken); }
.field-item.is-page-break { background: var(--surface-sunken); border-top: 2px dashed var(--border-control); }

@media (max-width: 720px) {
  .bcr-header { flex-wrap: wrap; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
  .bcr-header__nav { margin-left: 0; width: 100%; overflow-x: auto; gap: var(--space-4); }
  .bcr-header__app { display: none; }
  .site-main { padding: var(--space-8) var(--space-4) var(--space-12); }
  h1, .page-head h1.display { font-size: 30px; }
}
