/* ==========================================================================
   Weymouth Padel — coming soon
   Palette is the design's OKLCH set. Four values were darkened from the
   original comp to clear WCAG AA, noted inline with their measured ratios.
   ========================================================================== */

:root {
  --bg: #f6f1ea;
  --ink: oklch(0.28 0.06 14);

  --maroon: oklch(0.38 0.13 12);
  --maroon-dark: oklch(0.34 0.12 12);
  --maroon-hover: oklch(0.47 0.15 16);
  --maroon-active: oklch(0.32 0.12 12);
  --rule: oklch(0.38 0.13 12 / 0.3);

  --blue: oklch(0.7 0.12 235);
  --blue-dot: oklch(0.72 0.12 235);
  --focus: oklch(0.55 0.13 235);
  --blue-soft-bg: oklch(0.93 0.03 235);
  --blue-heading: oklch(0.44 0.11 240);
  --faq-sign: oklch(0.5 0.13 240);        /* was 0.55 — 4.22 fail, now 5.26 */

  --cream: oklch(0.97 0.012 80);
  --panel-bg: oklch(0.98 0.008 80);
  --input-bg: oklch(0.99 0.006 80);
  --input-border: oklch(0.66 0.02 40);    /* was 0.78 — 1.96 fail, now 3.04 */
  --placeholder: oklch(0.52 0.02 40);     /* was 0.58 — 4.19 fail, now 5.39 */

  --eyebrow: oklch(0.5 0.04 30);
  --subtitle: oklch(0.4 0.04 24);
  --panel-text: oklch(0.44 0.03 30);
  --faq-answer: oklch(0.45 0.03 30);
  --footer: oklch(0.5 0.04 30);           /* was 0.58 — 3.86 fail, now 5.44 */
  --confirmation-text: oklch(0.32 0.06 20);
  --faq-question: oklch(0.32 0.09 14);

  --error: oklch(0.45 0.17 27);
  --error-border: oklch(0.55 0.19 27);
  --error-bg: oklch(0.96 0.02 27);

  --link: oklch(0.42 0.13 12);
  --link-hover: oklch(0.52 0.16 20);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Archivo', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
}

a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
input, button { font-family: inherit; }
input::placeholder { color: var(--placeholder); opacity: 1; }

/* Visible focus for keyboard users on every interactive element. */
:where(a, button, input, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute;
  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;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 10;
  padding: 10px 18px;
  background: var(--maroon);
  color: var(--cream);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: transform 0.15s ease;
}
.skip-link:focus {
  transform: translate(-50%, 0);
  color: var(--cream);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.stripe {
  width: 100%;
  height: 10px;
  background: repeating-linear-gradient(90deg, var(--maroon) 0 22px, var(--blue) 22px 44px);
  flex: none;
}

.page {
  width: 100%;
  max-width: 720px;
  padding: 32px 28px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
}

.eyebrow {
  margin: 0;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--eyebrow);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  background: var(--maroon);
  color: var(--cream);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-dot);
  flex: none;
}

.headline {
  margin: 0;
  font-weight: 800;
  font-size: clamp(30px, 9.5vw, 74px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--maroon-dark);
  text-transform: uppercase;
  /* Sized so the longest line clears the content box: the two lines are the
     authored <br>, and nowrap stops the browser adding a third. */
  white-space: nowrap;
}

.subtitle {
  margin: 0;
  /* Wide enough to hold the sentence on one line wherever it fits. */
  max-width: 60ch;
  font-size: clamp(17px, 1.8vw, 20px);
  font-weight: 500;
  line-height: 1.5;
  color: var(--subtitle);
  text-wrap: pretty;
}

.subtitle .accent {
  color: var(--maroon-dark);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Register panel
   -------------------------------------------------------------------------- */

.register {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 30px 26px;
  border: 1.5px solid var(--maroon);
  border-radius: 6px;
  background: var(--panel-bg);
  scroll-margin-top: 24px;
}

.register-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.register-head h2 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(22px, 2.6vw, 27px);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--maroon-dark);
}

.register-head p {
  margin: 0;
  max-width: 32ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--panel-text);
}

.register-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* The comp is placeholder-only, so labels are for assistive tech.
   Placeholders repeat the label text for sighted users. */
.field label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.field input {
  width: 100%;
  font-size: 16px; /* 16px min stops iOS Safari zooming on focus */
  font-weight: 500;
  color: var(--ink);
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 4px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:hover {
  border-color: oklch(0.55 0.03 40);
}

.field input:focus-visible {
  border-color: var(--focus);
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.field input[aria-invalid="true"] {
  border-color: var(--error-border);
  background: var(--error-bg);
}

.field-error {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--error);
  animation: fade-in 0.2s ease both;
}

.field-error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--error);
  color: var(--input-bg);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
}

.form-error {
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--error-border);
  border-radius: 4px;
  background: var(--error-bg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--error);
  animation: fade-in 0.2s ease both;
}

.form-note {
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--panel-text);
}

/* Honeypot — off-screen rather than display:none, which bots skip. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 15px 20px;
  border: none;
  border-radius: 4px;
  background: var(--maroon);
  color: var(--cream);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.08s ease;
}

.submit-button:hover:not(:disabled) { background: var(--maroon-hover); }
.submit-button:active:not(:disabled) { background: var(--maroon-active); transform: translateY(1px); }

.submit-button:disabled {
  cursor: progress;
  background: var(--maroon);
  opacity: 0.8;
}

.spinner {
  display: none;
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid oklch(0.97 0.012 80 / 0.35);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.submit-button[aria-busy="true"] .spinner { display: block; }

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

.confirmation {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-radius: 4px;
  background: var(--blue-soft-bg);
  animation: fade-in 0.3s ease both;
}

.confirmation-eyebrow {
  margin: 0;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-heading);
}

.confirmation-message {
  margin: 0;
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  color: var(--confirmation-text);
}

.link-button {
  background: none;
  border: none;
  padding: 2px 0;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--panel-text);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.link-button:hover { color: var(--maroon); }

/* --------------------------------------------------------------------------
   FAQs — native <details>, so they work with JS disabled
   -------------------------------------------------------------------------- */

.faqs {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  text-align: left;
  border-top: 1.5px solid var(--rule);
}

.faq-item {
  border-bottom: 1.5px solid var(--rule);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 15px 2px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--faq-question);
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

/* Strip the native disclosure triangle in every engine. */
.faq-question::-webkit-details-marker { display: none; }
.faq-question::marker { content: ""; }

.faq-question:hover { color: var(--maroon); }

.faq-sign {
  flex: none;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 15px;
  line-height: 1;
  color: var(--faq-sign);
}

.faq-sign::before { content: "+"; }
.faq-item[open] .faq-sign::before { content: "\2212"; }

.faq-answer {
  padding: 0 34px 18px 2px;
  animation: fade-in 0.25s ease both;
}

.faq-answer p {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
  color: var(--faq-answer);
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--footer);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
  .page { padding: 24px 20px 40px; gap: 26px; }
  .register { padding: 24px 20px; }
  .faq-answer { padding-right: 12px; }
  .faq-question { font-size: 15.5px; }
}

/* Short windows (a laptop at 650px of viewport, a landscape phone): tighten
   the vertical rhythm so the sign-up form still lands above the fold. */
@media (max-height: 700px) {
  .page { padding-top: 22px; gap: 24px; }
  .hero { gap: 14px; }
  .register { padding: 22px 24px; gap: 16px; }
}

/* --------------------------------------------------------------------------
   Motion / contrast preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* The spinner still needs to read as motion, just gentler. */
  .spinner { animation: spin 1.4s linear infinite !important; }
}

@media (prefers-contrast: more) {
  :root {
    --input-border: oklch(0.45 0.03 40);
    --rule: oklch(0.38 0.13 12 / 0.6);
    --placeholder: oklch(0.42 0.02 40);
  }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
  .stripe, .skip-link, .register-form, .footer { display: none; }
  body { background: #fff; }
  .faq-answer { display: block !important; animation: none; }
}
