/* ============================================================================
   fiche-poste.css — Onglet Fiche de poste de la page mission-detail
   À placer dans : assets/css/views/fiche-poste.css
   ============================================================================
   NOTE : Le parent .mission-detail-content fournit déjà padding: 24px et
   background: var(--bg). On NE rajoute PAS de padding ni de background ici.
   On s'aligne sur le pattern .reponses-tab (max-width: 900px, margin auto).
   ============================================================================ */

.fp-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

/* ─── DROP ZONE PDF ────────────────────────────────────────────────────── */
.fp-dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(26, 58, 143, 0.04);
  border: 1.5px dashed rgba(26, 58, 143, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}
.fp-dropzone:hover,
.fp-dropzone:focus-visible {
  background: rgba(26, 58, 143, 0.08);
  border-color: var(--logo-blue);
  border-style: solid;
}
.fp-dropzone--over {
  background: rgba(26, 58, 143, 0.12);
  border-color: var(--logo-blue);
  border-style: solid;
}
.fp-dropzone--loading {
  pointer-events: none;
  opacity: 0.6;
}
.fp-dropzone-icon {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}
.fp-dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.fp-dropzone-text strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--logo-blue);
}
.fp-dropzone-text span {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.55);
}
.fp-dropzone-spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(26, 58, 143, 0.2);
  border-top-color: var(--logo-blue);
  border-radius: 50%;
  animation: fp-spin 0.7s linear infinite;
  flex-shrink: 0;
}
.fp-dropzone--loading .fp-dropzone-spinner {
  display: block;
}
@keyframes fp-spin {
  to { transform: rotate(360deg); }
}

/* ─── SECTIONS ─────────────────────────────────────────────────────────── */
.fp-section {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 18px 20px;
}
.fp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.fp-section-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.5);
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fp-section-header .fp-section-title {
  margin-bottom: 0;
}
.fp-count-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--logo-blue);
  color: #ffffff;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
}

/* ─── GRID & STACK ─────────────────────────────────────────────────────── */
.fp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 14px;
}
.fp-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── FIELDS ───────────────────────────────────────────────────────────── */
.fp-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.fp-field--full {
  grid-column: 1 / -1;
}
.fp-label {
  font-size: 10px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.fp-input,
.fp-select,
.fp-textarea {
  font-family: var(--font, inherit);
  font-size: 13px;
  color: #1a1a1a;
  background: #f4f6fb;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  width: 100%;
  transition: all 0.15s ease;
  outline: none;
}
.fp-input:focus,
.fp-select:focus,
.fp-textarea:focus {
  background: #ffffff;
  border-color: var(--logo-blue);
  box-shadow: 0 0 0 2px rgba(26, 58, 143, 0.1);
}
.fp-input--mono {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  letter-spacing: 0.2px;
}
.fp-field--accent .fp-input {
  background: rgba(26, 58, 143, 0.04);
  border-color: rgba(26, 58, 143, 0.2);
  color: var(--logo-blue);
  font-weight: 500;
}
.fp-textarea {
  resize: vertical;
  min-height: 56px;
  line-height: 1.5;
}

/* ─── COLLAPSIBLE (Définition profil) ──────────────────────────────────── */
.fp-collapsible {
  background: #f4f6fb;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 0;
}
.fp-collapsible[open] {
  background: #ffffff;
  border-color: rgba(26, 58, 143, 0.2);
}
.fp-collapsible-summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  list-style: none;
}
.fp-collapsible-summary::-webkit-details-marker {
  display: none;
}
.fp-collapsible-summary::before {
  content: '▸';
  font-size: 10px;
  color: var(--logo-blue);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.fp-collapsible[open] .fp-collapsible-summary::before {
  transform: rotate(90deg);
}
.fp-collapsible-preview {
  font-weight: 400;
  color: rgba(0, 0, 0, 0.5);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  font-style: italic;
}
.fp-collapsible .fp-textarea {
  margin: 0 12px 12px;
  width: calc(100% - 24px);
}

/* ─── COMPÉTENCES — Header de colonnes ────────────────────────────────── */
.fp-comp-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 28px;
  gap: 8px;
  padding: 0 12px 6px;
  font-size: 10px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fp-comp-header .fp-center {
  text-align: center;
}
.fp-comp-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ─── COMPÉTENCES — Card individuelle ─────────────────────────────────── */
.fp-comp-card {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 28px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-left: 3px solid #888780;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.fp-comp-card:hover {
  border-color: rgba(26, 58, 143, 0.3);
  box-shadow: 0 2px 6px rgba(26, 58, 143, 0.06);
}
.fp-comp-techno {
  font-family: var(--font, inherit);
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.fp-comp-techno:hover {
  color: var(--logo-blue);
}
.fp-comp-techno:hover .fp-comp-arrow {
  opacity: 1;
  transform: translateX(2px);
}
.fp-comp-arrow {
  font-size: 11px;
  color: var(--logo-blue);
  opacity: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.fp-center {
  text-align: center;
}
.fp-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
  line-height: 1.4;
}
.fp-pill--solid {
  font-weight: 500;
}
.fp-comp-delete {
  font-size: 16px;
  color: rgba(0, 0, 0, 0.3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}
.fp-comp-delete:hover {
  background: rgba(168, 57, 46, 0.1);
  color: #a8392e;
}

.fp-btn-add-comp {
  font-family: var(--font, inherit);
  font-size: 11px;
  font-weight: 500;
  color: var(--logo-blue);
  background: rgba(26, 58, 143, 0.06);
  border: 0.5px solid rgba(26, 58, 143, 0.2);
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.fp-btn-add-comp:hover {
  background: var(--logo-blue);
  color: #ffffff;
  border-color: var(--logo-blue);
}

/* ─── EMPTY STATE ──────────────────────────────────────────────────────── */
.fp-empty {
  text-align: center;
  padding: 22px 14px;
  color: rgba(0, 0, 0, 0.5);
}
.fp-empty p {
  margin: 0;
  font-size: 13px;
}
.fp-empty-hint {
  font-size: 11px !important;
  color: rgba(0, 0, 0, 0.35);
  margin-top: 5px !important;
  font-style: italic;
}

/* ─── TOAST ────────────────────────────────────────────────────────────── */
.fp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 8px;
  background: #1a1a1a;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 9999;
  pointer-events: none;
}
.fp-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.fp-toast--success {
  background: #0f6e56;
}
.fp-toast--error {
  background: #a8392e;
}

/* ─── MOBILE (≤ 768px) ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .fp-wrap {
    gap: 12px;
  }
  .fp-section {
    padding: 14px;
  }
  .fp-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .fp-field--full {
    grid-column: 1;
  }
  /* Compétences : on garde 3 colonnes, on réduit le padding et la font */
  .fp-comp-header,
  .fp-comp-card {
    grid-template-columns: 1fr 1fr 1fr 24px;
    gap: 4px;
    padding: 8px 10px;
  }
  .fp-comp-techno {
    font-size: 12px;
  }
  .fp-pill {
    font-size: 10px;
    padding: 2px 7px;
  }
  .fp-dropzone {
    padding: 12px 14px;
  }
  .fp-dropzone-icon {
    font-size: 22px;
  }
  .fp-dropzone-text strong {
    font-size: 12px;
  }
  .fp-dropzone-text span {
    font-size: 10px;
  }
}

/* ─── MOBILE TRÈS ÉTROIT (≤ 380px) — fallback empilé ──────────────────── */
@media (max-width: 380px) {
  .fp-comp-header {
    display: none;
  }
  .fp-comp-card {
    grid-template-columns: 1fr 24px;
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 10px 12px;
  }
  .fp-comp-techno {
    grid-column: 1;
    grid-row: 1;
    font-size: 13px;
    white-space: normal;
  }
  .fp-comp-delete {
    grid-column: 2;
    grid-row: 1;
  }
  .fp-comp-card .fp-center:nth-of-type(1) {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: left;
    display: flex;
    gap: 6px;
  }
  .fp-comp-card .fp-center:nth-of-type(2) {
    display: none;
  }
}

/* ─── COMPÉTENCES LINGUISTIQUES — version "lecture seule" du label ───── */
/* (Pas de filtre Vivier sur une langue → cursor par défaut, pas de hover) */
.fp-comp-techno.fp-comp-techno--static {
  cursor: default;
  display: block;
  width: 100%;
}
.fp-comp-techno.fp-comp-techno--static:hover {
  color: #1a1a1a;
}
