/**
 * ERP Public Overrides
 *
 * The public ERP pages (/erp/jobs, /erp/jobs/apply) reuse the v2 dashboard
 * design tokens (`/static/dashboard/styles/global.css`) but drop the
 * sidebar and use a centered single-column layout instead. This file
 * contains only the handful of overrides needed to make that work.
 */

/* Pull body content underneath the fixed header bar (same height as the dashboard header).
   The header itself is injected by ErpHeader with the same `.top-header*`
   classes + CSS used by the v2 dashboard header — nothing to define here. */
body {
  padding-top: var(--header-h);
  background: var(--gray-50);
}

.erp-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* Jobs list — cards */
.erp-jobs-head {
  display: flex; flex-direction: column; gap: 6px;
  margin: 10px 0 24px;
}
.erp-jobs-head h1 {
  font-size: 1.8rem; font-weight: 800; margin: 0;
}
.erp-jobs-head p {
  margin: 0; color: var(--gray-500); font-size: .95rem;
}

.erp-jobs-list {
  display: flex; flex-direction: column; gap: 14px;
}
.erp-job-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.erp-job-card:hover,
.erp-job-card:focus-visible {
  border-color: var(--black);
  box-shadow: 0 1px 0 var(--black);
  outline: none;
}
.erp-job-card__top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.erp-job-card__title {
  font-size: 1.1rem; font-weight: 700; margin: 0;
}
.erp-job-card__actions {
  display: flex; align-items: center; gap: 8px;
}
.erp-job-card__meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: .82rem; color: var(--gray-500);
}
.erp-job-card__meta i { margin-right: 6px; }
.erp-job-card__desc {
  font-size: .9rem; line-height: 1.5; color: var(--black);
  max-height: 160px; overflow: hidden;
  position: relative;
}
.erp-job-card__desc::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 48px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--white));
  pointer-events: none;
}
.erp-job-card__desc p { margin: 0 0 8px; }
.erp-job-card__desc p:last-child { margin-bottom: 0; }
.erp-job-card__foot {
  margin-top: 2px;
}
.erp-job-card__more {
  font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--black); text-decoration: none;
  display: inline-flex; align-items: center;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.erp-job-card__more:hover { border-bottom-color: var(--red); color: var(--red); }

/* Single-job detail view */
.erp-job-detail {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 28px 30px 32px;
}
.erp-back-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-500); text-decoration: none;
  margin-bottom: 14px;
}
.erp-back-link:hover { color: var(--black); }
.erp-back-link i { font-size: .9rem; }
.erp-job-detail__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.erp-job-detail__title {
  font-size: 1.8rem; font-weight: 800; margin: 0;
  line-height: 1.2;
}
.erp-job-detail__meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: .86rem; color: var(--gray-500);
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}
.erp-job-detail__meta i { margin-right: 6px; }
.erp-job-detail__body {
  font-size: .95rem; line-height: 1.65; color: var(--black);
}
.erp-job-detail__body h1,
.erp-job-detail__body h2,
.erp-job-detail__body h3 {
  margin: 20px 0 8px; font-weight: 800;
}
.erp-job-detail__body h2 { font-size: 1.1rem; }
.erp-job-detail__body h3 { font-size: .98rem; text-transform: uppercase; letter-spacing: .04em; }
.erp-job-detail__body p { margin: 0 0 10px; }
.erp-job-detail__body ul,
.erp-job-detail__body ol { margin: 0 0 10px 20px; padding: 0; }
.erp-job-detail__body li { margin-bottom: 4px; }
.erp-job-detail__body blockquote {
  margin: 12px 0; padding: 6px 14px;
  border-left: 3px solid var(--gray-300);
  color: var(--gray-500);
}
.erp-job-detail__body a { color: var(--red); text-decoration: underline; }
.erp-job-detail__foot {
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--gray-200);
  display: flex; justify-content: flex-end;
}

.erp-empty {
  background: var(--white);
  border: 1px dashed var(--gray-200);
  padding: 60px 20px;
  text-align: center;
  color: var(--gray-500);
  font-size: .95rem;
}

/* Shared page-head adjustments for the apply page */
.erp-apply-head {
  display: flex; align-items: baseline; gap: 16px;
  margin: 4px 0 6px; flex-wrap: wrap;
}
.erp-apply-head h1 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.erp-apply-context {
  display: inline-block;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  padding: 4px 10px; font-size: .78rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--black);
}

.erp-apply-lede {
  color: var(--gray-500); font-size: .92rem; margin: 0 0 20px;
}

/* Form card layout */
.erp-form {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 28px 28px 24px;
}

.erp-section { margin-top: 24px; }
.erp-section:first-child { margin-top: 0; }
.erp-section__title {
  font-size: .86rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
  padding-bottom: 8px; margin: 0 0 14px;
  border-bottom: 2px solid var(--black);
}
.erp-section__note {
  font-size: .82rem; color: var(--gray-500);
  margin: -6px 0 12px;
}

.erp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.erp-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.erp-field { display: flex; flex-direction: column; gap: 4px; }
.erp-field--full { grid-column: 1 / -1; }

.erp-label {
  font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--black);
}
.erp-label__required { color: var(--red); margin-left: 3px; }

.erp-input, .erp-select, .erp-textarea {
  width: 100%;
  font-family: inherit; font-size: .92rem;
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  background: var(--white); color: var(--black);
  border-radius: 0;
  outline: none;
  transition: border-color var(--transition);
  box-sizing: border-box;
}
.erp-textarea { resize: vertical; min-height: 80px; }
.erp-input:focus, .erp-select:focus, .erp-textarea:focus {
  border-color: var(--black);
}

/* Yes/No twin checkboxes */
.erp-yesno {
  display: flex; align-items: center; gap: 16px;
  padding: 4px 0;
}
.erp-yesno__option {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: .9rem; font-weight: 600;
}
.erp-yesno__option input {
  width: 18px; height: 18px; margin: 0;
  accent-color: var(--black);
  cursor: pointer;
}

/* Multi-select pill checkboxes (availability) */
.erp-pills {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0;
}
.erp-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--gray-300);
  background: var(--white); color: var(--black);
  font-size: .88rem; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.erp-pill input { width: 16px; height: 16px; accent-color: var(--black); cursor: pointer; }
.erp-pill--checked {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
}

/* File input */
.erp-file { padding: 6px 8px; }

.erp-help {
  font-size: .78rem; color: var(--gray-500); margin-top: 2px;
}
.erp-error-text {
  color: var(--red); font-size: .8rem; margin-top: 4px; font-weight: 600;
}

/* Repeater (employment history) */
.erp-repeater {
  display: flex; flex-direction: column; gap: 14px;
}
.erp-job-entry {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 16px 18px;
  position: relative;
}
.erp-job-entry__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.erp-job-entry__title {
  font-size: .9rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  margin: 0;
}
.erp-btn-link {
  background: none; border: none; padding: 0;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  color: var(--red); text-transform: uppercase; letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: 4px;
}
.erp-btn-link:hover { color: var(--red-dark); }
.erp-btn-link:disabled { color: var(--gray-300); cursor: not-allowed; }

.erp-add-row {
  display: flex; align-items: center; justify-content: center;
  padding: 10px; margin-top: 10px;
  border: 1px dashed var(--gray-300);
  background: var(--white);
  font-size: .88rem; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: .04em;
}
.erp-add-row:hover:not(:disabled) { border-color: var(--black); background: var(--gray-50); }
.erp-add-row:disabled { opacity: .5; cursor: not-allowed; }

/* Consent & submit */
.erp-consent {
  display: flex; gap: 10px;
  background: var(--yellow-light);
  border: 1px solid var(--yellow-border);
  padding: 14px 16px;
  margin-top: 20px;
}
.erp-consent input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--black); cursor: pointer;
}
.erp-consent__text { font-size: .88rem; line-height: 1.5; }
.erp-consent__text strong { display: block; margin-bottom: 4px; font-weight: 800; }

.erp-submit-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 22px;
}
.erp-submit-status {
  font-size: .85rem; color: var(--gray-500); min-height: 1em;
}
.erp-submit-status--error { color: var(--red); font-weight: 600; }
.erp-submit-status--ok { color: #1a6b37; font-weight: 600; }

/* Success view after submit */
.erp-success {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 40px 40px 32px;
  text-align: center;
}
.erp-success h1 {
  font-size: 1.5rem; font-weight: 800; margin: 0 0 8px;
}
.erp-success p { color: var(--gray-500); margin: 0 0 20px; font-size: .95rem; }

/* Narrow-screen collapses */
@media (max-width: 720px) {
  .erp-grid, .erp-grid--3 { grid-template-columns: 1fr; }
  .erp-main { padding: 20px 16px 60px; }
  .erp-form { padding: 20px 18px; }
  .erp-job-detail { padding: 22px 20px 24px; }
  .erp-job-detail__title { font-size: 1.4rem; }
  .erp-job-detail__head { gap: 10px; }
  .erp-job-detail__foot { justify-content: stretch; }
  .erp-job-detail__foot .btn-primary { width: 100%; }
  .top-header { padding: 0 16px; }
  .top-header__label { margin-left: 10px; padding-left: 10px; }
}
