/* The form pages (waitlist, speak, sponsor) that replace Typeform. Built by tools/build-forms.py.
   Each page takes one country colour for its accents: Colombia violet, Peru terracotta, Brazil green. */

/* Work Sans one step up (500) for the text on these pages, at Ronen's ask */
@font-face {
  font-family: "Work Sans";
  src: url("/fonts/work-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
.fm-page { font-weight: 500; }

/* Soft Cream page, so the text reads clearly over the faded photo */
html:has(.fm-body), .fm-body { background: var(--cream); }

.fm-body { --accent: var(--violet); --accent-text: var(--violet); --accent-deep: var(--violet-deep); --accent-tint: var(--lilac); }
.fm-pe { --accent: var(--terracotta); --accent-text: var(--terracotta-text); --accent-deep: var(--terracotta-text); --accent-tint: var(--apricot); }
.fm-br { --accent: var(--green); --accent-text: var(--green-text); --accent-deep: var(--green-text); --accent-tint: var(--seafoam); }

/* The edition photo behind the page, faint and fading into Shell so text and form stay crisp */
.fm-bg { position: absolute; inset: 0 0 auto; height: min(100vh, 900px); z-index: 0; overflow: hidden; pointer-events: none; }
.fm-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.16;
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent);
  mask-image: linear-gradient(to bottom, #000 35%, transparent);
}

.fm-page {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 132px var(--gutter) 88px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  gap: 56px;
  align-items: start;
}

/* Left: what this is, the place, the dates */
.fm-intro { position: sticky; top: 120px; }
/* The 2027 logo heads the form card */
.fm-logo { display: block; width: clamp(180px, 18vw, 230px); height: auto; margin: 0 auto 28px; }
.fm-intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 4.6vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.01em;
}
.fm-intro h1 em { font-style: italic; color: var(--accent-text); }
.fm-lede { margin: 16px 0 0; max-width: 40ch; font-weight: 400; font-size: 18px; color: var(--ink-soft); }
/* The special guest page: a quiet outlined note under the intro, saying what the link gives them */
.fm-offer { margin: 16px 0 0; max-width: 40ch; font-weight: 400; font-size: 18px; color: var(--ink-soft); }

.fm-when { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
/* Stacked, the same for every destination: city, country in italic, then the dates */
.fm-when li { display: flex; flex-direction: column; font-size: 19px; line-height: 1.3; }
.fm-when span { font-family: var(--serif); font-weight: 500; }
.fm-when em { font-family: var(--serif); font-style: italic; color: var(--ink-soft); }
.fm-when small { margin-top: 3px; font-size: 15px; color: var(--ink-soft); }
.fm-when-co span { color: var(--violet); }
.fm-when-pe span { color: var(--terracotta-text); }
.fm-when-br span { color: var(--green-text); }
.fm-when-ar span { color: var(--cobalt); }

/* Right: the form, on a cream card */
.fm-card {
  background: var(--cream);
  border: 1px solid rgba(20, 18, 16, 0.08);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  padding: clamp(24px, 3.4vw, 40px);
}
.fm-form { display: grid; gap: 22px; }
.fm-form[hidden], .fm-done[hidden] { display: none; }
.fm-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; }

.fm-field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.fm-field > label, .fm-field legend { padding: 0; font-size: 15px; color: var(--ink); }
.fm-field legend { margin-bottom: 8px; }
.fm-hint { margin: -4px 0 0; font-size: 13px; color: var(--ink-soft); }

.fm-field input,
.fm-field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming in on focus */
  color: var(--ink);
  background: transparent;
  border: 1.5px solid rgba(20, 18, 16, 0.18);
  border-radius: 12px;
  padding: 13px 14px;
  transition: border-color var(--dur-hover) ease, box-shadow var(--dur-hover) ease;
}
.fm-field textarea { resize: vertical; min-height: 112px; line-height: 1.5; }
.fm-field input::placeholder, .fm-field textarea::placeholder { color: rgba(20, 18, 16, 0.38); }
@media (hover: hover) { .fm-field input:hover, .fm-field textarea:hover { border-color: rgba(20, 18, 16, 0.32); } }
.fm-field input:focus, .fm-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.fm-field.is-invalid input, .fm-field.is-invalid textarea { border-color: var(--terracotta-text); }
.fm-field.is-invalid legend, .fm-field.is-invalid > label { color: var(--terracotta-text); }
.fm-field.is-invalid .fm-chip span { border-color: var(--terracotta-text); }
.fm-msg { margin: 0; font-size: 13px; color: var(--terracotta-text); }

/* Choices as pills: tap to pick, the picked one fills */
.fm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-chip { position: relative; display: inline-flex; }
.fm-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.fm-chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid rgba(20, 18, 16, 0.18);
  border-radius: var(--r-pill);
  font-size: 15px;
  background: transparent;
  pointer-events: none;
  transition: background-color var(--dur-hover) ease, border-color var(--dur-hover) ease, transform var(--dur-press) var(--ease-press);
}
.fm-chip small { font-size: 13px; color: var(--ink-soft); }
.fm-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); }
@media (hover: hover) { .fm-chip:hover span { border-color: rgba(20, 18, 16, 0.36); } }
.fm-chip:active span { transform: scale(0.97); }
.fm-chip input:checked + span { background: var(--t, var(--accent-tint)); border-color: var(--c, var(--accent)); }
.fm-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Destinations wear their own country colour and tint */
.fm-chip-co { --c: var(--violet); --t: var(--lilac); }
.fm-chip-pe { --c: var(--terracotta); --t: var(--apricot); }
.fm-chip-br { --c: var(--green); --t: var(--seafoam); }
.fm-chip-ar { --c: var(--cobalt); --t: var(--sky); }

.fm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.fm-error { margin: 0; font-size: 15px; color: var(--terracotta-text); }
.fm-submit { justify-self: start; border: 0; font: inherit; font-size: 16px; cursor: pointer; }
/* Buttons on the page keep the page's country colour; hover only deepens it, never turns violet */
.fm-page .btn-violet { background: var(--accent-deep); }
.fm-co .fm-page .btn-violet { background: var(--violet); }
@media (hover: hover) {
  .fm-page .btn-violet:hover { background: color-mix(in srgb, var(--accent-deep) 82%, var(--ink)); }
  .fm-co .fm-page .btn-violet:hover { background: var(--violet-deep); }
}
.fm-submit[disabled] { opacity: 0.7; cursor: progress; }
.fm-note { margin: -8px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.fm-note a { color: var(--accent-text); }

/* After sending: the card turns into a thank-you */
.fm-done { outline: none; }
.fm-done h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.1; color: var(--accent-text); }
.fm-done p { margin: 14px 0 0; font-size: 17px; color: var(--ink-soft); max-width: 40ch; }
.fm-done-links { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.fm-link { color: var(--ink); font-size: 15px; }
.js .fm-done:not([hidden]) { animation: fm-in var(--dur-ui) var(--ease-out) both; }
@keyframes fm-in { from { opacity: 0; transform: translateY(8px); } }

/* No tickets button: FAQ keeps the same space to the edge as between the links (28px gap + 4px link padding) */
.nav.fm-nav-bare { padding-right: 32px; }

@media (max-width: 900px) {
  .fm-page { grid-template-columns: 1fr; gap: 32px; padding-top: 112px; }
  .fm-intro { position: static; }
}
@media (max-width: 640px) {
  .fm-page { padding: 104px 16px 56px; gap: 24px; }
  .fm-logo { width: 170px; margin: 0 auto 22px; }
  .fm-when { gap: 16px 16px; }
  .fm-when small { font-size: 14px; white-space: nowrap; }
  .fm-submit { justify-self: stretch; text-align: center; }
  /* A page without the tickets button: no menu on mobile, the form already carries the logo */
  .nav.fm-nav-bare { display: none; }
  .fm-nav-bare + .fm-bg + .fm-page { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .fm-done:not([hidden]) { animation: none; }
}
