/* Event feedback form, "How was your 2030 Company experience?"
   No script, no inline styles. Every colour, size and timing comes from the site tokens in styles.*.css.
   Motion lives only inside prefers-reduced-motion: no-preference. Without :has() the form reads and works in full. */

/* Form column */
.fbf{position:relative;max-width:46rem;counter-reset:done}
.fbf fieldset{position:relative;min-width:0;margin:0;padding:var(--s4) 0;border:0;border-top:1px solid var(--rule-paper)}
.fbf fieldset:first-of-type{padding-top:0;border-top:0}

/* Questions */
.fbf legend{float:left;width:100%;margin:0 0 var(--s2);padding:0;font-size:clamp(19px,.3vw + 17px,22px);line-height:1.3;font-weight:var(--wt-strong);color:var(--navy);text-wrap:pretty}
.fbf legend+*{clear:both}
.fbf legend label{display:block;cursor:pointer}
.fbf legend em{margin-left:var(--s1);font-style:normal;font-size:var(--t-label);font-weight:var(--wt-strong);letter-spacing:var(--track-label);text-transform:uppercase;color:var(--cobalt);white-space:nowrap}
.hint{margin:calc(var(--s1) * -1) 0 var(--s2);padding:0;font-size:var(--t-small);line-height:1.4;color:var(--slate)}

/* Writing space */
.fbf textarea,.fbf input[type=text],.fbf input[type=email]{display:block;width:100%;box-sizing:border-box;min-height:var(--hit);margin:0;padding:10px 14px;font:inherit;font-size:var(--t-body);line-height:1.5;color:var(--navy);background:var(--white);border:1px solid var(--slate);border-radius:0}
.fbf textarea{resize:vertical;min-height:6.5rem}
.fbf textarea:hover,.fbf input[type=text]:hover,.fbf input[type=email]:hover{border-color:var(--navy)}
.fbf textarea:focus,.fbf input[type=text]:focus,.fbf input[type=email]:focus{outline:var(--focus-w) solid var(--cobalt);outline-offset:0;border-color:var(--cobalt)}

/* The 0 to 10 scale */
.sc{max-width:100%}
.scale{display:grid;grid-template-columns:repeat(11,var(--hit));gap:var(--s1)}
.pt{position:relative;display:block}
.pt input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.pt span{display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:var(--hit);height:var(--hit);font-weight:var(--wt-strong);color:var(--navy);background:var(--white);border:1px solid var(--slate);pointer-events:none}
.pt:hover span{border-color:var(--navy);box-shadow:inset 0 0 0 1px var(--navy)}
.pt input:checked+span{color:var(--white);background:var(--cobalt);border-color:var(--cobalt);box-shadow:none}
.pt input:focus-visible+span{outline:var(--focus-w) solid var(--cobalt);outline-offset:3px}

/* Reply details: quiet, optional, always visible */
.reply legend{font-size:var(--t-body)}
.fb-contact{display:grid;gap:var(--s2);margin:0;padding:0}
.fb-contact label{display:grid;gap:6px;max-width:28rem;font-size:var(--t-small);font-weight:var(--wt-strong);line-height:1.3;color:var(--navy)}

/* The quote tick */
.ok{position:relative;display:flex;align-items:flex-start;gap:12px;min-height:var(--hit);margin-top:var(--s3);font-weight:var(--wt-body);line-height:1.45;cursor:pointer}
.ok input{position:absolute;left:0;top:0;width:var(--hit);height:var(--hit);margin:-12px 0 0 -12px;opacity:0;cursor:pointer}
.ok .ind{position:relative;flex:none;box-sizing:border-box;width:22px;height:22px;margin-top:.15em;background:var(--white);border:2px solid var(--navy)}
.ok input:checked+.ind{background:var(--cobalt);border-color:var(--cobalt)}
.ok input:checked+.ind::after{content:"";position:absolute;left:5px;top:1px;width:6px;height:11px;border:solid var(--white);border-width:0 2px 2px 0;transform:rotate(45deg)}
.ok input:focus-visible+.ind{outline:var(--focus-w) solid var(--cobalt);outline-offset:3px}

/* Close of the form */
.fb-close{padding-top:var(--s4);border-top:1px solid var(--rule-paper)}
.priv{max-width:60ch;margin:0 0 var(--s3);padding:0;font-size:var(--t-small);line-height:1.5;color:var(--slate)}
.priv a{color:var(--cobalt);text-underline-offset:.2em}
.fbf .btn{margin-top:0}
.hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}

/* Phones: the scale sits in two rows, 0 to 5 then 6 to 10 */
@media (max-width:640px){
  .scale{grid-template-columns:repeat(6,minmax(0,1fr));max-width:24rem}
  .pt span{min-width:0}
}

/* Windows high contrast: show the real controls */
@media (forced-colors:active){
  .pt input,.ok input{position:static;opacity:1;width:22px;height:22px;margin:0}
  .ok .ind{display:none}
}

/* Thanks page: the field band fills the screen so the footer meets the bottom edge */
body.fb-done{display:flex;flex-direction:column;min-height:100svh}
body.fb-done main{display:flex;flex:1;flex-direction:column}
body.fb-done .page-top{flex:1}

/* Shared motion: a chosen point lands, the quote tick draws */
@keyframes fb-land{0%{transform:scale(.82)}55%{transform:scale(1.08)}100%{transform:scale(1)}}
@keyframes fb-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:no-preference){
  .pt span{transition:background var(--d-fast) var(--ease),border-color var(--d-fast) var(--ease),color var(--d-fast) var(--ease)}
  .pt input:checked+span{animation:fb-land var(--d-state) var(--ease)}
  .ok .ind{transition:background var(--d-fast) var(--ease),border-color var(--d-fast) var(--ease)}
  .ok input:checked+.ind{animation:fb-land var(--d-state) var(--ease)}
  .fb-top .fb-head{animation:fb-rise var(--d-move) var(--ease) both}
}


/* ===== Treatment B: The team answers with you (reference: Duolingo) =====
   The site's cobalt work characters sit beside the questions. Where :has() is supported they wait in grey,
   look up when you enter their question and wake in colour when it is answered. Without :has() they are simply in colour. */

/* Header: the cast, in a row beside the heading */
.fb-cast{display:flex;gap:var(--s1);margin-top:var(--s3)}
.fb-cast img{display:block;width:calc((100% - 40px) / 6);max-width:52px;height:auto}
@media (min-width:900px){
  .fb-top .wrap{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:var(--s4)}
  .fb-cast{margin:0;gap:var(--s2);align-items:flex-end}
  .fb-cast img{width:84px;height:84px;max-width:none;flex:none}
  .fb-cast img:nth-child(even){margin-bottom:14px}
}

/* A character beside each question */
.q{--top:var(--s4)}
.q1{--top:0px}
.who{position:absolute;top:var(--top);right:0;display:block;width:64px;height:64px;pointer-events:none}
.fbf legend{padding-right:76px;box-sizing:border-box}
@media (min-width:1100px){
  .who{right:auto;left:calc(100% + var(--s5));width:112px;height:112px}
  .fbf legend{padding-right:0}
}
.fb-close{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s2) var(--s3)}
.fb-close .priv{flex-basis:100%}
.who-end{position:static;display:block;width:72px;height:72px;margin-left:auto}
@media (min-width:1100px){
  .fb-close{position:relative}
  .who-end{position:absolute;left:calc(100% + var(--s5));bottom:0;width:112px;height:112px;margin:0}
}

/* Asleep, listening, awake */
@supports selector(:has(*)){
  .who{filter:grayscale(1);opacity:.45}
  .q:focus-within .who{opacity:.8}
  .q1:has(:checked) .who,
  .q2:has(textarea:not(:placeholder-shown)) .who,
  .q3:has(textarea:not(:placeholder-shown)) .who,
  .q4:has(textarea:not(:placeholder-shown)) .who,
  .reply:has(input:not([type=checkbox]):not(:placeholder-shown)) .who,
  .fbf:has(.q1 :checked) .who-end{filter:none;opacity:1}
}

/* Thanks page */
.fb-wave{display:block;width:120px;height:120px;margin:0 0 var(--s3)}

/* Motion */
@keyframes fb-hop{0%,100%{transform:translateY(0)}35%{transform:translateY(-14px) rotate(-4deg)}65%{transform:translateY(0) rotate(2deg)}80%{transform:translateY(-4px)}}
@keyframes fb-nod{0%,100%{transform:none}40%{transform:rotate(-6deg)}70%{transform:rotate(3deg)}}
@keyframes fb-droop{to{transform:translateY(4px) rotate(-7deg)}}
@keyframes fb-wave{0%,100%{transform:rotate(0)}20%{transform:rotate(-10deg)}40%{transform:rotate(8deg)}60%{transform:rotate(-6deg)}80%{transform:rotate(3deg)}}
@media (prefers-reduced-motion:no-preference){
  .who{transition:filter var(--d-state) var(--ease),opacity var(--d-state) var(--ease),transform var(--d-state) var(--ease);transform-origin:50% 90%}
  .q:focus-within .who{transform:translateY(-4px)}
  .q2:has(textarea:not(:placeholder-shown)) .who,
  .q3:has(textarea:not(:placeholder-shown)) .who,
  .q4:has(textarea:not(:placeholder-shown)) .who,
  .reply:has(input:not([type=checkbox]):not(:placeholder-shown)) .who,
  .fbf:has(.q1 :checked) .who-end{animation:fb-nod var(--d-move) var(--ease)}
  /* The analyst reacts to the score: droops at 0 to 4, nods at 5 to 7, hops at 8 to 10 */
  .q1:has(input[value="0"]:checked,input[value="1"]:checked,input[value="2"]:checked,input[value="3"]:checked,input[value="4"]:checked) .who{animation:fb-droop var(--d-state) var(--ease) forwards}
  .q1:has(input[value="5"]:checked,input[value="6"]:checked,input[value="7"]:checked) .who{animation:fb-nod var(--d-move) var(--ease)}
  .q1:has(input[value="8"]:checked,input[value="9"]:checked,input[value="10"]:checked) .who{animation:fb-hop var(--d-move) var(--ease)}
  .fb-cast img{animation:fb-rise var(--d-move) var(--ease) both}
  .fb-cast img:nth-child(2){animation-delay:.08s}
  .fb-cast img:nth-child(3){animation-delay:.16s}
  .fb-cast img:nth-child(4){animation-delay:.24s}
  .fb-cast img:nth-child(5){animation-delay:.32s}
  .fb-cast img:nth-child(6){animation-delay:.4s}
  .fb-wave{transform-origin:50% 90%;animation:fb-rise var(--d-move) var(--ease) both,fb-wave 1.2s var(--ease) .6s}
}


/* ===== Don's pick: B, with one borrow from C =====
   The rating fills sky up to the chosen score, which stays cobalt, so a 9 reads as a 9 at a glance.
   Without :has() only the chosen point fills. */
@supports selector(:has(*)){
  .scale:has(.pt:nth-child(2) input:checked) .pt:nth-child(-n+1) span{background:var(--sky);border-color:var(--navy)}
  .scale:has(.pt:nth-child(3) input:checked) .pt:nth-child(-n+2) span{background:var(--sky);border-color:var(--navy)}
  .scale:has(.pt:nth-child(4) input:checked) .pt:nth-child(-n+3) span{background:var(--sky);border-color:var(--navy)}
  .scale:has(.pt:nth-child(5) input:checked) .pt:nth-child(-n+4) span{background:var(--sky);border-color:var(--navy)}
  .scale:has(.pt:nth-child(6) input:checked) .pt:nth-child(-n+5) span{background:var(--sky);border-color:var(--navy)}
  .scale:has(.pt:nth-child(7) input:checked) .pt:nth-child(-n+6) span{background:var(--sky);border-color:var(--navy)}
  .scale:has(.pt:nth-child(8) input:checked) .pt:nth-child(-n+7) span{background:var(--sky);border-color:var(--navy)}
  .scale:has(.pt:nth-child(9) input:checked) .pt:nth-child(-n+8) span{background:var(--sky);border-color:var(--navy)}
  .scale:has(.pt:nth-child(10) input:checked) .pt:nth-child(-n+9) span{background:var(--sky);border-color:var(--navy)}
  .scale:has(.pt:nth-child(11) input:checked) .pt:nth-child(-n+10) span{background:var(--sky);border-color:var(--navy)}
}
@media (prefers-reduced-motion:no-preference){
  .pt:nth-child(2) span{transition-delay:30ms}
  .pt:nth-child(3) span{transition-delay:60ms}
  .pt:nth-child(4) span{transition-delay:90ms}
  .pt:nth-child(5) span{transition-delay:120ms}
  .pt:nth-child(6) span{transition-delay:150ms}
  .pt:nth-child(7) span{transition-delay:180ms}
  .pt:nth-child(8) span{transition-delay:210ms}
  .pt:nth-child(9) span{transition-delay:240ms}
  .pt:nth-child(10) span{transition-delay:270ms}
  .pt:nth-child(11) span{transition-delay:300ms}
}

.opt{font-weight:400;color:#4A5478}

.fbf .reply .hint{padding-right:76px;box-sizing:border-box}
@media (min-width:1100px){.fbf .reply .hint{padding-right:0}}
