/* ==========================================================================
   careers.css — Careers & Recruitment module
   Loaded AFTER css/style.css and extends it. Every colour, radius and shadow
   below reuses the tokens already defined in style.css, so the module is
   visually part of the existing site rather than a separate design system.
   ========================================================================== */

/* ===== Section headers on sub-pages ===== */
.career-intro {
  max-width: 760px;
  color: var(--text-light);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}
.career-intro strong { color: var(--text); }

/* ===== Authenticated shell (login / register / dashboard) ===== */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
  background: var(--bg-alt);
}
.auth-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}
.auth-card.wide { max-width: 680px; }
.auth-card h1 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
}
.auth-card .auth-sub {
  color: var(--text-light);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.auth-card .form-group { margin-bottom: 1.1rem; }
.auth-foot {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.7;
}
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ===== Form enhancements ===== */
.form-alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  border: 1px solid;
}
.form-alert[hidden] { display: none; }
.form-alert-error {
  background: #fdf0ef;
  border-color: #e8b4ae;
  color: #8a2a1c;
}
.form-alert-success {
  background: #eefaf1;
  border-color: #a9d9bb;
  color: #14532d;
}
.form-alert-info {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text);
}
.setup-notice {
  position: sticky;
  top: 0;
  z-index: 200;
  margin: 0;
  border-radius: 0;
  text-align: center;
}

.form-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 0.3rem;
  line-height: 1.5;
}
.field-error {
  display: block;
  font-size: 0.82rem;
  color: #8a2a1c;
  margin-top: 0.3rem;
  font-weight: 600;
}
.field-error[hidden] { display: none; }

input.has-error,
select.has-error,
textarea.has-error {
  border-color: #c0564a;
  background: #fffbfa;
}
input.has-error:focus,
select.has-error:focus,
textarea.has-error:focus {
  border-color: #8a2a1c;
}

.btn[disabled],
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}
.btn-block { width: 100%; justify-content: center; }
.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius);
}
.btn-danger {
  background: #8a2a1c;
  color: #fff;
}
.btn-danger:hover { background: #6f2115; color: #fff; }
.btn-ghost {
  background: var(--bg);
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent-text); color: var(--accent-text); }

/* Visible keyboard focus everywhere (§32) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ===== Choice cards (experience type) ===== */
.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.choice {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.choice label {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
  margin: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.choice input:checked + label {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.choice input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== OTP input (§7) ===== */
.otp-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.otp-input {
  letter-spacing: 0.4em;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  font-family: inherit;
}
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== Vacancy cards (§3) ===== */
.vacancy-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.vacancy-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem;
  align-items: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.vacancy-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}
.vacancy-card.is-closed { background: var(--bg-alt); }
.vacancy-card h3 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.vacancy-card.is-closed h3 { color: var(--text-light); }
.vacancy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: 0.87rem;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}
.vacancy-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.vacancy-card .vacancy-note {
  font-size: 0.85rem;
  color: var(--accent-text);
  font-weight: 600;
}
.vacancy-actions { display: flex; flex-direction: column; gap: 0.5rem; align-items: stretch; }
.vacancy-actions .btn { justify-content: center; white-space: nowrap; }

.tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--primary-light);
  font-weight: 600;
}
.tag-open { background: #eefaf1; border-color: #a9d9bb; color: #14532d; }
.tag-closed { background: #f1f5f9; color: var(--text-light); }
.tag-soon { background: #fdf8e8; border-color: #e6d3a3; color: var(--accent-text); }

/* ===== Vacancy detail ===== */
.vacancy-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2.5rem;
  align-items: start;
}
.vacancy-body h2 {
  font-size: 1.3rem;
  color: var(--primary);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
}
.vacancy-body h2:first-child { margin-top: 0; }
.vacancy-body ul { padding-left: 1.35rem; margin-bottom: 1rem; }
.vacancy-body li { margin-bottom: 0.4rem; line-height: 1.65; }
.vacancy-body p { line-height: 1.75; margin-bottom: 1rem; white-space: pre-line; }
.vacancy-aside {
  position: sticky;
  top: 5rem;
}
.vacancy-aside .panel {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.vacancy-aside h3 {
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
}
.definition-list { margin: 0; }
.definition-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.definition-list div:last-child { border-bottom: 0; }
.definition-list dt { color: var(--text-light); flex: 0 0 auto; }
.definition-list dd { margin: 0; font-weight: 600; text-align: right; }

.apply-panel { text-align: center; }
.apply-panel .btn { width: 100%; justify-content: center; }
.apply-panel p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* ===== Status badges (§15) ===== */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid;
}
.st-submitted   { background: #eef2f7; border-color: #c8d5e4; color: #2b5a8f; }
.st-review      { background: #fff8e6; border-color: #e8d08a; color: #7d5f14; }
.st-shortlisted { background: #eaf4ff; border-color: #a9cdf0; color: #14568f; }
.st-interview   { background: #f3ecff; border-color: #c6b1f0; color: #5b21b6; }
.st-selected    { background: #e9f9ef; border-color: #8ed3a8; color: #14603a; }
.st-rejected    { background: #fdf0ef; border-color: #e8b4ae; color: #8a2a1c; }
.st-withdrawn   { background: #f1f5f9; border-color: #d6dee9; color: #4a5b6e; }

/* ===== Dashboard (§15) ===== */
.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.dashboard-head h1 { font-size: 1.6rem; color: var(--primary); margin-bottom: 0.3rem; }
.dashboard-head .who { color: var(--text-light); font-size: 0.95rem; }

.profile-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.profile-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent);
}
.profile-card header h2 { font-size: 1.05rem; color: var(--primary); }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem 1.5rem;
}
.profile-grid dt { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.15rem; }
.profile-grid dd { margin: 0; font-weight: 600; font-size: 0.95rem; }

.verify-banner {
  background: #fdf8e8;
  border: 1px solid #e6d3a3;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
}

/* ===== Tables (§18) — responsive card transform on small screens ===== */
.table-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th,
.data-table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table thead th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--bg-alt); }
.data-table td.wrap { word-break: break-word; }
.data-table .num { text-align: right; }
th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover { background: var(--primary-light); }
th.sortable .sort-arrow { opacity: 0.45; margin-left: 0.3rem; font-size: 0.75rem; }
th.sortable[aria-sort="ascending"] .sort-arrow,
th.sortable[aria-sort="descending"] .sort-arrow { opacity: 1; color: var(--accent); }

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-light);
}
.empty-state h3 { color: var(--primary); font-size: 1.05rem; margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.92rem; margin-bottom: 1.25rem; }

.table-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-light);
}
.table-foot .pager { display: flex; gap: 0.4rem; align-items: center; }

@media (max-width: 760px) {
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tbody tr {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.35rem 0;
    margin-bottom: 0.85rem;
  }
  .data-table tbody tr:hover { background: var(--bg); }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px dashed var(--border);
    text-align: right;
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .data-table td.num { text-align: right; }
}

/* ===== Status timeline (§16) ===== */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 1.5rem 2.25rem;
  margin: 0;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
}
.timeline li::after {
  content: '';
  position: absolute;
  left: 0.79rem;
  top: 1.5rem;
  bottom: -0.15rem;
  width: 2px;
  background: var(--border);
}
.timeline li:last-child::after { display: none; }
.timeline li.is-done::before {
  background: var(--primary);
  border-color: var(--primary);
}
.timeline li.is-current::before {
  background: var(--accent);
  border-color: var(--accent-text);
  box-shadow: 0 0 0 4px rgba(200, 169, 81, 0.25);
}
.timeline li.is-terminal-negative::before { background: #8a2a1c; border-color: #8a2a1c; }
.timeline li.is-terminal-positive::before { background: #14603a; border-color: #14603a; }
.timeline .step-label {
  display: block;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}
.timeline li:not(.is-done):not(.is-current):not(.is-terminal-negative):not(.is-terminal-positive) .step-label {
  color: var(--text-light);
  font-weight: 500;
}
.timeline .step-meta { font-size: 0.82rem; color: var(--text-light); margin-top: 0.15rem; }
.timeline .step-note {
  font-size: 0.88rem;
  margin-top: 0.4rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  line-height: 1.55;
}

/* ===== Detail panes (admin + applicant) ===== */
.detail-pane {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.detail-pane > h2 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
}
.internal-note {
  background: #fdf8e8;
  border: 1px solid #e6d3a3;
  border-left: 4px solid var(--accent-text);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre-line;
}
.internal-note .internal-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-text);
  margin-bottom: 0.35rem;
}
.cover-letter {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-size: 0.93rem;
  line-height: 1.7;
  white-space: pre-line;
}

/* ===== File upload (§12) ===== */
.file-drop {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--bg-alt);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.file-drop:hover { border-color: var(--accent); background: #fdf8e8; }
.file-drop.is-dragover { border-color: var(--accent-text); background: #fdf3d4; }
.file-drop:focus-within { border-color: var(--accent-text); }
.file-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-drop .file-drop-title { font-weight: 700; color: var(--primary); font-size: 0.95rem; margin-bottom: 0.2rem; }
.file-drop .file-drop-hint { font-size: 0.82rem; color: var(--text-light); }
.file-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: #eefaf1;
  border: 1px solid #a9d9bb;
  border-radius: var(--radius);
  font-size: 0.88rem;
}
.file-selected strong { color: #14532d; word-break: break-all; }
.file-selected .file-size { color: var(--text-light); white-space: nowrap; }
.progress {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
  border: 1px solid var(--border);
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.2s;
}

/* ===== Success confirmation (§28) ===== */
.confirmation {
  text-align: center;
  padding: 3rem 1.5rem;
}
.confirmation .tick {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e9f9ef;
  border: 2px solid #8ed3a8;
  color: #14603a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.confirmation .tick svg { width: 32px; height: 32px; stroke: currentColor; stroke-width: 2.5; fill: none; }
.confirmation h1,
.confirmation h2 { font-size: 1.6rem; color: var(--primary); margin-bottom: 0.6rem; }
.confirmation p { color: var(--text-light); line-height: 1.7; max-width: 520px; margin: 0 auto 1.5rem; }

/* ===== Filter bar (admin, §18) ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}
.filter-bar .field { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-bar label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
}
.filter-bar input,
.filter-bar select {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  min-width: 9rem;
}
.filter-bar input:focus,
.filter-bar select:focus { outline: none; border-color: var(--primary-light); }
.filter-bar .grow { flex: 1 1 15rem; }
.filter-bar .grow input { width: 100%; }

/* ===== Admin shell ===== */
.admin-bar {
  background: var(--primary);
  color: #fff;
  padding: 1.15rem 0;
  border-bottom: 3px solid var(--accent);
}
.admin-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-bar h1 { font-size: 1.2rem; color: #fff; }
.admin-bar .admin-sub { font-size: 0.8rem; color: rgba(255, 255, 255, 0.7); margin-top: 0.15rem; }
.admin-bar .admin-identity { font-size: 0.85rem; color: rgba(255, 255, 255, 0.8); }
.admin-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.admin-tabs a {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.admin-tabs a:hover { color: var(--primary); }
.admin-tabs a.active { color: var(--primary); border-bottom-color: var(--accent); }

/* ===== Admin modal / drawer for create + edit ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 35, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  z-index: 500;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 720px;
  padding: 1.75rem;
}
.modal h2 { font-size: 1.25rem; color: var(--primary); margin-bottom: 1.25rem; }
.modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.modal .form-actions-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .modal .form-row { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 1rem 0.75rem; }
}

/* Stat counters (§21) */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.stat-tile .n {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-strong);
  line-height: 1.2;
}
.stat-tile .l { font-size: 0.8rem; color: var(--text-light); margin-top: 0.2rem; }

/* Count link that deep-links into the filtered applications table (§21) */
a.count-link {
  font-weight: 700;
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.count-link:hover { color: var(--accent-text); }

/* ===== Utility ===== */
.stack-sm > * + * { margin-top: 0.75rem; }
.stack > * + * { margin-top: 1.5rem; }
.muted { color: var(--text-light); }
.text-small { font-size: 0.85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Loading skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, #e6ecf3 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: skShimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius);
  height: 1rem;
  margin-bottom: 0.6rem;
}
@keyframes skShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Candidate pages
   The form system itself (.form-group, .form-actions, .field-error, .btn-*)
   already lives in css/style.css, and the listing components above already
   cover .vacancy-*, .auth-card, .choice-*, .otp-input, .timeline and
   .file-drop. Only the pieces that are genuinely new to the candidate pages
   live here, so there is one convention rather than two.
   ========================================================================== */

/* ===== Section headings inside forms ===== */
.form-section-title {
  font-size: 1.15rem;
  color: var(--primary);
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
}
.form-optional {
  font-weight: 400;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ===== Password field with a show/hide toggle ===== */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 4.25rem !important; }
.password-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
}
.password-toggle:hover { color: var(--primary); border-color: var(--primary-light); }
.password-toggle:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* ===== Consent checkbox ===== */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 1.25rem 0 0.5rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-light);
  cursor: pointer;
}
.checkbox-row input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

/* ===== Registration stepper (§5) ===== */
.stepper {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  flex-wrap: wrap;
}
.stepper-step {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}
.stepper-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-light);
}
.stepper-step.is-active {
  color: var(--primary);
  border-color: var(--accent-text);
  background: #fdf8e8;
}
.stepper-step.is-active .stepper-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.stepper-step.is-done { color: #14603a; border-color: #a9d9bb; background: #eefaf1; }
.stepper-step.is-done .stepper-num { background: #14603a; border-color: #14603a; color: #fff; }

/* ===== Loading / feedback states ===== */
.loading-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-light);
  font-size: 0.9rem;
}
.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 0.85rem;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Monospace reference numbers ===== */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  letter-spacing: 0.02em;
}

/* ===== Apply page summary ===== */
.apply-summary {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}
.apply-summary .form-section-title { margin-top: 0; }
.apply-summary .definition-list div { padding: 0.35rem 0; }

/* Remove button on the selected-file chip */
.file-selected .remove-file {
  background: none;
  border: 1px solid #a9d9bb;
  border-radius: calc(var(--radius) - 2px);
  color: #14532d;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.5rem;
  cursor: pointer;
}
.file-selected .remove-file:hover { background: #d8f0e2; }
.file-selected .remove-file:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* ===== Vacancy detail hero location ===== */
.vac-hero-location {
  font-weight: 600;
  color: var(--primary);
}

/* ===== Applicant dashboard (§15, §16) ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
}
.dashboard-aside .panel {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}
.dashboard-aside .panel h3 {
  font-size: 0.95rem;
  color: var(--primary);
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
}
.dashboard-main > .section-title { margin-top: 0; }

.application-list { display: flex; flex-direction: column; gap: 1.25rem; }
.application-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.application-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.application-head h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin: 0 0 0.2rem;
}
.application-head h3 a { color: var(--primary); }
.application-head h3 a:hover { color: var(--accent-text); }
.application-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-light);
}
.application-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.9rem;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
}
.application-facts dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-bottom: 0.15rem;
}
.application-facts dd { margin: 0; font-weight: 600; font-size: 0.92rem; }
.application-cover {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
}
.application-cover summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.application-cover p {
  margin: 0.6rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  white-space: pre-line;
  line-height: 1.7;
}
.application-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .application-head { flex-direction: column; align-items: flex-start; }
}

/* ===== Print ===== */
@media print {
  .header, .footer, .whatsapp-float, .admin-bar, .admin-tabs,
  .filter-bar, .vacancy-aside, .form-alert, .table-foot { display: none !important; }
  .detail-pane, .table-wrap { border: 1px solid #ccc; box-shadow: none; }
  body { color: #000; }
}