/* Apply / application page — layout + form. Tokens, fonts, header & footer come from styles.css. */

body.ap-page { background: var(--bg); }

.ap-page .navlinks a.active { color: var(--text); }

.ap-main { padding: 104px 0 120px; }
.ap-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 40px; }

/* Back link */
.ap-back {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: "Inter", sans-serif; font-size: 14px;
  color: var(--text-2); text-decoration: none;
  margin-bottom: 26px; transition: color .2s ease;
}
.ap-back:hover { color: var(--text); }
.ap-back-arr { color: var(--text-3); transition: transform .25s var(--ease), color .2s ease; }
.ap-back:hover .ap-back-arr { transform: translateX(-3px); color: var(--text-2); }

/* Two-column: sticky role rail + form */
.ap-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 100px; align-items: start; }

/* ---------- Role rail ---------- */
.ap-rail { align-self: stretch; }
.ap-rail-inner { position: sticky; top: 104px; }
.ap-rail .eyebrow { margin-bottom: 18px; }
.ap-role-title {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 400; letter-spacing: -.015em; line-height: 1.1;
  color: var(--text); margin: 0 0 14px;
}
.ap-role-meta { font-family: "Inter", sans-serif; font-size: 13.5px; color: var(--text-3); letter-spacing: .02em; margin-bottom: 20px; }
.ap-role-blurb { font-family: "Inter", sans-serif; font-size: 15px; line-height: 1.62; color: var(--text-2); margin: 0; }
.ap-rail-note { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); }
.ap-rail-note-k { display: block; font-family: "Inter", sans-serif; font-size: 12px; letter-spacing: .08em; font-variant-caps: all-small-caps; font-feature-settings: "smcp" 1, "c2sc" 1; color: var(--text-3); margin-bottom: 11px; }
.ap-rail-note p { font-family: "Inter", sans-serif; font-size: 13.5px; line-height: 1.6; color: var(--text-2); margin: 0; }

/* ---------- Form ---------- */
.ap-form-col { min-width: 0; }
.ap-section { padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--border); }
.ap-section:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.ap-sec-label {
  font-family: "Inter", sans-serif; font-size: 12px; letter-spacing: .09em;
  font-variant-caps: all-small-caps; font-feature-settings: "smcp" 1, "c2sc" 1;
  color: var(--text-3); margin-bottom: 20px;
}

.ap-field { margin-bottom: 18px; }
.ap-field:last-child { margin-bottom: 0; }
.ap-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.ap-row .ap-field { margin-bottom: 0; }

.ap-label { display: flex; align-items: baseline; gap: 8px; font-family: "Inter", sans-serif; font-size: 13px; color: var(--text-2); margin-bottom: 9px; letter-spacing: .01em; }
.ap-label .req { color: var(--text-3); font-size: 13px; line-height: 1; }
.ap-label .opt { margin-left: auto; color: var(--text-3); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }

.ap-input {
  width: 100%; box-sizing: border-box;
  background: var(--base);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: "Inter", sans-serif; font-size: 15px; color: var(--text);
  -webkit-appearance: none; appearance: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.ap-input::placeholder { color: var(--text-3); }
.ap-input:hover { border-color: #3a3a3a; }
.ap-input:focus { outline: none; border-color: #4d4d4d; background: #121214; box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
.ap-textarea { min-height: 118px; line-height: 1.55; resize: vertical; }

.ap-input.is-invalid { border-color: var(--destructive); }
.ap-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.13); }

/* Custom dropdown (replaces native select for full theming) */
.ap-dd { position: relative; }
.ap-dd-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; box-sizing: border-box;
  background: var(--base); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; cursor: pointer;
  font-family: "Inter", sans-serif; font-size: 15px; color: var(--text);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.ap-dd-trigger:hover { border-color: #3a3a3a; }
.ap-dd-trigger:focus-visible { outline: none; border-color: #4d4d4d; background: #121214; box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
.ap-dd.open .ap-dd-trigger { border-color: #4d4d4d; background: #121214; }
.ap-dd-trigger.is-invalid { border-color: var(--destructive); }
.ap-dd-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-dd:not(.has-value) .ap-dd-value { color: var(--text-3); }
.ap-dd-caret { flex: none; width: 8px; height: 8px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease); }
.ap-dd.open .ap-dd-caret { transform: translateY(2px) rotate(225deg); }
.ap-dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 20px 54px -14px rgba(0,0,0,.72);
  max-height: 264px; overflow-y: auto;
}
.ap-dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 7px; cursor: pointer;
  font-family: "Inter", sans-serif; font-size: 14.5px; color: var(--text-2);
  transition: background .12s ease, color .12s ease;
}
.ap-dd-opt.is-active, .ap-dd-opt:hover { background: rgba(255,255,255,.06); color: var(--text); }
.ap-dd-opt.is-selected { color: var(--text); }
.ap-dd-opt.is-selected::after { content: "\2713"; font-size: 12.5px; color: var(--text-2); }

/* Repeatable entries (education) */
.ap-entry + .ap-entry { margin-top: 22px; padding-top: 24px; border-top: 1px dashed var(--border); }
.ap-entry-bar { display: flex; justify-content: flex-end; }
.ap-entry-remove { background: none; border: 0; padding: 2px 0; margin-bottom: 6px; cursor: pointer; font-family: "Inter", sans-serif; font-size: 12.5px; color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; }
.ap-entry-remove[hidden] { display: none; }
.ap-entry-remove:hover { color: var(--text); }
.ap-add { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; background: none; border: 0; padding: 6px 0; cursor: pointer; font-family: "Inter", sans-serif; font-size: 14px; color: var(--text-2); transition: color .18s ease; }
.ap-add:hover { color: var(--text); }
.ap-add-ic { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-3); font-size: 16px; line-height: 1; transition: border-color .18s ease, color .18s ease; }
.ap-add:hover .ap-add-ic { border-color: #3a3a3a; color: var(--text); }

/* File upload */
.ap-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ap-file {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--base);
  border: 1px dashed var(--border); border-radius: 12px;
  cursor: pointer; color: var(--text-2);
  transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
}
.ap-file:hover { border-color: #3a3a3a; color: var(--text); }
.ap-file-ic { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none; border: 1px solid var(--border); border-radius: 7px; color: var(--text-3); font-size: 14px; }
.ap-file-text { font-family: "Inter", sans-serif; font-size: 14px; }
.ap-file-clear { display: inline-block; margin-top: 9px; background: none; border: 0; padding: 0; font-family: "Inter", sans-serif; font-size: 12.5px; color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ap-file-clear[hidden] { display: none; }
.ap-file-clear:hover { color: var(--text); }
.ap-file.has-file { border-style: solid; border-color: #3a3a3a; color: var(--text); }
.ap-file.has-file .ap-file-ic { color: var(--success); border-color: rgba(34,197,94,.4); }
.ap-file.is-invalid { border-color: var(--destructive); }

/* Inline errors */
.ap-error { display: none; font-family: "Inter", sans-serif; font-size: 12.5px; color: var(--destructive); margin-top: 7px; }
.ap-error.show { display: block; }

/* Submit */
.ap-submit-row { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.ap-submit { min-width: 200px; justify-content: center; }
.ap-submit[disabled] { opacity: .6; cursor: progress; }
.ap-consent { font-family: "Inter", sans-serif; font-size: 12.5px; line-height: 1.55; color: var(--text-3); max-width: 460px; margin: 0; }

/* ---------- Success state ---------- */
/* Top padding matches the height of .ap-back + its margin-bottom in the left rail, so the heading lines up with the APPLY eyebrow. */
.ap-done { padding: 51px 0 30px; max-width: 480px; }
.ap-done-mark { width: 46px; height: 46px; color: var(--success); margin-bottom: 24px; }
.ap-done-mark svg { width: 100%; height: 100%; display: block; }
.ap-done-h { font-size: clamp(28px, 3vw, 38px); font-weight: 400; letter-spacing: -.012em; margin: 0 0 14px; }
.ap-done-sub { font-family: "Inter", sans-serif; font-size: 16px; line-height: 1.62; color: var(--text-2); margin: 0 0 26px; }
.ap-done-back { font-family: "Inter", sans-serif; font-size: 15px; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; }
.ap-done-back span { color: var(--text-3); transition: transform .3s var(--ease), color .3s var(--ease); }
.ap-done-back:hover span { transform: translateX(4px); color: var(--text-2); }

/* Footer uses the shared .site-footer styling in styles.css. */

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .ap-grid { grid-template-columns: 1fr; gap: 38px; }
  .ap-rail-inner { position: static; }
  .ap-wrap { padding: 0 24px; }
  .ap-main { padding: 92px 0 90px; }
  .ap-back { margin-bottom: 30px; }
}
@media (max-width: 760px) {
  .ap-main { padding: 76px 0 72px; }
  .ap-wrap { padding: 0 22px; }
  .ap-grid { gap: 30px; }
  .ap-back { min-height: 44px; padding: 4px 0; margin-bottom: 18px; }
  .ap-role-title { font-size: clamp(28px, 7.6vw, 34px); line-height: 1.08; }
  .ap-role-blurb { font-size: 15px; line-height: 1.55; }
  .ap-done-h { font-size: clamp(28px, 7.6vw, 34px); line-height: 1.08; }
  .ap-done-sub { font-size: 15.5px; line-height: 1.55; }
  .ap-section { padding-top: 24px; margin-top: 24px; }
  .ap-row { grid-template-columns: 1fr; gap: 0; margin-bottom: 0; }
  .ap-row .ap-field { margin-bottom: 16px; }
  .ap-field { margin-bottom: 16px; }
  .ap-label { font-size: 13.5px; margin-bottom: 8px; }
  .ap-input {
    font-size: 16px; padding: 13px 14px;
    min-height: 48px; border-radius: 11px;
  }
  .ap-textarea { min-height: 132px; }
  .ap-dd-trigger {
    font-size: 16px; padding: 13px 14px; min-height: 48px;
  }
  .ap-dd-menu { max-height: 260px; }
  .ap-dd-opt { padding: 12px 12px; font-size: 15px; min-height: 44px; }
  .ap-file { padding: 16px 16px; min-height: 56px; }
  .ap-file-text { font-size: 14.5px; }
  .ap-file-clear { padding: 6px 0; min-height: 32px; }
  .ap-add {
    width: 100%; padding: 12px 0; min-height: 48px;
    font-size: 14.5px; justify-content: flex-start;
  }
  .ap-entry-remove { padding: 8px 0; min-height: 36px; font-size: 13px; }
  .ap-submit-row { margin-top: 26px; padding-top: 24px; gap: 14px; align-items: stretch; }
  .ap-submit { width: 100%; min-width: 0; min-height: 52px; padding: 14px 18px; font-size: 15.5px; }
  .ap-done { padding: 18px 0 12px; }
  .ap-done-sub { font-size: 15.5px; }
  .ap-done-back { font-size: 15px; padding: 8px 0; min-height: 44px; }
}
@media (max-width: 560px) {
  .ap-row { grid-template-columns: 1fr; gap: 0; margin-bottom: 0; }
  .ap-row .ap-field { margin-bottom: 18px; }
  .ap-submit { width: 100%; }
}
