/* V3 forms: one shared form component for the Join Thursd redesign (2026-12-05).
   Markup and copy-paste snippets per variant: docs/v3-components.md, "Forms (v3-forms.css)"; demo with every
   state: docs/forms-demo.html.
   Design only. The contract behind the forms is untouched: site.js and claim.js find the forms by their
   action, ids and names (#mce-success-response, #mce-error-response, #claim-form, cl-*, [type=submit],
   .cf-turnstile, hp_field (website_url until 5-12-2026), b_*) and those stay exactly as they were.
   Self-contained on purpose: it works inside <main class="v3"> and on pages without it (/claim), so every
   rule is under .v3f and carries its own tokens. Loaded after v3.css. Every Join form uses it since 5-12-2026 (site-v4);
   the older .v3-form rules were removed from v3.css then.
   v3-forms.js adds inline errors (role=alert), the loading flag and the success state; without it the
   browser's own validation and the plain response boxes still work. */
.v3f{--f-navy:#052231;--f-coral:#FF4E5B;--f-pink:#FBD1C3;--f-mint:#DAE7DE;--f-rose:#F7EDE3;--f-warm:#F6EEE3;--f-purple:#832740;--f-ink:#4A4A4A;--f-line:#0522318c;
  display:flex;flex-direction:column;gap:30px;margin:0;color:var(--f-navy);font-family:"Avenir Thursd",Avenir,"Century Gothic",Arial,sans-serif;font-size:16px;line-height:1.5;text-align:left}
.v3f *{box-sizing:border-box}
.v3f :is(p,ul,fieldset,legend){margin:0}
.v3f a{color:inherit;text-decoration:underline;text-underline-offset:3px}
.v3f :is(a,button,input,select,textarea):focus-visible{outline:3px solid var(--f-navy);outline-offset:3px}
.v3f-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.v3f-note{font-size:14px;color:var(--f-ink)}

/* Groups: a fieldset per topic, numbered like the V3 steps. One-group forms (variant 1) skip the legend. */
.v3f-group{border:0;padding:0;min-width:0;display:flex;flex-direction:column;gap:18px}
.v3f-legend{padding:0 0 12px;width:100%;display:flex;align-items:baseline;gap:12px;font-size:20px;font-weight:800;letter-spacing:-.02em;line-height:1.2;border-bottom:1px solid #05223133}
.v3f .v3f-legend{margin-bottom:16px}
.v3f-step{font-size:12px;letter-spacing:.07em;color:var(--f-navy);border-left:3px solid var(--f-coral);padding-left:9px;line-height:1.2}
.v3f-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px 20px}
.v3f-wide{grid-column:1/-1}

/* Field: label, optional hint, control, error (added by v3-forms.js) */
.v3f-field{display:flex;flex-direction:column;gap:7px;min-width:0}
.v3f-label{font-size:13px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;line-height:1.3}
.v3f-opt{font-weight:400;text-transform:none;letter-spacing:0;color:var(--f-ink);margin-left:6px}
.v3f-hint{font-size:14px;line-height:1.45;color:var(--f-ink)}
.v3f :is(.v3f-input,.v3f-select,.v3f-textarea){display:block;width:100%;min-height:52px;margin:0;font:inherit;font-size:16px;line-height:1.4;color:var(--f-navy);background:#fff;border:1.5px solid var(--f-line);border-radius:0;padding:13px 15px;box-shadow:none;transition:border-color .15s}
.v3f :is(.v3f-input,.v3f-select,.v3f-textarea):hover{border-color:var(--f-navy)}
.v3f :is(.v3f-input,.v3f-select,.v3f-textarea):focus{border-color:var(--f-navy)}
.v3f :is(.v3f-input,.v3f-textarea)::placeholder{color:#4a4a4aa6;opacity:1}
.v3f .v3f-textarea{min-height:124px;resize:vertical}
/* AutoFill (iPhone, Chrome) paints a filled field yellow and keeps it that way; the field stays white */
.v3f :is(.v3f-input,.v3f-select,.v3f-textarea):is(:-webkit-autofill,:autofill){-webkit-box-shadow:0 0 0 1000px #fff inset;box-shadow:0 0 0 1000px #fff inset;-webkit-text-fill-color:var(--f-navy);caret-color:var(--f-navy);transition:background-color 99999s}
.v3f .v3f-select{appearance:none;-webkit-appearance:none;padding-right:46px;cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%23052231' stroke-width='2'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 17px center}
.v3f .v3f-select:invalid{color:#4a4a4ab3}
.v3f .v3f-select option{color:var(--f-navy)}

/* Errors: purple border plus a line of text under the field. Purple #832740 on white is 9.9:1. */
.v3f [aria-invalid="true"]{border-color:var(--f-purple)!important;border-width:2px}
.v3f-error{display:flex;gap:8px;align-items:flex-start;font-size:14px;font-weight:800;line-height:1.4;color:var(--f-purple)}
.v3f-error:before{content:'!';flex:none;display:inline-grid;place-items:center;width:18px;height:18px;margin-top:1px;border-radius:50%;background:var(--f-purple);color:#fff;font-size:12px;line-height:1}

/* Checkboxes: consent and opt-ins, 24px box, the whole sentence is the label */
.v3f-checks{display:flex;flex-direction:column;gap:14px}
.v3f-check{display:flex;flex-direction:column;gap:6px}
.v3f-check label{display:flex;gap:13px;align-items:flex-start;font-size:15px;line-height:1.5;cursor:pointer}
.v3f-check input[type=checkbox]{appearance:none;-webkit-appearance:none;flex:none;width:24px;height:24px;margin:0;border:1.5px solid var(--f-navy);border-radius:0;background:#fff center/15px no-repeat;cursor:pointer}
.v3f-check input[type=checkbox]:checked{background-color:var(--f-navy);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='12' viewBox='0 0 15 12'%3E%3Cpath d='M1.5 6.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='2.4'/%3E%3C/svg%3E")}
.v3f-check .v3f-error{margin-left:37px}

/* Photo upload (variant 3): the real file input covers the drop zone, so click, keyboard and drag-and-drop
   all reach it; claim.js keeps reading #cl-PHOTOS and writing #claim-photo-list. */
.v3f-drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:150px;padding:24px 18px;text-align:center;background:var(--f-rose);border:1.5px dashed var(--f-line);transition:background .15s,border-color .15s}
.v3f-drop:hover,.v3f-drop.is-over{background:var(--f-pink);border-color:var(--f-navy)}
.v3f-drop:focus-within{outline:3px solid var(--f-navy);outline-offset:3px}
.v3f-drop input[type=file]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:0}
.v3f-drop-icon{width:34px;height:34px}
.v3f-drop strong{font-size:15px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}
.v3f-drop span{font-size:14px;color:var(--f-ink)}
.v3f-photos{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:12px}
.v3f-photos:empty{display:none}
.v3f-photos li{display:flex;flex-direction:column;gap:4px;font-size:13px;line-height:1.35;color:var(--f-ink)}
.v3f-photos img{width:100%;aspect-ratio:1;object-fit:cover;display:block;background:var(--f-rose)}
.v3f-photos .bad{color:var(--f-purple);font-weight:800}
.v3f-photos a{font-weight:800;color:var(--f-navy)}

/* Spam check, honeypots */
.v3f-verify{min-height:65px}
.v3f-trap{position:absolute;left:-5000px;width:1px;height:1px;overflow:hidden}

/* Responses. The ids stay #mce-error-response / #mce-success-response because site.js and claim.js write
   to them; these rules are the only ones for them since the old v3.css rules went (5-12-2026). */
/* display:contents: a hidden response takes no slot in the form's stack, so no empty gap above the button */
#root .v3f .v3f-status{display:contents}
#root .v3f #mce-responses .response{margin:0;padding:18px 20px 18px 56px;position:relative;font-size:16px;line-height:1.5;color:var(--f-navy);border:0;border-left:4px solid;text-align:left}
#root .v3f #mce-responses .response:before{position:absolute;left:18px;top:17px;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;color:#fff;font-size:14px;font-weight:800;line-height:1}
#root .v3f #mce-responses #mce-error-response{background:#fff;border-left-color:var(--f-purple)}
#root .v3f #mce-responses #mce-error-response:before{content:'!';background:var(--f-purple)}
#root .v3f #mce-responses #mce-success-response{background:var(--f-mint);border-left-color:var(--f-navy);font-size:18px;font-weight:800;padding-top:20px;padding-bottom:20px}
#root .v3f #mce-responses #mce-success-response:before{content:'\2713';background:var(--f-navy);top:20px}
#root .v3f #mce-responses #mce-success-response a{font-weight:800}
#root .v3f #mce-responses .response:focus{outline:none}
#root .v3f #mce-responses .response:focus-visible{outline:3px solid var(--f-navy);outline-offset:3px}

/* Submit row. The submit stays an <input> (site.js and claim.js set its value to "Sending..."); the wrapper
   draws the arrow and, while it is disabled, the spinner. */
.v3f-foot{display:flex;flex-wrap:wrap;align-items:center;gap:14px 26px}
.v3f-foot .v3f-legal{flex:1 1 220px;font-size:13px;line-height:1.5;color:var(--f-ink)}
.v3f-submit{position:relative;display:inline-flex}
.v3f-submit:after{content:'\2192';position:absolute;right:23px;top:50%;transform:translateY(-52%);color:#fff;font-size:22px;line-height:1;pointer-events:none;transition:transform .2s}
.v3f-btn{appearance:none;-webkit-appearance:none;display:inline-block;min-height:56px;margin:0;padding:17px 66px 17px 26px;background:var(--f-navy);color:#fff;font:inherit;font-size:14px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;line-height:1.3;border:1px solid transparent;border-radius:0;cursor:pointer;transition:transform .2s,background .2s}
.v3f-btn:hover{background:#173e4e;transform:translateY(-3px)}
.v3f-submit:hover:after{transform:translate(4px,-52%)}
.v3f-btn:disabled{cursor:progress;transform:none;background:#173e4e}
.v3f-submit:has(.v3f-btn:disabled):after{content:'';width:18px;height:18px;margin-top:-1px;border:2.5px solid #ffffff55;border-top-color:#fff;border-radius:50%;animation:v3f-spin .8s linear infinite;transform:translateY(-50%)}
@keyframes v3f-spin{to{transform:translateY(-50%) rotate(360deg)}}

/* Success: v3-forms.js puts .is-sent on the form; the questions fold away and the confirmation stays. */
.v3f.is-sent > :is(.v3f-group,.v3f-checks,.v3f-verify,.v3f-foot,.v3f-note){display:none!important}
.v3f-again{align-self:flex-start;background:none;border:0;padding:0 0 5px;font:inherit;font-size:14px;font-weight:800;color:var(--f-navy);border-bottom:2px solid var(--f-coral);cursor:pointer}
.v3f-again[hidden]{display:none}

/* Panel: the white surface the long forms sit on when the section behind them is coloured (/claim on navy) */
.v3f-panel{background:#fff;color:var(--f-navy);padding:36px 34px}

@media (max-width:650px){
  .v3f{gap:26px}
  .v3f-grid{grid-template-columns:1fr;gap:18px}
  .v3f-legend{font-size:19px}
  .v3f-panel{padding:26px 18px}
  .v3f-foot{flex-direction:column;align-items:stretch}
  .v3f-foot .v3f-legal{flex:none}
  .v3f-submit{display:flex}
  .v3f-btn{width:100%;text-align:left}
  #root .v3f #mce-responses #mce-success-response{font-size:17px}
}
@media (prefers-reduced-motion:reduce){
  .v3f *,.v3f *:before,.v3f *:after{transition:none!important}
  .v3f-btn:hover{transform:none}
  .v3f-submit:hover:after{transform:translateY(-52%)}
  .v3f-submit:has(.v3f-btn:disabled):after{animation:none;border-color:#fff;border-top-color:#ffffff55}
}
