/* ============================================================================
   FTO forms: one look for every form on the site (the two waitlist pop-ups,
   the Contact + Speaking forms and the blog newsletter).
   Behaviour and the hand-off to Ivorey live in assets/js/fto-forms.js.

   Token-agnostic on purpose: the fallback chains let it work on the brand.css
   pages (--blue-klein, --terracotta …) AND on the self-contained Motion Room
   page (--blue …). Corners are square everywhere (brand rule: radius 0).
   ========================================================================== */

.ff,
.ff-modal {
  --ff-ink:    var(--blue-klein, var(--blue, #3B5F95));
  --ff-ink-2:  #2e4c78;                     /* hover navy, same as .fto-btn--primary:hover */
  --ff-accent: var(--terracotta, #C28868);
  --ff-sand:   var(--rajola, #E8E4DD);
  --ff-line:   #9E937F;                     /* field border: warm taupe, 3:1 on white */
  --ff-error:  #A25F43;                     /* deeper terracotta, 4.9:1 on white */
  font-family: var(--font-sans, 'Garet', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  color: var(--ff-ink);
}
.ff *, .ff *::before, .ff *::after,
.ff-modal *, .ff-modal *::before, .ff-modal *::after { box-sizing: border-box; }

/* ---- fields ---------------------------------------------------------------- */
.ff { text-align: left; }
.ff-field { margin: 0 0 18px; }
.ff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.ff .ff-label {
  display: block;
  margin: 0 0 8px;
  font-weight: 700;
  font-size: var(--fs-caption, 0.9rem);
  line-height: 1.3;
  color: var(--ff-ink);
}
.ff .ff-opt { font-weight: 400; opacity: 0.65; }

.ff-input, .ff-select, .ff-textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--ff-line);
  border-radius: 0;
  background-color: #fff;
  color: var(--ff-ink);
  font-family: inherit;
  font-size: var(--fs-body, 1rem);
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.ff-textarea { min-height: 128px; resize: vertical; }
.ff-select {
  padding-right: 42px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%233B5F95' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.ff-input::placeholder, .ff-textarea::placeholder { color: rgba(59, 95, 149, 0.5); opacity: 1; }
.ff-select option { color: var(--ff-ink); }
.ff-select:has(option[value=""]:checked) { color: rgba(59, 95, 149, 0.55); }
.ff-input:focus, .ff-select:focus, .ff-textarea:focus {
  outline: none;
  border-color: var(--ff-ink);
  box-shadow: 0 0 0 3px rgba(59, 95, 149, 0.16);
}
/* browser autofill: keep the white field + navy text instead of the yellow/blue tint */
.ff-input:-webkit-autofill, .ff-textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--ff-ink);
}

/* ---- consent checkbox (square, navy) -------------------------------------- */
.ff-consent { display: flex; gap: 12px; align-items: flex-start; }
.ff-consent input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  border: 1.5px solid var(--ff-ink);
  border-radius: 0;
  background: #fff;
  cursor: pointer;
}
.ff-consent input[type="checkbox"]::after {
  content: "";
  width: 11px;
  height: 11px;
  background: #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transition: transform 0.12s ease;
}
.ff-consent input[type="checkbox"]:checked { background: var(--ff-ink); }
.ff-consent input[type="checkbox"]:checked::after { transform: scale(1); }
.ff-consent input[type="checkbox"]:focus-visible { outline: 3px solid rgba(59, 95, 149, 0.35); outline-offset: 2px; }
.ff .ff-consent label {
  margin: 0;
  font-weight: 400;
  font-size: var(--fs-caption, 0.9rem);
  line-height: 1.5;
  opacity: 0.9;
  cursor: pointer;
}
.ff .ff-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

/* ---- validation ------------------------------------------------------------ */
.ff-field.is-invalid .ff-input,
.ff-field.is-invalid .ff-select,
.ff-field.is-invalid .ff-textarea { border-color: var(--ff-error); box-shadow: 0 0 0 1px var(--ff-error); }
.ff-field.is-invalid .ff-consent input[type="checkbox"] { border-color: var(--ff-error); box-shadow: 0 0 0 1px var(--ff-error); }
.ff .ff-err {
  margin: 7px 0 0;
  font-weight: 700;
  font-size: var(--fs-caption, 0.9rem);
  line-height: 1.4;
  color: var(--ff-error);
}
.ff .ff-status {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--ff-error);
  background: rgba(194, 136, 104, 0.14);
  font-size: var(--fs-caption, 0.9rem);
  line-height: 1.5;
  color: var(--ff-ink);
}
.ff .ff-status a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ff .ff-note { margin: 14px 0 0; font-size: var(--fs-caption, 0.9rem); line-height: 1.5; opacity: 0.85; text-wrap: balance; }
.ff .ff-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

/* helper blocks that must never show: validation texts, the bot trap */
.ff-body[hidden], .ff-done[hidden], .ff-status[hidden], .ff-msgs, .ff-msgs[hidden] { display: none !important; }
.ff-hp { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---- buttons --------------------------------------------------------------- */
.ff-btn {
  display: block;
  position: relative;
  overflow: hidden;
  width: 100%;
  margin: 0;
  padding: 14px 32px;
  border: 2px solid transparent;
  border-radius: 0;
  background: var(--ff-ink);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;                        /* same as .fto-btn */
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.ff-btn:hover { background: var(--ff-ink-2); }
.ff-btn:focus-visible { outline: 3px solid rgba(59, 95, 149, 0.4); outline-offset: 2px; }
.ff-btn--ghost { background: transparent; color: var(--ff-ink); border-color: var(--ff-ink); }
.ff-btn--ghost:hover { background: var(--ff-ink); color: #fff; }
/* sending: a thin bar slides along the bottom of the button (square, no spinner) */
.ff.is-sending .ff-btn { cursor: progress; opacity: 0.85; }
.ff.is-sending .ff-btn::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 3px; width: 40%;
  background: rgba(255, 255, 255, 0.9);
  animation: ff-slide 1s ease-in-out infinite;
}
@keyframes ff-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---- thank-you ------------------------------------------------------------- */
.ff-done { text-align: center; padding: 24px 0 14px; outline: none; }
.ff-done__mark { display: block; width: 40px; height: 40px; margin: 0 auto 14px; color: var(--ff-accent); }
.ff .ff-done .ff-title { margin-bottom: 10px; }
.ff .ff-done__text { margin: 0 auto 22px; max-width: 36ch; font-size: var(--fs-body, 1rem); line-height: 1.6; opacity: 0.9; text-wrap: balance; }
.ff-done .ff-btn { width: auto; min-width: 160px; margin: 0 auto; }

/* ---- headings used inside the forms ---------------------------------------- */
.ff .ff-eyebrow {
  display: block;
  margin: 0 0 12px;
  font-weight: 700;
  font-size: var(--fs-label, 0.75rem);
  letter-spacing: var(--ls-label, 0.14em);
  text-transform: uppercase;
  color: var(--ff-accent);
}
.ff .ff-title {
  margin: 0 0 12px;
  font-family: var(--font-serif, 'Juana', Georgia, serif);
  font-weight: 400;
  font-size: var(--fs-quote, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ff-ink);
}
.ff .ff-lede { margin: 0 0 24px; font-size: var(--fs-body, 1rem); line-height: 1.6; opacity: 0.88; text-wrap: balance; }

/* ---- pop-up (waitlists) ---------------------------------------------------- */
.ff-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(30, 48, 80, 0.6);
}
.ff-modal.is-open { display: flex; }
.ff-modal__card {
  position: relative;
  width: 100%; max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 46px 40px 36px;
  background: #fff;
  border-top: 4px solid var(--ff-accent);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  text-align: left;
}
.ff-modal__close {
  position: absolute; top: 8px; right: 10px;
  width: 44px; height: 44px;
  border: 0; background: none;
  font-size: 1.9rem; line-height: 1;
  color: var(--ff-ink);
  cursor: pointer;
}
.ff-modal__close:hover { color: var(--ff-accent); }
.ff-modal__close:focus-visible { outline: 3px solid rgba(59, 95, 149, 0.35); outline-offset: -3px; }
html.ff-lock { overflow: hidden; }

/* ---- newsletter strip (sits on the terracotta band) ------------------------ */
.ff--news { max-width: 540px; margin: 26px auto 0; text-align: center; --ff-error: #fff; }
.ff--news .ff-news-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; text-align: left; }
.ff--news .ff-news-row .ff-field { flex: 1 1 260px; margin: 0; }
.ff--news .ff-input {
  background-color: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  color: #fff;
}
.ff--news .ff-input::placeholder { color: rgba(255, 255, 255, 0.8); }
.ff--news .ff-input:focus { border-color: #fff; background-color: rgba(255, 255, 255, 0.24); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }
.ff--news .ff-input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #fff inset; -webkit-text-fill-color: #3B5F95; }
.ff--news .ff-btn { width: auto; flex: none; background: #fff; color: var(--ff-accent); }
.ff--news .ff-btn:hover { background: var(--blue-klein, #3B5F95); color: #fff; }
.ff--news.ff .ff-field.is-invalid .ff-input { border-color: #fff; box-shadow: 0 0 0 2px #fff; }
.ff--news .ff-err { color: #fff; }
.ff--news .ff-note { color: #fff; }
.ff--news .ff-status { border-left-color: #fff; background: rgba(255, 255, 255, 0.18); color: #fff; text-align: left; }
.ff--news .ff-done__line {
  margin: 4px 0 0;
  font-family: var(--font-serif, 'Juana', Georgia, serif);
  font-size: var(--fs-h3, 1.4rem);
  line-height: 1.3;
  color: #fff;
}

@media (max-width: 560px) {
  .ff-modal { padding: 12px; }
  .ff-modal__card { padding: 44px 22px 28px; max-height: calc(100vh - 24px); }
  .ff-row { grid-template-columns: 1fr; }
  .ff--news .ff-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ff-input, .ff-select, .ff-textarea, .ff-btn { transition: none; }
  .ff.is-sending .ff-btn::after { animation: none; width: 100%; }
}
