/* =========================================================
   MEP — espace Carrière
   Couche stable : architecture, cycle et cockpit Carrière.
   ========================================================= */

:root {
  --mep-career: #315f9b;
  --mep-career-dark: #244d82;
  --mep-career-soft: #eef4fb;
  --mep-career-line: #d9e4f1;
  --mep-career-ink: #142235;
  --mep-career-muted: #657487;
}

/* ---------- Fil conducteur commun ---------- */
.mep-career-journey {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--mep-shell-line, #e1e9e4);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(20, 34, 53, .055);
}

.mep-career-journey-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--mep-career-ink) !important;
  text-decoration: none !important;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.mep-career-journey-item:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.mep-career-journey-item.is-active {
  background: var(--mep-career-soft);
  box-shadow: inset 0 0 0 1px var(--mep-career-line);
}

.mep-career-journey-step {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f0f3f6;
  color: #6c7783;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
}

.mep-career-journey-item.is-active .mep-career-journey-step {
  background: var(--mep-career);
  color: #fff;
}

.mep-career-journey-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mep-career-journey-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.15;
}

.mep-career-journey-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--mep-career-muted);
  font-size: 10px;
}

.mep-career-journey-count {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #edf1f5;
  color: #586878;
  font-size: 10px;
}

.mep-career-journey-item.is-active .mep-career-journey-count {
  background: #fff;
  color: var(--mep-career-dark);
}

/* ---------- Dashboard Carrière reconstruit ---------- */
.mep-career-dashboard {
  width: min(1280px, calc(100% - 40px));
  margin: 34px auto 76px;
  color: var(--mep-career-ink);
}

.mep-career-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.mep-career-hero-main,
.mep-career-hero-status {
  border: 1px solid var(--mep-shell-line, #e1e9e4);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(20, 34, 53, .06);
}

.mep-career-hero-main {
  padding: 30px;
  background:
    radial-gradient(circle at 90% 10%, rgba(49, 95, 155, .12), transparent 33%),
    linear-gradient(145deg, #fff, #f8fbff);
}

.mep-career-eyebrow {
  margin: 0 0 7px;
  color: var(--mep-career);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.mep-career-hero h1 {
  margin: 0;
  font-size: clamp(31px, 4vw, 47px);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.mep-career-hero-main > p:not(.mep-career-eyebrow) {
  max-width: 700px;
  margin: 11px 0 0;
  color: var(--mep-career-muted);
  font-size: 14px;
  line-height: 1.65;
}

.mep-career-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.mep-career-btn {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid #d7e0ea;
  border-radius: 11px;
  background: #fff;
  color: var(--mep-career-ink) !important;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none !important;
}

.mep-career-btn.is-primary {
  border-color: var(--mep-career);
  background: var(--mep-career);
  color: #fff !important;
}

.mep-career-hero-status {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mep-career-status-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mep-career-muted);
  font-size: 11px;
  font-weight: 850;
}

.mep-career-status-label i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--mep-career);
  box-shadow: 0 0 0 5px rgba(49, 95, 155, .10);
}

.mep-career-hero-status strong {
  display: block;
  margin: 11px 0 4px;
  font-size: 23px;
  letter-spacing: -.035em;
}

.mep-career-hero-status p {
  margin: 0;
  color: var(--mep-career-muted);
  font-size: 12px;
  line-height: 1.55;
}

.mep-career-readiness {
  margin-top: 18px;
}

.mep-career-readiness-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 10px;
  color: var(--mep-career-muted);
}

.mep-career-readiness-head b { color: var(--mep-career-ink); }

.mep-career-readiness-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f5;
}

.mep-career-readiness-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mep-career), #4c7dbb);
}

.mep-career-next {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin: 0 0 18px;
  padding: 15px 17px;
  border: 1px solid var(--mep-career-line);
  border-radius: 16px;
  background: var(--mep-career-soft);
}

.mep-career-next.is-urgent {
  border-color: #efc9c4;
  background: #fff6f5;
}

.mep-career-next-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  color: var(--mep-career);
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 4px 15px rgba(20, 34, 53, .07);
}

.mep-career-next.is-urgent .mep-career-next-icon { color: #a84438; }
.mep-career-next-copy { min-width: 0; display: grid; gap: 2px; }
.mep-career-next-copy span { color: var(--mep-career); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.mep-career-next-copy strong { font-size: 14px; }
.mep-career-next-copy small { color: var(--mep-career-muted); font-size: 11px; }
.mep-career-next > a { color: var(--mep-career-dark) !important; font-size: 11px; font-weight: 900; text-decoration: none !important; white-space: nowrap; }

.mep-career-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.mep-career-kpi {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--mep-shell-line, #e1e9e4);
  border-radius: 15px;
  background: #fff;
  color: var(--mep-career-ink) !important;
  text-decoration: none !important;
}

.mep-career-kpi:hover { border-color: var(--mep-career-line); box-shadow: 0 8px 24px rgba(20, 34, 53, .06); }
.mep-career-kpi small { color: var(--mep-career-muted); font-size: 10px; font-weight: 800; }
.mep-career-kpi strong { font-size: 28px; line-height: 1; letter-spacing: -.04em; }
.mep-career-kpi span { color: #778597; font-size: 10px; }
.mep-career-kpi.is-alert strong { color: #a84438; }

.mep-career-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
  gap: 14px;
  margin-bottom: 14px;
}

.mep-career-card {
  border: 1px solid var(--mep-shell-line, #e1e9e4);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(20, 34, 53, .045);
}

.mep-career-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
}

.mep-career-card-head h2 { margin: 2px 0 0; font-size: 18px; letter-spacing: -.025em; }
.mep-career-card-head a { color: var(--mep-career-dark) !important; font-size: 10px; font-weight: 900; text-decoration: none !important; }

.mep-career-priority-list { display: grid; padding: 0 10px 10px; }
.mep-career-priority {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 8px;
  border-top: 1px solid #edf1f4;
  color: var(--mep-career-ink) !important;
  text-decoration: none !important;
}
.mep-career-priority:first-child { border-top: 0; }
.mep-career-priority-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: #f2f6fa; }
.mep-career-priority span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.mep-career-priority strong { font-size: 12px; }
.mep-career-priority small { color: var(--mep-career-muted); font-size: 10px; }
.mep-career-priority time { color: #7e8a98; font-size: 10px; font-weight: 850; }
.mep-career-priority.is-urgent .mep-career-priority-icon { background: #fff0ee; color: #a84438; }

.mep-career-app-list { display: grid; padding: 0 10px 10px; }
.mep-career-app {
  display: grid;
  grid-template-columns: minmax(120px, .65fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-top: 1px solid #edf1f4;
  color: var(--mep-career-ink) !important;
  text-decoration: none !important;
}
.mep-career-app:first-child { border-top: 0; }
.mep-career-app-company { font-size: 11px; font-weight: 900; }
.mep-career-app-job { min-width: 0; display: grid; gap: 2px; font-size: 11px; font-weight: 750; }
.mep-career-app-job small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mep-career-muted); font-size: 9px; font-weight: 500; }
.mep-career-status { padding: 5px 8px; border-radius: 999px; background: #f0f3f6; color: #657487; font-size: 9px; font-weight: 900; white-space: nowrap; }
.mep-career-status.is-positive { background: #eaf7ef; color: #287047; }
.mep-career-status.is-negative { background: #fff0ee; color: #a84438; }
.mep-career-status.is-waiting { background: #eef4fb; color: #315f9b; }

.mep-career-base {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.mep-career-base-score { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 13px; align-items: center; }
.mep-career-base-score > b { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--mep-career) calc(var(--career-score, 0) * 1%), #edf1f5 0); position: relative; font-size: 18px; }
.mep-career-base-score > b::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.mep-career-base-score > b span { position: relative; z-index: 1; }
.mep-career-base-score div { display: grid; gap: 4px; }
.mep-career-base-score strong { font-size: 13px; }
.mep-career-base-score small { color: var(--mep-career-muted); font-size: 10px; line-height: 1.5; }

.mep-career-base-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.mep-career-base-facts span { padding: 10px; border-radius: 11px; background: #f7f9fb; text-align: center; color: var(--mep-career-muted); font-size: 9px; }
.mep-career-base-facts strong { display: block; margin-bottom: 2px; color: var(--mep-career-ink); font-size: 16px; }

.mep-career-empty { padding: 22px 18px; color: var(--mep-career-muted); font-size: 11px; }
.mep-career-empty a { color: var(--mep-career-dark) !important; font-weight: 850; }

.mep-career-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0;
}

.mep-career-quick-actions a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--mep-shell-line, #e1e9e4);
  border-radius: 13px;
  background: #fff;
  color: var(--mep-career-ink) !important;
  text-decoration: none !important;
}
.mep-career-quick-actions b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--mep-career-soft); color: var(--mep-career); }
.mep-career-quick-actions span { display: grid; gap: 1px; min-width: 0; }
.mep-career-quick-actions strong { font-size: 11px; }
.mep-career-quick-actions small { color: var(--mep-career-muted); font-size: 9px; }

/* ---------- Mise en cohérence des grandes pages Carrière ---------- */
body:has(.applications-final.salaried-opportunities) .mep-career-journey,
body:has(.applications-final.salaried-pipeline-v2) .mep-career-journey,
body:has(.salaried-current-role) .mep-career-journey,
body:has(.salaried-evolution-page) .mep-career-journey,
body:has(.documents-page-simple) .mep-career-journey,
body:has(.mep-path-page) .mep-career-journey,
body:has(.mep-live-profile) .mep-career-journey { margin-top: 24px; }

.applications-final.salaried-opportunities,
.applications-final.salaried-pipeline-v2,
.applications-final.salaried-current-role,
.applications-final.salaried-evolution-page,
.documents-page-simple,
.mep-path-page,
.mep-live-profile {
  width: min(1280px, calc(100% - 40px));
  margin-left: auto;
  margin-right: auto;
}

.applications-final.salaried-opportunities .applications-final-hero,
.applications-final.salaried-pipeline-v2 .applications-final-hero,
.applications-final.salaried-current-role .applications-final-hero,
.applications-final.salaried-evolution-page .applications-final-hero,
.documents-page-simple .documents-page-header,
.mep-path-page .mep-path-hero-final,
.mep-live-profile .mep-live-profile-hero {
  border-radius: 22px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .mep-career-journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mep-career-hero { grid-template-columns: 1fr; }
  .mep-career-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mep-career-grid { grid-template-columns: 1fr; }
  .mep-career-quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .mep-career-dashboard,
  .mep-career-journey,
  .applications-final.salaried-opportunities,
  .applications-final.salaried-pipeline-v2,
  .applications-final.salaried-current-role,
  .applications-final.salaried-evolution-page,
  .documents-page-simple,
  .mep-path-page,
  .mep-live-profile { width: min(100% - 22px, 1280px); }

  .mep-career-dashboard { margin-top: 18px; }
  .mep-career-journey { grid-template-columns: 1fr 1fr; padding: 6px; gap: 5px; margin-bottom: 14px; }
  .mep-career-journey-item { grid-template-columns: 27px minmax(0, 1fr); padding: 9px; }
  .mep-career-journey-step { width: 27px; height: 27px; }
  .mep-career-journey-count { display: none; }
  .mep-career-journey-copy small { display: none; }
  .mep-career-hero-main, .mep-career-hero-status { border-radius: 18px; }
  .mep-career-hero-main { padding: 22px; }
  .mep-career-hero-status { padding: 19px; }
  .mep-career-kpis { grid-template-columns: 1fr 1fr; }
  .mep-career-next { grid-template-columns: 38px minmax(0, 1fr); }
  .mep-career-next > a { grid-column: 2; }
  .mep-career-app { grid-template-columns: minmax(0, 1fr) auto; }
  .mep-career-app-company { grid-column: 1; }
  .mep-career-app-job { grid-column: 1; }
  .mep-career-status { grid-column: 2; grid-row: 1 / span 2; }
  .mep-career-quick-actions { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .mep-career-journey-item { transition: none; }
}

/* ---------- Recherche et candidatures : deux moments distincts ---------- */
.mep-career-search-stages {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.mep-career-search-stages .mep-career-stage-next {
  border-style: dashed;
  background: #f8fbff;
}

.mep-career-search-stages .mep-career-stage-next span,
.mep-career-search-stages .mep-career-stage-next strong {
  color: var(--mep-career) !important;
}

.mep-career-pipeline-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 4px 0 8px;
  padding: 10px 14px;
  border: 1px solid var(--mep-career-line);
  border-radius: 12px;
  background: var(--mep-career-soft);
  color: var(--mep-career-muted);
  font-size: 10px;
  font-weight: 800;
}

.mep-career-pipeline-context > span {
  text-transform: uppercase;
  letter-spacing: .08em;
}

.mep-career-pipeline-context a {
  color: var(--mep-career-dark) !important;
  text-decoration: none !important;
}

.mep-career-pipeline-context b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-right: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
}

.mep-career-application-stages {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}

@media (max-width: 980px) {
  .mep-career-search-stages,
  .mep-career-application-stages {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 5px;
  }

  .mep-career-search-stages > a,
  .mep-career-application-stages > a {
    min-width: 145px;
    scroll-snap-align: start;
  }
}

@media (max-width: 640px) {
  .mep-career-pipeline-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

.mep-career-search-sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0 18px;
}

.mep-career-search-sources a {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--mep-career-line);
  border-radius: 14px;
  background: #fff;
  color: var(--mep-career-ink) !important;
  text-decoration: none !important;
}

.mep-career-search-sources a:hover { background: #f8fbff; }
.mep-career-search-sources b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--mep-career-soft); color: var(--mep-career); font-size: 11px; }
.mep-career-search-sources span { min-width: 0; display: grid; gap: 3px; }
.mep-career-search-sources strong { font-size: 11px; }
.mep-career-search-sources small { color: var(--mep-career-muted); font-size: 9px; line-height: 1.35; }
.mep-career-search-sources i { color: var(--mep-career); font-style: normal; font-weight: 900; }

@media (max-width: 760px) {
  .mep-career-search-sources { grid-template-columns: 1fr; }
}
