/* ============================================================
   portfolio.css — styles communs du portfolio de stage
   À déployer : outils.ergotlse.fr/stage/portfolio.css

   Partagé par portfolio.html (étudiant) et tuteur.html (tuteur).
   ============================================================ */
/* ══════════════════════════════════════════════════════════════
   Portfolio de stage — palette bleue propre à l'outil, reprise à
   l'identique de la version précédente pour ne rien dépayser.
   charte.css (chargée par navbar.js) fournit la navbar ; tout ce
   qui est préfixé « pf- » n'appartient qu'à cette page.
   ══════════════════════════════════════════════════════════════ */
:root {
  --pf-ac:       #5190ef;   /* bleu d'accent                 */
  --pf-ac-clair: #e3edfd;
  --pf-ac-fonce: #4d68c4;
  --pf-cyan:     #2bc3f1;
  --pf-nuit:     #1e293b;   /* barre latérale, titres        */
  --pf-gris:     #64748b;
  --pf-texte:    #334155;
  --pf-bord:     #e2e8f0;
  --pf-fond:     #f8fafc;
  --pf-nav:      60px;      /* hauteur de la navbar commune  */
}

html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--pf-fond);
  color: var(--pf-nuit);
}
* { box-sizing: border-box; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Ossature ─────────────────────────────────────────────── */
.pf { display: flex; height: calc(100vh - var(--pf-nav)); overflow: hidden; }
.pf-colonne { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pf-barre {
  background: #fff; border-bottom: 1px solid var(--pf-bord);
  padding: 0.6rem 2rem; display: flex; justify-content: space-between;
  align-items: center; flex-shrink: 0; gap: 0.5rem;
}
.pf-defile { flex: 1; overflow-y: auto; }
.pf-contenu { padding: 2rem; max-width: 900px; width: 100%; margin: 0 auto; }

.pf-statut { font-size: 0.78rem; font-weight: 600; transition: color 0.3s; color: #94a3b8; }
.pf-statut.saving { color: #f97316; }
.pf-statut.saved  { color: #22c55e; }
.pf-statut.error  { color: #ef4444; }

#pf-burger, #pf-nav-fermer {
  background: transparent; border: 0; font-size: 1.4rem; cursor: pointer;
  padding: 0.25rem 0.5rem; line-height: 1; color: var(--pf-nuit); display: none;
}
#pf-nav-fermer { color: #94a3b8; }

/* ── Barre latérale ───────────────────────────────────────── */
.pf-nav {
  background: var(--pf-nuit); width: 220px; min-width: 220px; flex-shrink: 0;
  overflow-y: auto; display: flex; flex-direction: column;
}
.pf-nav-tete {
  padding: 1.25rem 1rem 1rem; border-bottom: 1px solid #334155;
  display: flex; align-items: center; justify-content: space-between;
}
.pf-nav-sur { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pf-cyan); margin-bottom: 0.2rem; }
.pf-nav-nom { color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.3; }
.pf-nav-liste { flex: 1; padding: 0.5rem 0; }

.pf-nav-item {
  padding: 0.45rem 1rem 0.45rem 1.25rem; cursor: pointer; font-size: 0.83rem;
  color: #94a3b8; border-left: 3px solid transparent; border-radius: 0 6px 6px 0;
  margin-bottom: 2px; transition: all 0.15s;
}
.pf-nav-item:hover { color: #cbd5e1; }
.pf-nav-item.actif { font-weight: 600; color: #fff; background: var(--pf-ac); border-left-color: var(--pf-cyan); }
.pf-nav-item.niv2 { padding-left: 1.75rem; }
.pf-nav-item.niv3 { padding-left: 2rem; font-size: 0.78rem; }
.pf-nav-titre {
  padding: 0.5rem 1rem; cursor: pointer; color: var(--pf-gris); font-size: 0.75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  display: flex; justify-content: space-between; align-items: center; user-select: none;
}
.pf-nav-fleche { font-size: 0.7rem; color: #475569; }
.pf-nav-sous {
  padding: 0.4rem 1rem 0.2rem 1.75rem; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; color: #475569; letter-spacing: 0.06em;
}
.pf-nav-sep { height: 1px; background: #334155; margin: 0.5rem 0; }
.pf-nav-groupe { margin-bottom: 0.25rem; }
#pf-voile { display: none; }

/* ── Titres et cartes ─────────────────────────────────────── */
.pf-h1 {
  font-size: 1.4rem; font-weight: 700; color: var(--pf-nuit); margin-bottom: 1.5rem;
  padding-bottom: 0.75rem; border-bottom: 2px solid var(--pf-ac-clair);
}
.pf-h1-flex { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pf-h2 { font-size: 1rem; font-weight: 700; color: var(--pf-nuit); margin-bottom: 0.75rem; }
.pf-carte {
  background: #fff; border-radius: 10px; padding: 1.5rem; margin-bottom: 1.25rem;
  border: 1px solid var(--pf-bord); box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.pf-badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; background: var(--pf-ac-clair); color: var(--pf-ac);
}
.pf-p   { color: var(--pf-texte); line-height: 1.7; font-size: 0.9rem; margin: 0 0 0.75rem; }
.pf-p:last-child { margin-bottom: 0; }
.pf-p-s { margin: 0; font-size: 0.85rem; color: #1e3a5f; line-height: 1.6; }
.pf-note { font-size: 0.82rem; color: var(--pf-gris); margin: 0 0 1rem; font-style: italic; line-height: 1.6; }
.pf-liste { margin: 0; padding-left: 1.25rem; }
.pf-liste li { font-size: 0.88rem; color: var(--pf-texte); line-height: 1.7; margin-bottom: 0.25rem; }
.pf-info {
  background: #f0f7ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 1rem; margin-bottom: 1rem;
}
.pf-info-t { font-weight: 700; color: var(--pf-ac); margin-bottom: 0.5rem; font-size: 0.85rem; }

.pf-bandeau {
  background: linear-gradient(135deg, var(--pf-nuit), var(--pf-ac-fonce));
  color: #fff; text-align: center; padding: 2rem; border-radius: 10px; margin-bottom: 1.5rem;
}
.pf-bandeau-sur { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: #cbd5e1; margin-bottom: 0.5rem; }
.pf-bandeau-titre { font-size: 1.5rem; font-weight: 700; margin: 0.5rem 0; }
.pf-bandeau-sous { color: #cbd5e1; font-size: 0.85rem; }

.pf-num { display: flex; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; align-items: flex-start; font-size: 0.88rem; color: var(--pf-texte); line-height: 1.5; }
.pf-num .pf-badge { min-width: 1.5rem; text-align: center; flex-shrink: 0; }
.pf-puces { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.pf-puce { background: var(--pf-ac-clair); padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.82rem; color: var(--pf-ac); font-weight: 600; }
.pf-bloc { background: var(--pf-ac-clair); padding: 0.75rem; border-radius: 8px; }
.pf-bloc-t { color: var(--pf-ac); font-weight: 700; font-size: 0.85rem; margin-bottom: 0.25rem; }
.pf-bloc-d { color: var(--pf-texte); font-size: 0.82rem; line-height: 1.5; }

.pf-niveau-tete { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.pf-niveau-l { font-weight: 700; color: var(--pf-nuit); font-size: 0.9rem; }
.pf-sous-titre { font-size: 0.82rem; color: var(--pf-gris); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.pf-critere { background: var(--pf-fond); border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.85rem; color: var(--pf-texte); margin-top: 0.75rem; }
.pf-critere-l { font-weight: 600; color: var(--pf-gris); }

/* ── Champs ───────────────────────────────────────────────── */
.pf-champ { margin-bottom: 1rem; }
.pf-champ.inline { margin-bottom: 0; }
.pf-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--pf-gris); margin-bottom: 0.3rem; display: block;
}
.pf-input {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 0.9rem; font-family: inherit; outline: none; background: var(--pf-fond); color: var(--pf-nuit);
}
.pf-ta {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 0.9rem; font-family: inherit; outline: none; resize: vertical;
  line-height: 1.6; background: var(--pf-fond); color: var(--pf-nuit);
}
.pf-input:focus, .pf-ta:focus { border-color: var(--pf-ac); box-shadow: 0 0 0 3px rgba(81,144,239,0.18); }
.pf-grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

.pf-choix-groupe { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pf-choix {
  padding: 0.4rem 0.9rem; border-radius: 8px; border: 2px solid var(--pf-bord);
  background: #fff; color: var(--pf-gris); cursor: pointer; font-size: 0.8rem;
  font-weight: 600; font-family: inherit; transition: all 0.15s;
}
.pf-choix:hover { border-color: #cbd5e1; }
.pf-choix.actif { color: #fff; }
.pf-choix-h { font-weight: 400; opacity: 0.8; font-size: 0.72rem; }

.pf-bouton {
  padding: 0.35rem 0.85rem; border-radius: 8px; border: 2px solid var(--pf-ac);
  background: #fff; color: var(--pf-ac); cursor: pointer; font-size: 0.78rem;
  font-weight: 700; font-family: inherit; white-space: nowrap;
}
.pf-bouton:hover { background: var(--pf-ac-clair); }
.pf-bouton.plein { background: var(--pf-ac); color: #fff; font-size: 0.85rem; padding: 0.45rem 1rem; }

/* ── Onglets d'un stage ───────────────────────────────────── */
.pf-onglets { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.pf-onglet {
  padding: 0.45rem 0.9rem; border-radius: 999px; border: 2px solid var(--pf-bord);
  background: #fff; color: var(--pf-gris); cursor: pointer; font-size: 0.8rem;
  font-weight: 600; font-family: inherit; transition: all 0.15s;
}
.pf-onglet:hover { border-color: #cbd5e1; }
.pf-onglet.actif { background: var(--pf-ac); border-color: var(--pf-ac); color: #fff; }
.pf-arpp-intro {
  background: #fafaf9; border-top: 4px solid var(--pf-ac); font-size: 0.82rem;
  color: var(--pf-gris); line-height: 1.7; font-style: italic;
}

/* ── Évaluation des compétences ───────────────────────────── */
.pf-comp-tete { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--pf-bord); flex-wrap: wrap; }
.pf-comp-t { font-weight: 700; font-size: 0.9rem; color: var(--pf-nuit); }
.pf-eval-ligne { padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; }
.pf-eval-ligne:last-child { border-bottom: 0; }
.pf-eval-tete { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.pf-eval-n { font-weight: 600; color: var(--pf-gris); font-size: 0.82rem; min-width: 4.5rem; }
.pf-eval-ligne .pf-choix { padding: 0.35rem 0.9rem; border-radius: 999px; font-size: 0.78rem; }
.pf-eval-com { min-height: 50px; margin-top: 0.5rem; }

/* ── Récapitulatif ────────────────────────────────────────── */
.pf-table-boite { overflow-x: auto; }
.pf-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.87rem; }
.pf-table th {
  background: var(--pf-nuit); color: #fff; padding: 0.75rem 1rem; text-align: left;
  font-weight: 600; font-size: 0.8rem; white-space: nowrap;
}
.pf-table th:first-child { border-radius: 8px 0 0 0; }
.pf-table th:last-child  { border-radius: 0 8px 0 0; }
.pf-table th.c, .pf-table td.c { text-align: center; }
.pf-table td { padding: 0.6rem 1rem; background: #fff; border-bottom: 1px solid var(--pf-bord); }
.pf-table tr:nth-child(even) td { background: var(--pf-fond); }
.pf-td-n { font-weight: 700; color: var(--pf-ac); white-space: nowrap; }
.pf-table .pf-input { min-width: 140px; }
.pf-case { width: 18px; height: 18px; cursor: pointer; accent-color: var(--pf-ac); }

/* ── Modale d'export ──────────────────────────────────────── */
.pf-modale-fond {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 10000;
  display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px;
}
.pf-modale {
  background: #fff; border-radius: 12px; max-width: 460px; width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,.22); display: flex; flex-direction: column; max-height: 82vh;
}
.pf-modale-tete { padding: 14px 18px; border-bottom: 1px solid var(--pf-bord); display: flex; align-items: center; gap: 10px; }
.pf-modale-tete strong { flex: 1; font-size: 0.98rem; }
.pf-modale-tete button { border: 0; background: transparent; font-size: 1.1rem; cursor: pointer; color: #94a3b8; line-height: 1; }
.pf-modale-intro { padding: 10px 18px 0; font-size: 0.8rem; color: var(--pf-gris); line-height: 1.5; }
.pf-modale-corps { padding: 6px 18px 10px; overflow: auto; }
.pf-exp-l { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 0.88rem; color: var(--pf-texte); cursor: pointer; }
.pf-exp-l input { width: 16px; height: 16px; accent-color: var(--pf-ac); cursor: pointer; }
.pf-exp-tag { margin-left: auto; font-size: 0.7rem; color: #94a3b8; }
.pf-exp-tag.ok { font-weight: 700; color: #16a34a; background: #dcfce7; border-radius: 999px; padding: 1px 8px; }
.pf-modale-fmt {
  padding: 10px 18px; border-top: 1px solid var(--pf-bord); display: flex; align-items: center;
  gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: var(--pf-gris);
}
.pf-modale-fmt label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--pf-texte); }
.pf-modale-fmt input { accent-color: var(--pf-ac); }
.pf-modale-pied { padding: 12px 18px; border-top: 1px solid var(--pf-bord); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
#pf-exp-msg { flex: 1; font-size: 0.78rem; color: #ef4444; }

/* ── Zones de rédaction : accord avec la palette du portfolio.
   Préfixé « body » pour l'emporter sur la feuille #ergo-rt-css que
   richtext.js injecte plus tard dans le <head>. ───────────────── */
body .ergo-rt-bar { background: #f1f5f9; border-color: #cbd5e1; border-radius: 6px 6px 0 0; }
body .ergo-rt-bar button { color: #475569; }
body .ergo-rt-bar button:hover { background: #fff; color: var(--pf-nuit); border-color: #cbd5e1; }
body .ergo-rt-bar .rt-sep { background: #cbd5e1; }
body .ergo-rt-zone {
  background: var(--pf-fond); border-color: #cbd5e1; border-radius: 0 0 6px 6px;
  font-size: 0.9rem; line-height: 1.6; color: var(--pf-nuit);
}
body .ergo-rt-zone:focus { background: #fff; border-color: var(--pf-ac); box-shadow: 0 0 0 3px rgba(81,144,239,0.18); }
body .ergo-rt-zone.is-empty:before { color: #94a3b8; }
body .ergo-rt-zone a { color: #1d4ed8; }

/* ── Chargement ───────────────────────────────────────────── */
.pf-chargement {
  display: flex; align-items: center; justify-content: center; height: calc(100vh - var(--pf-nav));
  color: var(--pf-gris); flex-direction: column; gap: 1rem;
}
.pf-roue {
  width: 40px; height: 40px; border: 3px solid var(--pf-ac-clair); border-top-color: var(--pf-ac);
  border-radius: 50%; animation: pf-tourne 0.8s linear infinite;
}
@keyframes pf-tourne { to { transform: rotate(360deg); } }

/* ── Accès tuteur (depuis le 28/09/2026) ──────────────────────
   Bandeaux d'état, champs en lecture seule, carte « Mon tuteur ».
   Servent aux deux pages : portfolio (étudiant) et tuteur.html. ── */
[hidden] { display: none !important; }
.pf-etat {
  border-radius: 8px; padding: 0.7rem 0.9rem; margin-bottom: 1rem; font-size: 0.85rem;
  line-height: 1.55; border: 1px solid; display: flex; gap: 0.6rem; align-items: flex-start;
}
.pf-etat-i { font-size: 1rem; line-height: 1.3; flex-shrink: 0; }
.pf-etat-c { flex: 1; min-width: 0; }
.pf-etat-t { font-weight: 700; }
.pf-etat-m { margin-top: 0.35rem; color: var(--pf-texte); }
.pf-etat-m p { margin: 0 0 0.3rem; }
.pf-etat.ok       { background: #f0fdf4; border-color: #86efac; color: #166534; }
.pf-etat.reprendre { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.pf-etat.modifie  { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.pf-etat.attente  { background: #f8fafc; border-color: var(--pf-bord); color: var(--pf-gris); }
.pf-etat.garde    { background: #fefce8; border-color: #fde68a; color: #854d0e; }

.pf-lecture {
  background: #fff; border: 1px dashed #cbd5e1; border-radius: 6px; padding: 0.55rem 0.75rem;
  font-size: 0.9rem; line-height: 1.6; color: var(--pf-nuit); min-height: 2.4rem;
}
.pf-lecture p { margin: 0 0 0.4rem; }
.pf-lecture p:last-child { margin-bottom: 0; }
.pf-lecture ul, .pf-lecture ol { margin: 0.2rem 0 0.4rem; padding-left: 1.2rem; }
.pf-lecture a { color: #1d4ed8; }
.pf-lecture.vide { color: #94a3b8; font-style: italic; }
.pf-label-tag {
  display: inline-block; margin-left: 0.4rem; padding: 0 0.45rem; border-radius: 999px;
  font-size: 0.65rem; letter-spacing: 0.02em; text-transform: none; font-weight: 700;
  background: var(--pf-ac-clair); color: var(--pf-ac-fonce); vertical-align: 1px;
}

.pf-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.75rem; }
.pf-bouton.vert   { border-color: #16a34a; color: #16a34a; }
.pf-bouton.vert:hover { background: #dcfce7; }
.pf-bouton.vert.plein { background: #16a34a; color: #fff; }
.pf-bouton.orange { border-color: #ea580c; color: #ea580c; }
.pf-bouton.orange:hover { background: #ffedd5; }
.pf-bouton.discret { border-color: var(--pf-bord); color: var(--pf-gris); }
.pf-bouton.discret:hover { background: var(--pf-fond); }
.pf-bouton:disabled { opacity: 0.5; cursor: default; }

.pf-lien-boite {
  background: var(--pf-fond); border: 1px solid #bfdbfe; border-radius: 8px; padding: 0.75rem;
  margin: 0.75rem 0; font-size: 0.82rem;
}
.pf-lien-url {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.75rem; word-break: break-all;
  background: #fff; border: 1px solid var(--pf-bord); border-radius: 6px; padding: 0.45rem 0.6rem; margin: 0.4rem 0 0.6rem;
  user-select: all;
}
.pf-kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.9rem; font-size: 0.85rem; margin: 0.25rem 0 0.5rem; }
.pf-kv dt { color: var(--pf-gris); font-weight: 600; }
.pf-kv dd { margin: 0; color: var(--pf-nuit); }

.pf-pastille {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f97316;
  margin-left: 0.4rem; vertical-align: 1px;
}
.pf-eval-bloc { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pf-eval-qui { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }
.pf-cot {
  display: inline-block; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  color: #fff; background: #94a3b8;
}
.pf-cot.vide { background: transparent; color: #94a3b8; border: 1px dashed #cbd5e1; font-weight: 600; }
.pf-eval-com-l { margin-top: 0.4rem; font-size: 0.82rem; color: var(--pf-texte); }

/* ── Écrans étroits ───────────────────────────────────────── */
@media (max-width: 767px) {
  .pf-kv { grid-template-columns: 1fr; gap: 0 0; }
  .pf-kv dd { margin-bottom: 0.4rem; }
  .pf-contenu { padding: 1rem; max-width: 100%; }
  .pf-barre { padding: 0.6rem 1rem; }
  .pf-grille2 { grid-template-columns: 1fr; }
  #pf-burger, #pf-nav-fermer { display: block; }
  .pf-nav {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 1001;
    transform: translateX(-100%); transition: transform 0.25s ease;
  }
  body.pf-menu-ouvert .pf-nav { transform: translateX(0); box-shadow: 2px 0 12px rgba(0,0,0,0.3); }
  body.pf-menu-ouvert #pf-voile { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; }
}
