/* /careers/apply — page-specific styles. Mirrors the design handoff
 * inline CSS from imaginando-3-0/project/Imaginando Career Apply.html
 * with tokens hoisted to var(--…).
 *
 * Sections:
 *   .apply-hero / .apply-hero-grid / .hero-aside  — hero
 *   .form-wrap / .form-side / .side-toc / .side-panel — sticky side
 *   .form-body / .fset / .frow / .field           — form
 *   .role-picker / .rpick                         — role radio cards
 *   .fileinput                                    — CV upload widget
 *   .chip-pick / .cpick                           — "How did you hear" chips
 *   .consent                                      — privacy checkbox row
 *   .sent-wrap / .sent-grid / .sent-card          — post-submit state
 *
 * Local field token. The form input/textarea background is a *deeper*
 * tone than `--card` in dark mode (#0c0c10 — same as the design handoff,
 * almost identical to --bg but slightly tinted), and pure white in light
 * mode. Defined per-page so the light-mode override doesn't need to
 * spell out every selector. The deeper background is what makes the
 * field read as distinct from the surrounding `.card` panels.
 */
.careers-apply-form { --field: #0c0c10; }

/* ---------- Apply hero ---------- */

.apply-hero {
  padding: 36px 0 48px;
  border-bottom: 0.5px solid var(--line);
}

.apply-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: end;
}
@media (max-width: 1000px) {
  .apply-hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

.apply-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 6px 10px;
  border: 0.5px solid color-mix(in oklab, var(--accent) 50%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  margin-bottom: 22px;
}
.apply-hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(56px, 8.4vw, 140px);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}
.apply-hero h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.apply-hero .lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-dim);
  max-width: 50ch;
  margin: 28px 0 0;
  text-wrap: pretty;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 0.5px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  background: var(--card);
}
.hero-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hero-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--fg-dim);
  text-wrap: pretty;
}
.hero-list li .n {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  align-self: start;
  line-height: 1.7;
}

/* ---------- Section tight + form-wrap ---------- */

.section-tight { padding: 56px 0 96px; }

.form-wrap {
  display: grid;
  grid-template-columns: 0.85fr 1.55fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 1000px) {
  .form-wrap { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Sticky side (TOC + small panels) ---------- */

.form-side {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (max-width: 1000px) {
  .form-side { position: static; }
}
.side-toc {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  counter-reset: toc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-toc li {
  counter-increment: toc;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--fg-dim);
}
.side-toc li::before {
  content: "0" counter(toc);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
  font-weight: 400;
}
.side-panel {
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-panel p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg-dim);
  text-wrap: pretty;
}
.side-panel a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
}
.side-panel a:hover { text-decoration-color: var(--accent); }

/* ---------- Form body ---------- */

.form-body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.fset {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-top: 0.5px solid var(--line);
  padding-top: 32px;
}
.fset:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.fset legend {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  padding: 0;
}
.fset legend .fnum {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 400;
}

.frow {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.frow.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 640px) {
  .frow.two { grid-template-columns: 1fr; }
}

/* Local field-background var so light mode can override in one place. */
.form-body { --field: #0c0c10; }

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field .flab {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.field .flab .req { color: var(--accent); }
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field textarea {
  width: 100%;
  background: var(--field);
  border: 0.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  transition: border-color 0.2s ease, background 0.2s ease;
  outline: none;
  font-family: var(--body);
}
.field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--field) 92%, var(--accent));
}
.field input::placeholder,
.field textarea::placeholder { color: var(--fg-faint); }
/* Required-but-empty (or wrong-shape) field after a failed submit —
 * novalidate.js (careers-apply.js's `form:invalid` handler) toggles this;
 * clears the moment the visitor edits the field. Mirrors .consent.err. */
.field input.err,
.field textarea.err {
  border-color: #ff6b6b;
  background: color-mix(in oklab, var(--field) 88%, #ff6b6b);
}
.field .fhint {
  font-size: 12.5px;
  color: var(--fg-faint);
  line-height: 1.45;
}

.counter {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  margin-top: 2px;
}
.counter .low  { color: #ff6b6b; }
.counter .ok   { color: var(--accent); }
.counter .high { color: #f4a261; }

/* ---------- Role radio cards ---------- */

.role-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rpick {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
}
.rpick:hover { border-color: var(--line-strong); }
.rpick.on {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, var(--card));
}
.rpick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rpick .rdot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}
.rpick.on .rdot { border-color: var(--accent); }
.rpick.on .rdot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.rpick .rlabel {
  font-family: var(--display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.005em;
}

/* ---------- File input ---------- */

.fileinput {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border: 0.5px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--field);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.fileinput:hover { border-color: var(--fg); }
.fileinput.on {
  border-color: var(--accent);
  border-style: solid;
  background: color-mix(in oklab, var(--field) 92%, var(--accent));
}
.fileinput input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.fileinput .fi-name {
  font-size: 14px;
  color: var(--fg-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fileinput.on .fi-name { color: var(--fg); }
.fileinput .fi-act {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Chip pick ("How did you hear about us?") ---------- */

.chip-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cpick {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0.5px solid var(--line);
  font-size: 13px;
  color: var(--fg-dim);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.cpick:hover {
  border-color: var(--line-strong);
  color: var(--fg);
}
.cpick.on {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
}

/* ---------- Consent checkbox row ---------- */

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg-dim);
  cursor: pointer;
  text-wrap: pretty;
  position: relative;
}
.consent a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.consent.err { border-color: #ff6b6b; }
.consent input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.consent .cbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  flex-shrink: 0;
  position: relative;
  margin-top: 2px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.consent input:checked + .cbox {
  border-color: var(--accent);
  background: var(--accent);
}
.consent input:checked + .cbox::after {
  content: "";
  position: absolute;
  inset: 3px 2px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -2px);
  width: 6px;
  height: 11px;
}

/* ---------- Submit actions ---------- */

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}
.btn.big {
  height: 50px;
  padding: 0 26px;
  font-size: 14.5px;
}
.btn.shake { animation: careers-apply-shake 0.4s ease; }
@keyframes careers-apply-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}
.form-error {
  color: #ff6b6b;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

/* ---------- Sent state (post-submit) ---------- */

.sent-wrap {
  padding: 32px 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 880px;
}
.sent-wrap h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 68px);
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}
.sent-wrap .lede {
  font-size: 18px;
  color: var(--fg-dim);
  line-height: 1.55;
  max-width: 54ch;
  margin: 0;
  text-wrap: pretty;
}
.sent-wrap .lede strong {
  color: var(--fg);
  font-weight: 500;
}
.sent-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.sent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 48px;
}
@media (max-width: 900px) { .sent-grid { grid-template-columns: 1fr; } }
.sent-card {
  border: 0.5px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}
.sent-card h4 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0;
}
.sent-card p {
  margin: 0;
  color: var(--fg-dim);
  font-size: 14px;
  line-height: 1.55;
  text-wrap: pretty;
  flex: 1;
}
.sent-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Light-mode field background — pure white reads better than card-2
 * (which is the cream "second" surface). */
:root[data-theme="light"] .form-body { --field: #ffffff; }
