/* ==========================================================================
   SIGN-UP FORMS — For Creators (access) and For Rights Holders (licensor)
   Markup: [data-swap] blocks in index.html. Behaviour: the "Lead forms"
   script at the foot of index.html, which sets data-state on each
   [data-swap] ("cards" | "form" | "sent") and animates the change.

   The views carry inline display from the template, and dc-runtime
   re-serialises inline styles on every render, so the show/hide rules below
   need !important (see base.css).
   ========================================================================== */

/* ---- Which view is showing ---------------------------------------------- */
[data-swap-view] { transition: opacity .28s ease; }
[data-swap-view="form"],
[data-swap-view="sent"] { display: none !important; }
[data-swap][data-state="form"] [data-swap-view="cards"],
[data-swap][data-state="sent"] [data-swap-view="cards"] { display: none !important; }
[data-swap][data-state="form"] [data-swap-view="form"],
[data-swap][data-state="sent"] [data-swap-view="sent"] { display: flex !important; }

@media (prefers-reduced-motion: reduce) {
  [data-swap-view] { transition: none; }
}

/* ---- Fields --------------------------------------------------------------
   Two short fields per row where the card is wide enough; one per row in a
   narrow card or on a phone. */
.lf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.lf-field { display: flex; flex-direction: column; gap: 8px; }
.lf-label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-on-dark);
}
.lf-req { color: var(--cta-blue); }
[data-lead-form="licensor"] .lf-req { color: var(--mood-accent); }

[data-lead-form] input:not([type="hidden"]),
[data-lead-form] select,
[data-lead-form] textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-display);
  font-size: 16px;                 /* 16px keeps iOS from zooming on focus */
  line-height: 1.4;
  color: var(--headline-white);
  background: var(--navy-ink);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
[data-lead-form] textarea { min-height: 96px; resize: vertical; }
[data-lead-form] ::placeholder { color: var(--gray-on-dark); opacity: .6; }
[data-lead-form] select {
  appearance: none;
  padding-right: 40px;
  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 1l5 5 5-5' fill='none' stroke='%239CA3B1' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
/* The open dropdown list: Chrome on Windows paints it with the select's dark
   background, so the options need light text on that dark background. */
[data-lead-form] select option { color: var(--headline-white); background: var(--navy-ink); }
/* "Choose one" reads as a placeholder, like the text inputs' placeholders. */
[data-lead-form] select:has(option[value=""]:checked) { color: var(--gray-on-dark); }

[data-lead-form] input:focus,
[data-lead-form] select:focus,
[data-lead-form] textarea:focus {
  outline: none;
  border-color: var(--cta-blue);
  box-shadow: 0 0 0 3px var(--edge-blue);
}
[data-lead-form="licensor"] input:focus,
[data-lead-form="licensor"] select:focus,
[data-lead-form="licensor"] textarea:focus {
  border-color: var(--mood-accent);
  box-shadow: 0 0 0 3px var(--edge-accent);
}
/* Only after the visitor has interacted with a field, not on open. */
[data-lead-form] input:user-invalid,
[data-lead-form] textarea:user-invalid { border-color: var(--flag-color); }

/* ---- Buttons and messages ---------------------------------------------- */
.lf-cancel {
  padding: 15px 6px;
  background: none;
  border: 0;
  color: var(--gray-on-dark);
  cursor: pointer;
  transition: color .15s ease;
}
.lf-cancel:hover { color: var(--headline-white); }
[data-swap] button:focus-visible,
[data-swap] a:focus-visible { outline: 2px solid var(--cta-blue); outline-offset: 3px; }

/* Outline buttons fill with their border colour on hover. The page turns each
   button's style-hover into a .scpN:hover rule, which an inline background
   would override, so the resting transparent background for the <button>
   (browsers give buttons a grey one) lives here, at lower specificity than
   that hover rule. */
[data-form-submit] { background: transparent; }

.lf-busy { display: none; }
[data-lead-form][data-busy] .lf-idle { display: none; }
[data-lead-form][data-busy] .lf-busy { display: inline; }
[data-lead-form][data-busy] [data-form-submit] { opacity: .7; cursor: progress; }

.lf-error {
  display: none;
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--flag-color);
}
[data-lead-form][data-status="error"] .lf-error { display: block; }

.lf-legal { margin: 0; font-size: 13px; color: var(--gray-on-dark); }
.lf-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.lf-legal a:hover { color: var(--headline-white); }

/* Honeypot: present for bots, invisible and unreachable for people. */
.lf-hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* #creators / #rights are the cards themselves (the nav's ENGAGE
   and the footer's CONNECT link to them); land them below the sticky nav
   instead of under it. */
#creators, #rights { scroll-margin-top: 100px; }
