/* Chelmsford Summer Series - 2027 priority access

   Layout idea: "the poster, then the form". The top of the page IS the
   client's poster - wordmark in the sky, the lit tree untouched in the
   middle, date and venue on the dark grass - and no text ever sits over
   the lights. The form lives on flat navy beside it (desktop) or under
   it (phone), so it is always read against a solid colour.

   Type follows the artwork: Instrument Serif Italic for the italic lines
   ("Summer Series", "August Bank Holiday"), Archivo for the heavy sans of
   the venue pill. Both SIL OFL 1.1, self-hosted. */

/* ---------- Tokens ---------- */
:root {
  --ground:      #06041C;   /* the photo's grass at the foot - page base */
  --navy:        #0D1438;   /* form side, one step up from the ground */
  --sky:         #14224A;   /* upper sky - poster fallback */
  --orange:      #F2904F;   /* the wordmark */
  --orange-hot:  #F7A873;
  --orange-deep: #D9713A;
  --cream:       #F7F4EE;   /* "Summer Series" */
  --cream-mute:  rgba(247, 244, 238, 0.74);
  --cream-faint: rgba(247, 244, 238, 0.45);
  --gold:        #FFC77A;   /* the tree's lamps - focus only */

  --field-bg:    #0A1030;
  --line:        rgba(247, 244, 238, 0.16);

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:  "Archivo", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ease:  cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- Fonts (SIL OFL 1.1 - see assets/fonts/OFL.txt) ---------- */
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/InstrumentSerif-Italic.woff2?v=20260926-13") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/Archivo-var.woff2?v=20260926-13") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Page ---------- */
.page { min-height: 100svh; }

/* ---------- Poster ---------- */
.poster {
  position: relative;
  container-type: inline-size;  /* type below scales with the poster, not the window */
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--sky);
}
.poster__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;                 /* explicit, so the height attribute can't win */
  object-fit: cover;
  object-position: center 45%;
  display: block;
}
/* Grass only: melts the photo's foot into the page colour and seats the
   date lines. Stops well below the lights - the tree is never dimmed. */
.poster::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(to bottom, rgba(6, 4, 28, 0) 0%, rgba(6, 4, 28, 0.55) 55%, var(--ground) 100%);
  pointer-events: none;
}

.poster__lockup {
  position: absolute;
  z-index: 1;
  top: 5.5cqw;
  left: 50%;
  width: 86cqw;
  margin: 0;
  transform: translateX(-50%);
  animation: fade 1.2s var(--ease) both;
}
.poster__lockup img {
  width: 100%;
  height: auto;
  display: block;
}

.poster__when {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 6cqw;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.4cqw;
  text-align: center;
  animation: fade 1.2s var(--ease) 0.25s both;
}
.poster__date {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 7cqw;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--cream);
  text-shadow: 0 2px 18px rgba(6, 4, 28, 0.8);
}
/* the outlined pill from the poster */
.poster__venue {
  padding: 1.4cqw 4.2cqw 1.2cqw;
  border: max(1.5px, 0.35cqw) solid var(--cream);
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 4.1cqw;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--cream);
  background: rgba(6, 4, 28, 0.45);
  white-space: nowrap;
}

/* ---------- Form side ---------- */
.side {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding: 1.75rem 1.25rem 1.5rem;
}
.signup {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  animation: fade 1.2s var(--ease) 0.45s both;
}

.panel {
  position: relative;
  isolation: isolate;          /* keeps the country dropdown above later content */
}
/* one state visible at a time */
.panel__state { display: none; }
.panel[data-form-state="idle"]    .panel__idle,
.panel[data-form-state="otp"]     .panel__otp,
.panel[data-form-state="success"] .panel__success { display: block; }

.panel__title {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 8.4vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--cream);
  text-wrap: balance;
}
/* stacked (phone) layout centres the heading + intro under the centred
   poster; the side-by-side layout sets them back to left */
.panel__title,
.panel__lede { text-align: center; }
.panel__lede,
.panel__state p:not(.form__error):not(.form__resend) {
  margin: 0 0 1.4rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--cream-mute);
  text-wrap: pretty;
}

/* ---------- Form ---------- */
.form__row { margin: 0 0 0.8rem; }
.form__label {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* recessed field with a light bar on its foot (inset shadow, never a
   border-width change, so focus never reflows the form) */
.form__input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-bg);
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.42), inset 0 -2px 0 0 rgba(242, 144, 79, 0.28);
  color: var(--cream);
  font-family: inherit;
  font-size: 1rem;             /* 16px min - stops iOS zoom-on-focus */
  line-height: 1.3;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.form__input::placeholder { color: var(--cream-faint); }
.form__input:hover { border-color: rgba(247, 244, 238, 0.28); }
.form__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.42), inset 0 -2px 0 0 var(--orange),
              0 0 0 3px rgba(255, 199, 122, 0.22);
}
.form__input--otp {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.36em;
  text-indent: 0.36em;         /* re-centres against the trailing letter-space */
}

/* Chrome autofill ignores background - the inset shadow is the only
   override, so the foot bar must be re-declared here too. */
.form__input:-webkit-autofill,
.form__input:-webkit-autofill:hover,
.form__input:-webkit-autofill:focus,
.form__input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset, inset 0 -2px 0 0 rgba(242, 144, 79, 0.28) !important;
          box-shadow: 0 0 0 1000px var(--field-bg) inset, inset 0 -2px 0 0 rgba(242, 144, 79, 0.28) !important;
  -webkit-text-fill-color: var(--cream) !important;
  caret-color: var(--cream);
  transition: background-color 9999s ease-in-out 0s;
}

/* Honeypot - display:none ONLY. Off-screen positioning gets autofilled by
   Chrome/Edge and silently blocks real signups. */
.hp-row { display: none !important; }

.form__check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  margin-top: 0.2rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--cream-mute);
  cursor: pointer;
}
.form__check input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.1rem 0 0;
  border: 1px solid rgba(247, 244, 238, 0.4);
  border-radius: 5px;
  background: var(--field-bg);
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.form__check input:checked {
  background: var(--orange);
  border-color: var(--orange);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpolyline points='2,6.2 4.7,8.9 10,3.2' fill='none' stroke='%2306041C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 78%;
  background-repeat: no-repeat;
  background-position: center;
}
.form__check input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.form__check a { color: var(--cream); text-underline-offset: 2px; }
.form__check a:hover { color: var(--orange-hot); }

.form__error {
  margin: 0.42rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #FFB4A6;
}
.form__error--global { margin-top: 0.7rem; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.005em;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              filter 0.2s var(--ease);
}
/* lit from above, like the lamps: hot top, deeper foot */
.btn--primary {
  color: #1B0C03;
  background: linear-gradient(to bottom, var(--orange-hot), var(--orange) 55%, var(--orange-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.18),
              0 10px 28px rgba(242, 144, 79, 0.28);
}
.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.18),
              0 14px 34px rgba(242, 144, 79, 0.38);
}
.btn--primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Secondary CTA, success panel only - an invitation, quieter than the
   primary so it never competes with "check your inbox". */
.btn--whatsapp {
  margin-top: 1rem;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(242, 144, 79, 0.6);
  color: var(--orange-hot);
}
.btn--whatsapp:hover {
  background: rgba(242, 144, 79, 0.1);
  transform: translateY(-1px);
}
.btn__icon { width: 20px; height: 20px; flex: 0 0 auto; }

.form__resend {
  margin: 0.9rem 0 0;
  font-size: 0.86rem;
  text-align: center;
  color: var(--cream-mute);
}
.form__resend-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--orange-hot);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.form__resend-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.panel__success-note {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  color: var(--cream);
}

/* ---------- Footer ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.foot__logos { display: flex; align-items: center; }
.foot__logos img { height: 28px; width: auto; display: block; }
.foot__email { margin: 0; }
.foot__email a {
  font-size: 0.9rem;
  color: var(--cream-mute);
  text-decoration: underline;
  text-decoration-color: rgba(247, 244, 238, 0.3);
  text-underline-offset: 3px;
}
.foot__email a:hover { color: var(--orange-hot); text-decoration-color: currentColor; }
.site-built { margin: 0; flex-basis: 100%; display: flex; justify-content: center; }
.site-built a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--cream-mute);
  text-decoration: none;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.site-built a:hover { color: var(--cream); border-color: rgba(242, 144, 79, 0.6); }
.site-built img { height: 14px; width: auto; display: block; }

/* ---------- intl-tel-input ---------- */
/* Hidden state lives in the vendor stylesheet; until it loads the list would
   flash open on first paint. */
.iti__dropdown-content.iti__hide { display: none !important; }
.iti { width: 100%; display: block; }
.iti__country-container { z-index: 3; }
.iti input.form__input { padding-left: calc(52px + 0.7rem); }  /* app.js re-measures */
.iti__dropdown-content {
  background: #0F1740;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.6);
  color: var(--cream);
}
.iti__country-list { background: transparent; }
.iti__country { color: var(--cream); }
.iti__country.iti__highlight,
.iti__country:hover { background: rgba(242, 144, 79, 0.16); }
.iti__dial-code { color: var(--cream-faint); }
.iti__search-input {
  /* keep the vendor's horizontal reservation or the magnifier lands on the
     word "Search" - never use the padding shorthand alone */
  padding: 9px 30px 9px 32px;
  background: #0F1740;
  color: var(--cream);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  font-family: inherit;
}
.iti__search-input::placeholder { color: var(--cream-faint); }

/* ---------- Motion: one quiet load sequence ---------- */
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =========================================================
   Side by side: poster left at full height, form right on navy.
   Any window at least as wide as it is tall, from landscape
   phones up. The poster column runs a little wider than 4:5 of the
   window height, so the photo crops slightly top and bottom; capped
   at 60vw so the form always keeps room.
   ========================================================= */
@media (min-width: 640px) and (min-aspect-ratio: 1/1) {
  .page {
    display: grid;
    grid-template-columns: min(95svh, 60vw) minmax(0, 1fr);
  }
  .poster {
    position: sticky;
    top: 0;
    height: 100svh;
    aspect-ratio: auto;
  }
  /* crop mostly from the sky, lifting the lowest lamps clear of the
     date line; the lockup can sit over the dark canopy, as on the poster */
  .poster__img { object-position: center 46%; }
  /* the column is wider than the 4:5 art, so the poster type steps down
     a touch to keep the artwork's proportions */
  .poster__lockup { top: 4.5cqw; width: 80cqw; }
  .poster__when   { bottom: 4.5cqw; gap: 1.8cqw; }
  .poster__date   { font-size: 5.6cqw; }
  .poster__venue  { font-size: 3.3cqw; padding: 1.1cqw 3.6cqw 1cqw; }
  .poster::after { height: 26%; }
  .side {
    min-height: 100svh;
    justify-content: center;
    padding: clamp(1.5rem, 5vh, 3.5rem) clamp(1.5rem, 5vw, 4.5rem);
    background: var(--navy);
  }
  .signup { margin: auto; }
  .panel__title { font-size: clamp(2.3rem, 3.4vw, 3.1rem); }
  .panel__title,
  .panel__lede { text-align: left; }
}

/* Landscape phones: almost no height - tighten the form so the button
   stays close to the fold. */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .side { gap: 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
  .panel__title { font-size: 1.7rem; }
  .panel__idle .panel__lede { margin-bottom: 0.8rem; font-size: 0.9rem; }
  .form__row { margin-bottom: 0.5rem; }
  .form__input { padding: 0.65rem 0.85rem; }
  .btn { margin-top: 0.7rem; padding: 0.75rem 1rem; }
}

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