/* Applying to a job posted on InternBoard - the drawer apply-form.js fills
   (the form, an application already sent, reporting a job), and the marks
   an application sent here leaves in the Tracker. The questions themselves
   are form-blocks.css. Every colour is a token from styles.css.

   Applying is the employer workspace's indigo (--accent2): the colour of
   "InternBoard's own jobs" wherever a student meets one. */

/* ---- The drawer ---- */
.apply-overlay .apply-drawer { width: min(640px, 100vw); padding: 0; display: flex; flex-direction: column; }
.apply-drawer-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 22px 28px 16px; border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 1;
}
.apply-drawer-heading { min-width: 0; }
.apply-drawer-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent2-dark); }
.apply-drawer-title { margin: 4px 0 2px; font-size: 20px; color: var(--ink); overflow-wrap: anywhere; }
.apply-drawer-title:focus { outline: none; }
.apply-drawer-company { font-size: 14px; color: var(--muted-strong); }
.apply-drawer-header .drawer-close { flex: none; }
.apply-drawer-body { padding: 20px 28px 28px; }

/* ---- Steps ---- */
.apply-steps {
  display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0 0 20px; padding: 0 0 14px;
  border-bottom: 1px solid var(--border); counter-reset: apply-step;
}
.apply-steps li {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  counter-increment: apply-step;
}
.apply-steps li::before {
  content: counter(apply-step); width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid currentColor; font-size: 11.5px;
}
.apply-steps li.is-done { color: var(--muted-strong); }
.apply-steps li.is-current { color: var(--accent2-dark); }
.apply-steps li.is-current::before { background: var(--accent2); border-color: var(--accent2); color: #FFFFFF; }

.apply-page-title { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.apply-page-help, .apply-intro { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* ---- Your details ---- */
.apply-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin-bottom: 8px; }
.apply-fields .field:first-child { grid-column: 1 / -1; }
.apply-fields [aria-invalid="true"] { border-color: var(--danger); background: var(--danger-bg); }
.apply-error { font-size: 12.5px; color: var(--danger); margin-top: 5px; }
.apply-error:empty { display: none; }

.apply-choice-group { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.apply-choice-group legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.apply-choice {
  display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--text);
}
.apply-choice:has(input:checked) { border-color: var(--accent2); background: var(--accent2-soft); }
/* The global input rule would stretch the radio across the card. */
.apply-choice input { width: auto; flex: none; margin: 0; accent-color: var(--accent2); }
.apply-choice-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.apply-choice-text strong { font-size: 14px; color: var(--ink); }
.apply-choice-text span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.apply-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 2px 0 40px; }
.apply-upload[hidden] { display: none; }
.apply-upload input[type="file"] { width: auto; max-width: 100%; padding: 7px 9px; background: var(--surface); }
.apply-chosen { font-size: 12.5px; color: var(--accent2-dark); font-weight: 600; }

/* ---- Self-identification ---- */
.apply-selfid-intro {
  margin: 0 0 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-soft);
  border: 1px solid var(--border); font-size: 13.5px; color: var(--text); line-height: 1.55;
}
.apply-selfid-intro p { margin: 0; }
.apply-selfid-intro p + p { margin-top: 6px; color: var(--muted); }

/* ---- Review ---- */
.apply-review-section { padding: 14px 0; border-top: 1px solid var(--border); }
.apply-review-section:first-of-type { border-top: 0; padding-top: 0; }
.apply-review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.apply-review-section h4 { margin: 0 0 8px; font-size: 14px; color: var(--ink); font-family: 'Space Grotesk', sans-serif; }
.apply-review-head .btn-link { color: var(--accent2-dark); font-size: 13px; }
.apply-review-section dl { margin: 0; display: grid; gap: 8px; }
.apply-review-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; }
.apply-review-row dt { font-size: 13px; color: var(--muted-strong); font-weight: 600; }
.apply-review-row dd { margin: 0; font-size: 13.5px; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.apply-review-note { margin: 0; font-size: 13px; color: var(--muted); }
.apply-files { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.8; }
.apply-files span { color: var(--muted-strong); margin-right: 4px; }

/* The drawer is too narrow for a skill's name and five levels on one line:
   the name goes above its levels, as on a phone. */
.apply-drawer .form-skill-row { grid-template-columns: 1fr; gap: 6px; }
.apply-drawer .form-skill-row legend { float: none; }
.apply-drawer .form-skill-levels { grid-column: 1; }

/* ---- Moving on, and what the server said ---- */
.apply-nav { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.apply-nav button { margin: 0; }
.apply-nav #applyNext, .apply-nav #applySubmit, .apply-nav #applyReportSend { margin-left: auto; }
.apply-status { margin-top: 10px; font-size: 13px; color: var(--danger); }
.apply-status:empty { display: none; }
.apply-safety { margin-top: 22px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.apply-safety .btn-link { font-size: 12.5px; color: var(--muted-strong); }

/* ---- Sent, already sent, closed ---- */
.apply-success { text-align: center; padding: 24px 8px; }
.apply-success-mark {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent2-soft); color: var(--accent2-dark); font-size: 26px; font-weight: 700;
}
.apply-success h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.apply-success p { margin: 0 auto; max-width: 44ch; font-size: 14px; color: var(--muted); line-height: 1.55; }
.apply-success .apply-actions { justify-content: center; }
.apply-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.apply-actions button { margin: 0; }
.apply-actions .apply-withdraw { color: var(--danger); border-color: var(--danger-border); }
.apply-status-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.apply-status-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700; background: var(--accent2-soft); color: var(--accent2-dark); border: 1px solid var(--accent2-border);
}
.apply-status-chip.is-withdrawn, .apply-status-chip.is-not-selected { background: var(--neutral-bg); color: var(--muted-strong); border-color: var(--border); }
.apply-status-chip.is-offer, .apply-status-chip.is-interview { background: var(--good-bg); color: var(--accent-dark); border-color: var(--accent-border); }
.apply-sent-on { font-size: 13px; color: var(--muted); }
.apply-status-help { margin: 10px 0 0; font-size: 13.5px; color: var(--text); line-height: 1.55; }
.apply-sent-detail { margin-top: 16px; }
.apply-sent-detail:empty { display: none; }
.apply-closed { padding: 16px 0; }
.apply-report textarea { min-height: 90px; }

/* ---- The Tracker: an application sent here ---- */
.application-via-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.application-via {
  padding: 2px 9px; border-radius: var(--radius-pill); background: var(--accent2); color: #FFFFFF;
  font-size: 11.5px; font-weight: 700;
}
.employer-status-pill {
  padding: 2px 9px; border-radius: var(--radius-pill); border: 1px solid var(--accent2-border);
  background: var(--accent2-soft); color: var(--accent2-dark); font-size: 11.5px; font-weight: 600;
}
.employer-status-pill.is-withdrawn, .employer-status-pill.is-not-selected { background: var(--neutral-bg); border-color: var(--border); color: var(--muted-strong); }
.application-sent-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.application-sent-actions .small-btn { margin: 0; }

@media (max-width: 760px) {
  .apply-drawer-header { padding: 16px 16px 12px; }
  .apply-drawer-body { padding: 16px 16px 24px; }
  .apply-fields { grid-template-columns: 1fr; }
  .apply-review-row { grid-template-columns: 1fr; gap: 2px; }
  .apply-upload { padding-left: 0; }
}
