/* ---------------------------------------------------------------------------
   Zero Project Asia Pacific Symposium 2026 — public styles

   Colour decisions are contrast-driven, not brand-driven:
   the Zero Project green #009640 measures 3.86:1 on white, which fails WCAG AA
   for body text (4.5:1). It is therefore used only for large graphics, while
   #00662c (7.15:1) carries every piece of text, link and button.
   --------------------------------------------------------------------------- */

:root {
  --brand:        #009640;  /* large graphics only — fails AA at body size */
  --brand-text:   #00662c;  /* 7.15:1 on white */
  --brand-dark:   #00501f;  /* hover/active */
  --ink:          #1a1a1a;  /* 17.4:1 */
  --ink-muted:    #4a4a4a;  /* 8.86:1 */
  --line:         #767676;  /* 4.54:1 — exceeds the 3:1 needed for controls */
  --line-soft:    #d4d8d6;
  --error:        #b00020;  /* 7.33:1 */
  --error-bg:     #fdf2f4;
  --bg:           #ffffff;
  --bg-subtle:    #f4f6f5;
  --focus-ring:   #ffdd00;

  --radius: 4px;
  --gap: 1.5rem;
  --measure: 42rem;         /* ~66 characters — comfortable reading width */
}

/* --------------------------------------------------------------------------- */
/* Reset & base                                                                 */
/* --------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  /* Never set a px font-size here — it breaks the user's browser text setting. */
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

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

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.375rem; }
p  { margin: 0 0 1rem; }

a { color: var(--brand-text); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); text-decoration-thickness: 2px; }

/* --------------------------------------------------------------------------- */
/* Focus — a single, unmistakable indicator on every interactive element.        */
/* Never remove this. Keyboard users navigate the entire form through it.        */
/* --------------------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid transparent;       /* placeholder for forced-colors mode */
  outline-offset: 0;
  box-shadow: 0 0 0 3px var(--focus-ring), 0 0 0 6px var(--ink);
  border-radius: 2px;
}

/* Older engines without :focus-visible still get a ring. */
:focus:not(:focus-visible) { box-shadow: none; }

@media (forced-colors: active) {
  :focus-visible { outline: 3px solid Highlight; box-shadow: none; }
}

/* --------------------------------------------------------------------------- */
/* Utilities                                                                    */
/* --------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--focus-ring);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
  box-shadow: 0 0 0 3px var(--ink);
}

/* --------------------------------------------------------------------------- */
/* Banner                                                                       */
/* --------------------------------------------------------------------------- */

.banner { background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.banner__image { display: block; width: 100%; height: auto; }

/* Only shown where the artwork's own text becomes too small to read. */
.banner__strapline { display: none; }
@media (max-width: 40em) {
  .banner__strapline {
    display: block;
    margin: 0;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    color: var(--ink-muted);
    border-top: 1px solid var(--line-soft);
  }
}

.banner__fallback { display: flex; align-items: stretch; min-height: 8rem; }
.banner__mark { width: 3rem; background: var(--brand); flex: none; }
.banner__text { padding: 1.5rem 1.25rem; }
.banner__title    { font-size: 1.75rem; font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.banner__subtitle { font-size: 1.5rem;  font-weight: 700; margin: 0; color: var(--brand-text); }
.banner__collab   { margin: 0.75rem 0 0; font-size: 0.9375rem; color: var(--ink-muted); }

/* --------------------------------------------------------------------------- */
/* Layout                                                                       */
/* --------------------------------------------------------------------------- */

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.page:focus { outline: none; }   /* programmatic target of the skip link */

.intro { margin-bottom: 2.5rem; }
.intro__meta { color: var(--ink-muted); font-weight: 600; }

.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-muted);
  font-size: 0.9375rem;
}
.site-footer__meta { margin-bottom: 0; }

/* --------------------------------------------------------------------------- */
/* Sections                                                                     */
/* --------------------------------------------------------------------------- */

/* Sections are <section> + <h2>, not <fieldset> + <legend>: a legend is
   re-announced before every field inside it, which would make a screen reader
   repeat "Personal details" 4 times in this form. <fieldset> is reserved for
   the one place it earns its keep — the accessibility checkbox group. */
.section {
  border-top: 4px solid var(--brand);
  background: var(--bg-subtle);
  margin: 0 0 2rem;
  padding: 1.5rem 1.25rem 0.5rem;
}
.section__heading { margin: 0 0 1rem; }
.section__note { color: var(--ink-muted); margin-top: -0.5rem; }

/* --------------------------------------------------------------------------- */
/* Fields                                                                       */
/* --------------------------------------------------------------------------- */

.field { margin: 0 0 var(--gap); }

.label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
legend.label { padding: 0; }

.optional { font-weight: 400; color: var(--ink-muted); }
/* The required asterisk: brand red-brown, at least 4.5:1 on white, and bold so
   it is not lost beside the label at small sizes. */
.req { font-weight: 700; color: #a4001f; margin-left: 0.125rem; }

.hint {
  margin: 0 0 0.5rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.counter {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.counter--over { color: var(--error); font-weight: 700; }

.input, .select {
  display: block;
  width: 100%;
  min-height: 2.75rem;               /* 44px touch target */
  padding: 0.5rem 0.625rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}
.select {
  /* Keep the platform arrow — a custom one is one more thing to get wrong. */
  padding-right: 2rem;
}
.input--error, .select--error { border-color: var(--error); border-width: 2px; }

/* Error styling never relies on colour alone: there is a left bar, a bold
   label, the word "Error:" for screen readers, and the summary at the top. */
.field--error {
  padding-left: 0.9375rem;
  border-left: 4px solid var(--error);
}
.error-message {
  margin: 0 0 0.5rem;
  color: var(--error);
  font-weight: 700;
}

/* --------------------------------------------------------------------------- */
/* Choices (checkbox groups and consent statements)                             */
/* --------------------------------------------------------------------------- */

.fieldset-inner { border: 0; padding: 0; margin: 0; min-width: 0; }

.choices { margin-top: 0.5rem; }

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  min-height: 2.75rem;
}
.choice label {
  cursor: pointer;
  padding-top: 0.125rem;
}
.checkbox {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.125rem 0 0;
  accent-color: var(--brand-text);
  cursor: pointer;
}
.choice--consent {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 0.875rem;
  margin-bottom: 0.25rem;
}

/* --------------------------------------------------------------------------- */
/* Conditional reveal                                                           */
/* --------------------------------------------------------------------------- */

/* Hidden only when JavaScript is running. With JS off every conditional field
   stays visible and simply reads as an extra optional question. */
.js .reveal[data-hidden="true"] { display: none; }

.reveal {
  border-left: 4px solid var(--line-soft);
  padding-left: 0.9375rem;
  margin-bottom: var(--gap);
}

/* --------------------------------------------------------------------------- */
/* Error summary                                                                */
/* --------------------------------------------------------------------------- */

.error-summary {
  border: 4px solid var(--error);
  background: var(--error-bg);
  padding: 1.25rem;
  margin-bottom: 2rem;
}
.error-summary:focus { outline: none; box-shadow: 0 0 0 3px var(--focus-ring), 0 0 0 6px var(--ink); }
.error-summary__title { margin-top: 0; color: var(--error); }
.error-summary__list { margin: 0; padding-left: 1.25rem; }
.error-summary__list li { margin-bottom: 0.5rem; }
.error-summary__list a { color: var(--error); font-weight: 700; }

/* --------------------------------------------------------------------------- */
/* Actions                                                                      */
/* --------------------------------------------------------------------------- */

.actions { margin-top: 2.5rem; }

.button {
  display: inline-block;
  min-height: 3rem;
  padding: 0.75rem 1.75rem;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #fff;                       /* 7.15:1 on --brand-text */
  background: var(--brand-text);
  border: 2px solid var(--brand-text);
  border-radius: var(--radius);
  cursor: pointer;
}
.button:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.button[disabled] { opacity: 0.65; cursor: not-allowed; }

.actions__note { margin-top: 0.75rem; color: var(--ink-muted); font-size: 0.9375rem; }

/* --------------------------------------------------------------------------- */
/* Confirmation page                                                            */
/* --------------------------------------------------------------------------- */

.confirmation { border-top: 4px solid var(--brand); background: var(--bg-subtle); padding: 1.5rem 1.25rem; }
.reference {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--brand-text);
  word-break: break-all;
}
.summary-list { margin: 0; }
.summary-list div { padding: 0.625rem 0; border-bottom: 1px solid var(--line-soft); }
.summary-list dt { font-weight: 700; }
.summary-list dd { margin: 0.125rem 0 0; }
.plain-list { margin: 0; padding-left: 1.125rem; }
.plain-list li { margin-bottom: 0.25rem; }

/* --------------------------------------------------------------------------- */
/* Responsive & motion                                                          */
/* --------------------------------------------------------------------------- */

@media (min-width: 40em) {
  .page, .site-footer { padding-left: 2rem; padding-right: 2rem; }
  .section { padding: 1.75rem 1.75rem 0.75rem; }
  .summary-list div { display: grid; grid-template-columns: 15rem 1fr; gap: 1rem; }
  .summary-list dd { margin: 0; }
}

/* At 320px and at 200% zoom nothing may scroll sideways. */
@media (max-width: 22.5em) {
  body { font-size: 1rem; }
  h1 { font-size: 1.5rem; }
  .banner__mark { width: 1.5rem; }
  .banner__title { font-size: 1.375rem; }
  .banner__subtitle { font-size: 1.125rem; }
}

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

/* ---------------------------------------------------------------------------
   Confirm attendance
   --------------------------------------------------------------------------- */

/* The one action on the page, so it is given room rather than being wedged
   between the details list above it and the small print below. */
.confirm-action {
  margin: 1.75rem 0 1rem;
}

/* A comfortable target for a thumb, and for anybody whose pointing is not
   precise. WCAG 2.1 asks for 44px; this is larger, because the page exists to
   be tapped once from a phone. */
.confirm-action .button {
  font-size: 1.0625rem;
  padding: 0.9rem 1.75rem;
  min-height: 3rem;
}

.confirm-note {
  margin-top: 1rem;
}
