/* ==========================================================================
   JOBDREAM — feuille de style
   Design minimaliste, conforme au cahier des charges §3.

   Toutes les valeurs de design sont definies une seule fois ci-dessous, sous
   forme de "variables CSS" (les --nom) : couleurs (dans les deux themes),
   tailles de texte, espacements, rayons, ombres et durees. Pour changer une
   valeur partout dans l'appli, il suffit de la modifier ici.

   Direction visuelle (2026-10-22, choisie par le proprietaire) : le standard
   du secteur, joue franchement, au niveau de finition de Welcome to the
   Jungle — sans lui emprunter ni couleur, ni police, ni forme. Fond neutre
   tres clair, surfaces blanches, filets fins, un seul accent indigo reserve a
   l'action principale, a la selection et aux etats. Aucun degrade, aucune
   ombre coloree : la hierarchie vient du texte et de l'espacement. Detail et
   contrat de direction : .impeccable/surfaces/, DESIGN.md.
   ========================================================================== */

/* Figtree, police libre (licence SIL OFL, public/fonts/OFL-figtree.txt),
   servie par JOBDREAM lui-meme : la CSP interdit tout domaine externe
   (securite.md §6). Un seul fichier variable couvre toutes les graisses ;
   le jeu "latin" contient les accents, oe, l'apostrophe typographique, les
   espaces insecables et le symbole euro. */
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font: 'Figtree', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system,
    Roboto, sans-serif;

  /* --- Typographie : une echelle fixe, en rem (ratio ~1,2) --- */
  --taille-xs: 0.75rem; /* 12 px : mentions, pastilles */
  --taille-s: 0.8125rem; /* 13 px : libelles, aides */
  --taille-m: 0.875rem; /* 14 px : texte secondaire, tableaux */
  --taille-base: 1rem; /* 16 px : texte courant */
  --taille-l: 1.125rem; /* 18 px : titres de carte */
  --taille-xl: 1.25rem; /* 20 px : titres de section */
  --taille-2xl: 1.5rem; /* 24 px : titres de fenetre, chiffres */
  --taille-3xl: 1.875rem; /* 30 px : titres de page */
  --graisse-normale: 400;
  --graisse-moyenne: 500;
  --graisse-forte: 600;
  --graisse-titre: 700;
  --graisse-noire: 800;

  /* --- Espacements : une seule echelle --- */
  --espace-1: 4px;
  --espace-2: 8px;
  --espace-3: 12px;
  --espace-4: 16px;
  --espace-5: 20px;
  --espace-6: 24px;
  --espace-7: 32px;
  --espace-8: 48px;

  /* --- Rayons --- */
  --rayon-s: 6px;
  --rayon-m: 10px;
  --rayon-l: 14px;
  --rayon-xl: 20px;
  --rayon-plein: 999px;

  /* --- Mouvement : court, il signale un changement d'etat --- */
  --duree-courte: 120ms;
  --duree: 180ms;
  --duree-longue: 280ms;
  /* Le moment fort d'une page (anneau du CV, entonnoir de l'Avancee), un
     seul par page, et l'ecart entre deux barres qui se suivent. */
  --duree-moment: 760ms;
  --decalage: 80ms;
  /* Sortie exponentielle : rapide au depart, douce a l'arrivee. */
  --courbe-sortie: cubic-bezier(0.16, 1, 0.3, 1);
  --sortie: var(--courbe-sortie);

  /* Hauteur de la barre du haut, collante : ce qui colle sous elle (sommaire
     du CV) et les ancres de rubrique s'arretent juste en dessous. */
  --hauteur-barre: 64px;
  /* Largeur du panneau d'apercu d'une candidature : la moitie de l'ecran. */
  --largeur-apercu: min(50vw, 760px);

  /* --- Couleurs, theme clair --- */
  --bg: #f4f5f7;
  --surface: #ffffff;
  /* Second plan : barres d'outils, encadres, zones en retrait. */
  --surface-2: #f8f9fb;
  --border: #e2e5ea;
  /* Bordure d'un champ de saisie : 3:1 sur le blanc, pour qu'on voie ou
     cliquer (WCAG 1.4.11). */
  --bordure-champ: #8a909b;
  --text: #15171c;
  --text-muted: #5a616e;

  /* Logo (docs/logo/kit/REGLES.md) : le check corail, la tete et le nom.
     Le corail garde 3,3:1 sur le blanc, 5,5:1 sur le fond sombre. */
  --logo-check: #f25a38;
  --logo-encre: #1e2a78;
  --hauteur-logo: 26px;

  --accent: #3045d1;
  --accent-hover: #2434b0;
  --accent-soft: #eef0fd;
  /* Texte pose SUR l'accent (bouton principal). */
  --accent-text: #ffffff;
  /* Halo d'une pastille qui vient d'arriver (choix des metiers). */
  --accent-glow: rgba(48, 69, 209, 0.28);
  /* L'accent pose sur du papier clair dans les DEUX themes (feuilles de la
     demonstration de l'accueil) : l'accent du theme sombre y serait illisible. */
  --accent-encre: #3045d1;
  /* Contour du focus clavier : 3:1 sur tous les fonds. */
  --focus: #3045d1;

  --danger: #bf3329;
  --danger-soft: #fdf0ee;
  --succes: #17764b;
  --succes-soft: #eaf6f0;
  /* Champ a verifier (import d'un CV, js/constructionCV.js), alertes douces */
  --attention: #965700;
  --attention-soft: #fff4df;

  --backdrop: rgba(15, 17, 22, 0.45);
  --ombre-1: 0 1px 2px rgba(16, 24, 40, 0.06);
  --ombre-2: 0 6px 16px -4px rgba(16, 24, 40, 0.1), 0 1px 3px rgba(16, 24, 40, 0.06);
  --ombre-3: 0 20px 48px -12px rgba(16, 24, 40, 0.28);

  /* Couleurs par type de contrat (cahier des charges §3) */
  --contract-cdi: #17764b;
  --contract-alternance: #1c63c0;
  --contract-freelance: #7a3dcc;
  --contract-cdd: #a0520a;
  --contract-stage: #0a6e80;
  --contract-autre: #5f6674;

  /* Niveaux de score (Excellente, Bonne, Moyenne, Faible). */
  --niveau-excellente: #11734a;
  --niveau-bonne: #3045d1;
  --niveau-moyenne: #965700;
  --niveau-faible: #5f6674;

  /* Teintes de rubrique (2026-10-24, choix du proprietaire : « une couleur
     par rubrique »). Elles IDENTIFIENT une rubrique du CV ou un chiffre de la
     page Avancee, dans une pastille d'icone : jamais une action (l'indigo
     reste la seule couleur des boutons), jamais un etat (le fait et le a
     faire restent en --succes et --attention). Meme mecanique que les
     pastilles .badge : le texte dans la couleur, le fond a 11 %. */
  --teinte-violet: #6b3fc4;
  --teinte-sarcelle: #0b7268;
  --teinte-rose: #b02a64;
  --teinte-ambre: #965700;
  --teinte-bleu: #1f63b8;
  --teinte-vert: #3d7a14;
  --teinte-corail: #b5432a;
  --teinte-ardoise: #56606e;

  /* Bandeau fonce de la page d'accueil (appel a l'action final) : graphite
     indigo dans les deux themes, un cran plus clair en sombre. */
  --bande-fond: #151831;
  --bande-texte: #eef0f7;
  --bande-texte-muted: #a9afc4;

  /* Demonstration animee de la page d'accueil : un ecran sombre dans les
     deux themes, avec des feuilles de papier clair. */
  --demo-surface: #1d2140;
  --demo-ligne: rgba(255, 255, 255, 0.1);
  --demo-texte: #eef0f7;
  --demo-muted: #a6adc5;
  /* Couleurs proposees pour le CV (pastilles de la fenetre de
     telechargement). Ce sont celles du PAPIER, identiques dans les deux
     themes : copie de COULEURS_CV (server/services/gabaritsCV.js), verifiee
     par scripts/test-mises-en-page.js. */
  --cv-couleur-noir: #1a1a1a;
  --cv-couleur-ardoise: #37474f;
  --cv-couleur-marine: #1f3a5f;
  --cv-couleur-petrole: #145a6a;
  --cv-couleur-sapin: #1e5641;
  --cv-couleur-bordeaux: #7b1e2c;
  --cv-couleur-prune: #4f2a5e;
  --cv-couleur-brique: #9b3b22;
  /* Le papier des apercus de CV. */
  --cv-couleur-papier: #fff;

  --demo-accent: #93a2ff;
  --demo-vert: #4cc38a;
  --demo-ambre: #f2b648;
  --demo-feuille: #f7f8fa;
  --demo-encre: #1a1d2b;
  --demo-trait: #dde0e6;

}

/*
  Palette sombre, ecrite deux fois a l'identique (scripts/test-interface.js
  verifie que les deux blocs ne divergent pas).

  Le theme a trois etats :
    - aucun attribut sur <html>  -> on suit le reglage du systeme
    - data-theme="light"          -> clair force par le bouton
    - data-theme="dark"           -> sombre force par le bouton

  D'ou les deux blocs ci-dessous : le premier gere "je suis le systeme"
  (sauf si le bouton a explicitement demande le clair), le second gere le
  sombre force par le bouton. color-scheme fait suivre aux controles natifs
  (barres de defilement, calendrier des dates) le meme theme.
*/
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #131416;
    --surface: #1b1c1f;
    --surface-2: #222327;
    --border: #303237;
    --bordure-champ: #75787f;
    --text: #ececee;
    --text-muted: #a9abb2;
    --logo-check: #f25a38;
    --logo-encre: #ececee;
    --accent: #93a2ff;
    --accent-hover: #adb8ff;
    --accent-soft: rgba(147, 162, 255, 0.14);
    --accent-text: #131416;
    --accent-glow: rgba(147, 162, 255, 0.25);
    --focus: #adb8ff;
    --danger: #ff8b80;
    --danger-soft: rgba(255, 139, 128, 0.13);
    --succes: #4cc38a;
    --succes-soft: rgba(76, 195, 138, 0.13);
    --attention: #f2b648;
    --attention-soft: rgba(242, 182, 72, 0.13);
    --backdrop: rgba(0, 0, 0, 0.62);
    --ombre-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --ombre-2: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
    --ombre-3: 0 20px 48px -12px rgba(0, 0, 0, 0.7);
    --contract-cdi: #4cc38a;
    --contract-alternance: #6ea9f5;
    --contract-freelance: #b896f6;
    --contract-cdd: #efb25a;
    --contract-stage: #4fd0df;
    --contract-autre: #a9abb2;
    --niveau-excellente: #4cc38a;
    --niveau-bonne: #93a2ff;
    --niveau-moyenne: #f2b648;
    --niveau-faible: #a9abb2;
    --teinte-violet: #b99bf5;
    --teinte-sarcelle: #5fd0c2;
    --teinte-rose: #f38bb6;
    --teinte-ambre: #f2b648;
    --teinte-bleu: #7fb2f7;
    --teinte-vert: #9bd36a;
    --teinte-corail: #ff9a80;
    --teinte-ardoise: #aab1bd;
    --bande-fond: #1e2238;
    --bande-texte: #eef0f7;
    --bande-texte-muted: #b0b6ca;
    --demo-surface: #262b4a;
    --demo-ligne: rgba(255, 255, 255, 0.12);
    --demo-texte: #eef0f7;
    --demo-muted: #b0b7cd;
    --demo-accent: #a5b2ff;
    --demo-vert: #4cc38a;
    --demo-ambre: #f2b648;
    --demo-feuille: #eef0f4;
    --demo-encre: #1a1d2b;
    --demo-trait: #cfd3da;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #131416;
  --surface: #1b1c1f;
  --surface-2: #222327;
  --border: #303237;
  --bordure-champ: #75787f;
  --text: #ececee;
  --text-muted: #a9abb2;
  --logo-check: #f25a38;
  --logo-encre: #ececee;
  --accent: #93a2ff;
  --accent-hover: #adb8ff;
  --accent-soft: rgba(147, 162, 255, 0.14);
  --accent-text: #131416;
  --accent-glow: rgba(147, 162, 255, 0.25);
  --focus: #adb8ff;
  --danger: #ff8b80;
  --danger-soft: rgba(255, 139, 128, 0.13);
  --succes: #4cc38a;
  --succes-soft: rgba(76, 195, 138, 0.13);
  --attention: #f2b648;
  --attention-soft: rgba(242, 182, 72, 0.13);
  --backdrop: rgba(0, 0, 0, 0.62);
  --ombre-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --ombre-2: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
  --ombre-3: 0 20px 48px -12px rgba(0, 0, 0, 0.7);
  --contract-cdi: #4cc38a;
  --contract-alternance: #6ea9f5;
  --contract-freelance: #b896f6;
  --contract-cdd: #efb25a;
  --contract-stage: #4fd0df;
  --contract-autre: #a9abb2;
  --niveau-excellente: #4cc38a;
  --niveau-bonne: #93a2ff;
  --niveau-moyenne: #f2b648;
  --niveau-faible: #a9abb2;
  --teinte-violet: #b99bf5;
  --teinte-sarcelle: #5fd0c2;
  --teinte-rose: #f38bb6;
  --teinte-ambre: #f2b648;
  --teinte-bleu: #7fb2f7;
  --teinte-vert: #9bd36a;
  --teinte-corail: #ff9a80;
  --teinte-ardoise: #aab1bd;
  --bande-fond: #1e2238;
  --bande-texte: #eef0f7;
  --bande-texte-muted: #b0b6ca;
  --demo-surface: #262b4a;
  --demo-ligne: rgba(255, 255, 255, 0.12);
  --demo-texte: #eef0f7;
  --demo-muted: #b0b7cd;
  --demo-accent: #a5b2ff;
  --demo-vert: #4cc38a;
  --demo-ambre: #f2b648;
  --demo-feuille: #eef0f4;
  --demo-encre: #1a1d2b;
  --demo-trait: #cfd3da;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--taille-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11' 1;
}

/* Ce que le navigateur dessine lui-meme suit aussi la palette : selection
   du texte, curseur de saisie, barres de defilement, soulignement des liens. */
::selection {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
}

html {
  scrollbar-color: color-mix(in srgb, var(--text-muted) 45%, transparent) transparent;
  caret-color: var(--accent);
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* Les chiffres qui se comparent (scores, compteurs, tuiles) gardent la meme
   largeur : une colonne de pourcentages s'aligne d'elle-meme. */
.score-value,
.count,
.tuile-valeur,
.badge-niveau,
.cv-score-valeur {
  font-variant-numeric: tabular-nums;
}

/* ============================= Barre du haut ============================= */

/* Collee en haut de l'ecran : la navigation reste a portee pendant qu'on
   fait defiler une longue liste d'offres. Les fenetres <dialog> s'affichent
   au-dessus de tout, le z-index ne les gene pas. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-2) var(--espace-6);
  flex-wrap: wrap;
  min-height: 64px;
  padding: var(--espace-2) var(--espace-6);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

/* Logotype : le nom seul, en capitales serrees, dans la couleur du texte.
   Le carre d'accent devant le nom est la seule marque graphique. */
.logo {
  margin: 0;
  font-size: var(--taille-l);
  font-weight: var(--graisse-noire);
  letter-spacing: 0.02em;
  color: var(--text);
}

.logo a {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

/* Le logo dessine (public/logo.svg). Ses deux couleurs passent par heritage :
   `color` pour le check, `fill` pour la tete et le nom. Le mot JOBDREAM reste
   dans la page, masque a l'ecran, pour les lecteurs d'ecran et les moteurs. */
.logo-image {
  display: block;
  height: var(--hauteur-logo);
  width: auto;
  aspect-ratio: 814 / 152;
  color: var(--logo-check);
  fill: var(--logo-encre);
}

.logo a:focus-visible {
  outline-offset: 4px;
}

/* Navigation entre les pages. `margin-right: auto` la colle au logo et
   repousse les actions a droite, sans conteneur supplementaire. */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-1);
  margin-right: auto;
}

/* Sur un telephone, cinq liens ne tiennent pas sur une ligne : "Avancee"
   etait coupe hors de l'ecran. La navigation passe sur toute la largeur, en
   dessous du logo, et defile si besoin. */
@media (max-width: 640px) {
  .topbar {
    padding: var(--espace-2) var(--espace-4);
  }

  .nav {
    order: 3;
    width: 100%;
    margin-right: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

/* "Compte" est sorti de la navigation pour se ranger tout en haut a droite,
   en dernier des actions : il garde pourtant l'allure d'un onglet. */
.nav a,
.lien-compte {
  position: relative;
  padding: var(--espace-2) var(--espace-3);
  border-radius: var(--rayon-m);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: var(--graisse-moyenne);
  font-size: var(--taille-m);
  white-space: nowrap;
  transition: background-color var(--duree-courte), color var(--duree-courte);
}

.nav a:hover,
.lien-compte:hover {
  background: var(--bg);
  color: var(--text);
}

/* La page courante est marquee par aria-current, l'attribut qui l'annonce
   deja aux lecteurs d'ecran : pas besoin d'une classe en plus. Un trait
   d'accent sous l'onglet, comme un onglet de classeur. */
.nav a[aria-current='page'],
.lien-compte[aria-current='page'] {
  color: var(--text);
  font-weight: var(--graisse-forte);
}

.nav a[aria-current='page']::after,
.lien-compte[aria-current='page']::after {
  content: '';
  position: absolute;
  left: var(--espace-3);
  right: var(--espace-3);
  bottom: -9px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

@media (max-width: 640px) {
  .nav a[aria-current='page']::after {
    bottom: 0;
  }
}

/* ============================== Structure =============================== */

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--espace-7) var(--espace-6) var(--espace-8);
  display: flex;
  flex-direction: column;
  gap: var(--espace-6);
}

/* En-tete de page : le titre de l'ecran et ses actions principales. Il
   remplace les boutons qui s'entassaient dans la barre du haut. */
.page-tete {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--espace-3) var(--espace-6);
}

.page-titre {
  margin: 0;
  font-size: var(--taille-3xl);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.page-sous-titre {
  margin: var(--espace-1) 0 0;
  color: var(--text-muted);
  font-size: var(--taille-base);
  max-width: 62ch;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  box-shadow: var(--ombre-1);
  padding: var(--espace-6);
}

.panel-nu {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--espace-3);
  margin-bottom: var(--espace-5);
}

.panel-head h2 {
  margin: 0;
  font-size: var(--taille-xl);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.015em;
}

.count {
  color: var(--text-muted);
  font-size: var(--taille-s);
}

/* =============================== Filtres ================================ */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--espace-3);
  padding-bottom: var(--espace-4);
  margin-bottom: var(--espace-4);
  border-bottom: 1px solid var(--border);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

/* Un groupe de cases a cocher se declare en <fieldset> + <legend> : c'est ce
   qui rattache le titre "Type de contrat" a l'ensemble des cases pour un
   lecteur d'ecran. On neutralise juste l'encadrement par defaut du
   navigateur, pour qu'il ressemble aux autres champs de la barre. */
.field-cases {
  margin: 0;
  padding: 0;
  border: 0;
  /* Une base large : sans elle, la barre de filtres comprime le groupe et
     "France Travail" se coupe en deux lignes sous sa case a cocher. */
  flex: 1 1 300px;
}

.field-cases legend {
  padding: 0;
  margin-bottom: 6px;
}

.field-grow {
  flex: 1 1 180px;
}

/* Libelles et champs a la taille du texte courant (2026-10-24) : en 13 px
   gris, les libelles se confondaient avec les aides, et tout semblait ecrit
   petit. 16 px dans les champs evite aussi le zoom automatique de l'iPhone
   a chaque saisie. */
.field-label {
  font-size: var(--taille-m);
  font-weight: var(--graisse-moyenne);
  color: var(--text);
}

input,
select,
textarea {
  font: inherit;
  font-size: var(--taille-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--bordure-champ);
  border-radius: var(--rayon-m);
  padding: 9px 12px;
  width: 100%;
  transition: border-color var(--duree-courte), box-shadow var(--duree-courte);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--text-muted);
}

/* Un champ actif s'entoure d'un halo d'accent, en plus du contour clavier
   ci-dessous qui reste le repere d'accessibilite. */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Les cases a cocher et boutons radio gardent leur rendu natif, teinte.
   POURQUOI LA REMISE A ZERO : la regle des champs ci-dessus leur donnait
   width: 100%, du padding et une bordure. Chrome l'ignore, mais Safari sur
   iPhone etire alors la case sur toute la ligne : les libelles se
   chevauchaient et les cases tombaient au milieu du texte. */
input[type='checkbox'],
input[type='radio'] {
  width: auto;
  flex: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  accent-color: var(--accent);
}

/* Un seul contour de focus clavier pour tout ce qui se manipule. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* =============================== Boutons ================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-2);
  font: inherit;
  font-size: var(--taille-m);
  font-weight: var(--graisse-forte);
  line-height: 1.25;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-m);
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: var(--ombre-1);
  transition: background-color var(--duree-courte), border-color var(--duree-courte),
    color var(--duree-courte), box-shadow var(--duree-courte);
}

.btn:hover {
  border-color: var(--bordure-champ);
  background: var(--surface-2);
}

.btn:active:not(:disabled) {
  box-shadow: none;
  transform: translateY(1px);
}

/* Desactive pour une raison (rien a envoyer, critere manquant) : grise, sans
   le curseur d'attente, reserve a un bouton occupe (.est-occupe). */
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

.btn.est-occupe:disabled {
  cursor: progress;
}

.btn-sm {
  padding: 6px 11px;
  font-size: var(--taille-s);
  border-radius: var(--rayon-s);
  gap: 6px;
}

.btn-lg {
  padding: 13px 22px;
  font-size: var(--taille-base);
}

/* L'action principale : l'accent plein, uni. Une seule par zone, pour qu'on
   la trouve du premier coup d'oeil parmi les boutons neutres. */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--ombre-1);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-accent {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

body[data-guide='actif'] .page-actions .btn-primary,
body[data-guide='actif'] .vide-actions .btn-primary,
body[data-guide='actif'] .panel-action .btn-primary {
  background: var(--surface);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

body[data-guide='actif'] .page-actions .btn-primary:hover:not(:disabled),
body[data-guide='actif'] .vide-actions .btn-primary:hover:not(:disabled),
body[data-guide='actif'] .panel-action .btn-primary:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.btn-danger {
  color: var(--danger);
}

.btn-danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg);
  border-color: transparent;
  color: var(--text);
}

/* Icone dessinee dans un bouton ou un lien (sprite <symbol> de la page). */
.icone {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===================== Pastilles d'icone et teintes ======================
   Un carre arrondi teinte qui porte l'icone d'une rubrique ou d'un chiffre
   (2026-10-24). La teinte se pose par data-teinte sur la pastille ou sur un
   ancetre (la rubrique entiere) : la pastille du titre et celle du sommaire
   la partagent ainsi sans la repeter. Fond a 11 %, comme les .badge :
   scripts/test-interface.js controle chaque teinte a 4,5:1 sur ce fond. */
[data-teinte='violet'] { --couleur-teinte: var(--teinte-violet); }
[data-teinte='sarcelle'] { --couleur-teinte: var(--teinte-sarcelle); }
[data-teinte='rose'] { --couleur-teinte: var(--teinte-rose); }
[data-teinte='ambre'] { --couleur-teinte: var(--teinte-ambre); }
[data-teinte='bleu'] { --couleur-teinte: var(--teinte-bleu); }
[data-teinte='vert'] { --couleur-teinte: var(--teinte-vert); }
[data-teinte='corail'] { --couleur-teinte: var(--teinte-corail); }
[data-teinte='ardoise'] { --couleur-teinte: var(--teinte-ardoise); }

.pastille-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--rayon-m);
  color: var(--couleur-teinte, var(--teinte-ardoise));
  background: color-mix(in srgb, var(--couleur-teinte, var(--teinte-ardoise)) 11%, transparent);
}

.pastille-icone .icone {
  width: 22px;
  height: 22px;
}

.pastille-icone-s {
  width: 28px;
  height: 28px;
  border-radius: var(--rayon-s);
}

.pastille-icone-s .icone {
  width: 16px;
  height: 16px;
}

.pastille-icone-l {
  width: 52px;
  height: 52px;
  border-radius: var(--rayon-l);
}

.pastille-icone-l .icone {
  width: 28px;
  height: 28px;
}

/* En-tete d'une carte qui porte une pastille : pastille, titre, une ligne
   d'aide. Sert aux rubriques du CV comme aux panneaux de la page Avancee. */
.tete-pastille {
  display: flex;
  align-items: flex-start;
  gap: var(--espace-3);
  margin-bottom: var(--espace-5);
}

.tete-pastille h2 {
  margin: 0;
  font-size: var(--taille-xl);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.tete-pastille .aide-ligne {
  margin: calc(var(--espace-1) / 2) 0 0;
}

.tete-pastille-texte {
  flex: 1;
  min-width: 0;
}

/* Le compteur a droite d'un en-tete (« 2 postes », « 3 actions »). */
.tete-pastille .count {
  margin-left: auto;
  white-space: nowrap;
  padding-top: var(--espace-1);
}

/* Cout d'une action, a cote de son libelle (« 1 crédit »). */
.btn-cout {
  font-size: var(--taille-xs);
  font-weight: var(--graisse-moyenne);
  opacity: 0.8;
}

/* ========================== Liste des offres ============================ */

/*
  Deux colonnes, pour voir deux fois plus d'offres d'un coup.
  `auto-fill` + minmax fait tout le travail sans media query : a 460 px
  minimum par carte, un ecran d'ordinateur portable en affiche deux, un
  ecran etroit une seule, un tres grand ecran trois.

  `align-items: start` est indispensable : sans lui, la grille etire chaque
  carte a la hauteur de la plus grande de sa rangee, et une annonce courte
  se retrouve avec un grand vide entre son texte et ses boutons.
*/
.offer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* `min(460px, 100%)` et non `460px` : sur un ecran plus etroit que la
     largeur minimale demandee, la colonne se rabat sur la largeur
     disponible au lieu de forcer la page a deborder horizontalement.
     Sans le min(), la page Offres faisait 536 px de large sur un
     telephone de 390 px. */
  grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr));
  gap: var(--espace-4);
  align-items: start;
}

/*
  La barre de couleur a gauche de chaque carte indique le type de contrat.
  data-contract="CDI" sur le <li> selectionne la bonne couleur ci-dessous.
*/
/*
  La carte s'empile en colonne : dans une grille a deux colonnes, il n'y a
  plus la place de mettre le score et les boutons a droite du texte.

  Elle ne s'etire PAS a la hauteur de sa voisine (voir align-items sur
  .offer-list) : la hauteur suit le contenu, les boutons restent colles au
  texte. Aligner les boutons d'une rangee couterait un vide de plusieurs
  centimetres dans les cartes les plus courtes.
*/
/* La couleur du contrat tient dans sa pastille : assez pour reconnaitre un
   CDI d'une alternance d'un coup d'oeil, sans transformer la liste en
   arc-en-ciel. */
.offer-card {
  --contract-color: var(--contract-autre);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--espace-4);
  padding: var(--espace-5) var(--espace-5) var(--espace-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  box-shadow: var(--ombre-1);
  transition: box-shadow var(--duree), border-color var(--duree), opacity var(--duree);
}

.offer-card:hover {
  border-color: color-mix(in srgb, var(--text-muted) 40%, var(--border));
  box-shadow: var(--ombre-2);
}

/* Toute la carte ouvre le detail (app.js) ; une carte reservee n'en a pas. */
.offer-card:not(.offre-reservee) {
  cursor: pointer;
}

.offer-card[data-contract="CDI"] { --contract-color: var(--contract-cdi); }
.offer-card[data-contract="Alternance"] { --contract-color: var(--contract-alternance); }
.offer-card[data-contract="Freelance"] { --contract-color: var(--contract-freelance); }
.offer-card[data-contract="CDD"] { --contract-color: var(--contract-cdd); }
.offer-card[data-contract="Stage"] { --contract-color: var(--contract-stage); }

/*
  Pas de `flex: 1 1 320px` ici : la carte s'empile desormais en colonne, et
  une base de 320 px s'y appliquerait a la HAUTEUR — creusant un vide de
  plusieurs centimetres entre le texte et les boutons.
*/
.offer-main {
  min-width: 0;
}

/* Le score passe a gauche du titre : c'est ce qu'on lit en premier quand on
   balaie une liste de cartes du regard. `align-items: baseline` aligne le
   gros chiffre sur la premiere ligne du titre, meme s'il tient sur deux. */
.offer-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.offer-title {
  margin: 0;
  font-size: var(--taille-l);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.offer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--espace-3) 0 0;
}

/* Pastille teintee : le fond reprend la couleur du texte a 12 %. Chaque
   variante n'a donc qu'une couleur a declarer, et le type de contrat garde
   son code couleur du cahier des charges dans les deux themes. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--taille-xs);
  font-weight: var(--graisse-forte);
  line-height: 1.4;
  padding: 3px 9px;
  border-radius: var(--rayon-plein);
  border: 0;
  background: color-mix(in srgb, currentColor 11%, transparent);
}

.badge-contract {
  color: var(--contract-color);
}

.badge-done {
  color: var(--contract-cdi);
}

.badge-source {
  color: var(--text-muted);
}

.offer-meta {
  margin: var(--espace-1) 0 0;
  color: var(--text-muted);
  font-size: var(--taille-m);
}

.sep {
  margin: 0 6px;
  opacity: 0.5;
}

.offer-side {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Score de pertinence */
.score {
  line-height: 1.1;
  white-space: nowrap;
}

.score-value {
  font-size: var(--taille-2xl);
  font-weight: var(--graisse-noire);
  letter-spacing: -0.03em;
}

.score-unit {
  font-size: var(--taille-s);
  color: var(--text-muted);
}

/* Les actions d'une offre, toujours dans le meme ordre et au meme endroit :
   on apprend une fois ou cliquer. Un filet les separe du contenu. */
.offer-actions {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-2);
  padding-top: var(--espace-4);
  border-top: 1px solid var(--border);
}

/* « Postulée » et « Pas intéressé » sont des rangements, pas des actions
   principales : en retrait, poussees a droite quand la place le permet. */
.offer-actions [data-action='postule'] {
  margin-left: auto;
}

.offer-actions [data-action='postule'],
.offer-actions [data-action='hide'] {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-muted);
}

.offer-actions [data-action='postule']:hover,
.offer-actions [data-action='hide']:hover {
  background: var(--bg);
  color: var(--text);
}

.offer-actions [data-action='hide']:hover {
  color: var(--danger);
}

/* ======================== Tableau des candidatures ====================== */

/* Le tableau defile horizontalement dans son cadre plutot que d'elargir la page. */
.table-scroll {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--taille-m);
}

.history-table th,
.history-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.history-table th {
  font-size: var(--taille-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-table tbody tr:hover td {
  background: var(--bg);
}

.status-select {
  width: auto;
  min-width: 160px;
  padding: 4px 8px;
  font-size: var(--taille-s);
}

/* Relance en retard : mise en evidence */
.relance.is-due {
  color: var(--danger);
  font-weight: 600;
}

.doclink {
  color: var(--accent);
  margin-right: 10px;
}

/* ======================== Messages d'erreur ============================= */

/* Nom historique (ecran de connexion, retire) : reutilise par tous les formulaires. */
.login-error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: var(--taille-s);
}

/* ======================= Etats vides et divers ========================== */

.empty-state {
  margin: 0;
  padding: var(--espace-7) var(--espace-5);
  border: 1px dashed var(--bordure-champ);
  border-radius: var(--rayon-l);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--taille-m);
  text-align: center;
}

/* Dans un panneau, l'etat vide est une simple phrase : un cadre pointille
   dans un cadre blanc empilait les boites. Pose sur le fond (sections
   .panel-nu), il garde son cadre. */
.panel:not(.panel-nu) .empty-state {
  padding: var(--espace-2) 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--espace-2);
}

/* Bouton fait d'une seule icone (fermer une fenetre) : carre, centre. Son
   sens est porte par aria-label. */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
}

.btn-icon .icone {
  width: 18px;
  height: 18px;
}

/* Action destructive confirmee (supprimer, retirer) : rouge plein, reserve
   aux fenetres de confirmation. */
.btn-danger-plein {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--accent-text);
}

.btn-danger-plein:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 85%, var(--text));
  border-color: color-mix(in srgb, var(--danger) 85%, var(--text));
}

/* Bascule de theme : une simple icone ronde, sans texte. Le bouton montre le
   theme vers lequel il fait basculer (lune en clair, soleil en sombre) ;
   theme.js ne touche qu'a aria-pressed, le CSS choisit l'icone. */
.btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--rayon-m);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color var(--duree-courte), color var(--duree-courte);
}

.btn-theme:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-theme svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-theme .icone-soleil,
.btn-theme[aria-pressed='true'] .icone-lune {
  display: none;
}

.btn-theme[aria-pressed='true'] .icone-soleil {
  display: block;
}

/* Badge "presence" (teletravail / hybride / sur site) : gris neutre,
   pour ne pas concurrencer la couleur du type de contrat. */
.badge-remote {
  color: var(--text-muted);
}

/* Ligne "pourquoi ce score" sous chaque offre */
.offer-why {
  margin: var(--espace-2) 0 0;
  font-size: var(--taille-s);
  color: var(--text-muted);
}

/* ========================= Fenetre de detail ============================ */

.dialog {
  width: min(760px, 92vw);
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: var(--rayon-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--ombre-3);
}

/* Ouverture : la fenetre monte de quelques pixels en apparaissant. Elle
   signale qu'un nouvel ecran s'est pose par-dessus, rien de plus. */
.dialog[open] {
  animation: fenetre-entree var(--duree-longue) var(--courbe-sortie);
}

@keyframes fenetre-entree {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

.dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}

.dialog-inner {
  padding: var(--espace-6) var(--espace-7) var(--espace-7);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-head h2 {
  margin: 0;
  font-size: var(--taille-2xl);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.detail-why {
  margin: var(--espace-3) 0;
  padding: var(--espace-3) var(--espace-4);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  background: var(--accent-soft);
  border-radius: var(--rayon-m);
  font-size: var(--taille-m);
  color: var(--text);
}

/* La description garde ses retours a la ligne mais ne deborde jamais. */
/* Postuler, Adapter mon CV, Lettre et "Compléter" sur la même ligne, au-dessus
   de la description : on décide en la lisant, l'action doit être juste à côté
   (et c'est aussi en la lisant qu'on constate qu'elle est incomplète). */
.detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.detail-description {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font: inherit;
  font-size: var(--taille-m);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  max-height: 45vh;
  overflow-y: auto;
}

/* ============================== Mobile ================================== */

@media (max-width: 640px) {
  .container {
    padding: 16px;
  }

  .offer-side {
    width: 100%;
    justify-content: space-between;
  }

  /*
    Sur petit ecran, le tableau passe en "cartes" : chaque cellule affiche
    son intitule de colonne (via data-label) au lieu d'un en-tete lointain.
  */
  .history-table thead {
    display: none;
  }

  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table td {
    display: block;
    width: 100%;
  }

  .history-table tr {
    border: 1px solid var(--border);
    border-radius: var(--rayon-l);
    margin-bottom: 10px;
    padding: 4px 0;
  }

  .history-table td {
    border-bottom: none;
    white-space: normal;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  .history-table td::before {
    content: attr(data-label);
    font-size: var(--taille-xs);
    color: var(--text-muted);
    font-weight: 600;
  }
}

/* ==================== Fenetre de relecture du CV ======================== */

.dialog-large {
  width: min(900px, 94vw);
}

.dialog-pied {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Note explicative : la meme pour toute l'application. Un fond legerement
   en retrait et un filet fin : elle se lit, sans se confondre avec une
   alerte. */
.cv-note {
  margin: var(--espace-3) 0 var(--espace-4);
  padding: var(--espace-3) var(--espace-4);
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--rayon-m);
  font-size: var(--taille-m);
  color: var(--text-muted);
}

/* Une note qui commence par son icone (le cadenas de la page CV). */
.cv-note-icone {
  display: flex;
  align-items: flex-start;
  gap: var(--espace-3);
}

.cv-note-icone .icone {
  margin-top: 2px;
  color: var(--accent);
}

.cv-alerte {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: var(--rayon-m);
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--taille-s);
}

/* Intertitre a l'interieur d'une carte ou d'une rubrique (« Photo »,
   « Langues ») : en 13 px, il ne se distinguait pas d'un libelle de champ. */
.cv-sous-titre {
  margin: var(--espace-6) 0 var(--espace-2);
  font-size: var(--taille-base);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.01em;
}

/* L'aide d'une rubrique ou d'un reglage : UNE ligne, lisible, a cote de ce
   qu'elle explique. Le detail, s'il y en a, va dans un <details class="aide">
   « Pourquoi ? » juste en dessous. */
.aide-ligne {
  margin: 0 0 var(--espace-3);
  max-width: 62ch;
  color: var(--text-muted);
  font-size: var(--taille-m);
  line-height: 1.5;
}

.cv-compteur {
  margin: 4px 0 0;
  font-size: var(--taille-xs);
  color: var(--text-muted);
}

/* Le compteur passe en rouge des que le paragraphe risque de faire
   deborder le CV sur une deuxieme page. */
.cv-compteur.depasse {
  color: var(--danger);
  font-weight: 600;
}

.cv-colonnes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .cv-colonnes {
    grid-template-columns: 1fr;
  }
}

.cases {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Variante en ligne, pour les groupes courts (filtres, sources, contrats) :
   une colonne de six cases rendrait la barre de filtres deux fois plus haute
   que les listes deroulantes voisines. */
.cases-inline {
  flex-direction: row;
  flex-wrap: wrap;
  column-gap: 14px;
  row-gap: 4px;
}

.cases label,
.case-competence {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--taille-s);
  cursor: pointer;
}

/* Un libelle de case ne se coupe jamais en deux lignes : la case a cocher
   se retrouverait orpheline au-dessus de son texte. */
.cases-inline label {
  white-space: nowrap;
}

.case-competence input {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.cv-manquants {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: var(--taille-s);
  color: var(--text-muted);
}

/* ---- Suggestions tirees de l'offre (ecran d'adaptation du CV) ---- */

.cv-suggestions {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  background: var(--bg);
}

.cv-suggestions > .cv-sous-titre:first-child {
  margin-top: 0;
}

.cv-suggestion-liste {
  margin: 6px 0 12px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cv-suggestion-liste li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  border-radius: var(--rayon-s);
  background: var(--surface);
  font-size: var(--taille-s);
}

/* Une suggestion acceptee reste visible, barree : on doit pouvoir verifier
   d'un coup d'oeil ce qu'on vient d'affirmer savoir faire. */
.cv-suggestion-liste li.suggestion-prise span {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ---- Ajout d'une competence pour cette offre ---- */

.cv-ajout {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.cv-ajout input {
  flex: 1 1 140px;
  min-width: 0;
}

.cv-ajout select {
  flex: 1 1 140px;
  min-width: 0;
}

/* ---- Le reste du CV, replie ---- */

.cv-details {
  margin: 18px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  background: var(--bg);
}

.cv-details > summary {
  cursor: pointer;
  font-size: var(--taille-s);
  font-weight: 600;
}

.cv-details[open] > summary {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ---- Recapitulatif des ecarts avec le profil ----
   POURQUOI CE BLOC EXISTE
   Il remplace le verrouillage des blocs factuels. Le serveur ne recolle plus
   les faits depuis la base : c'est cet affichage, obligatoire avant l'export,
   qui garantit qu'aucun fait ne part sans avoir ete montre. */

.cv-ecarts {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--rayon-l);
  background: var(--bg);
}

.cv-ecarts > .cv-sous-titre:first-child {
  margin-top: 0;
}

.cv-ecarts-liste {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.cv-ecarts-liste li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 6px 8px;
  border-radius: var(--rayon-s);
  background: var(--surface);
  font-size: var(--taille-xs);
}

.ecart-libelle {
  font-weight: 600;
  font-size: var(--taille-xs);
}

.ecart-avant {
  color: var(--text-muted);
  text-decoration: line-through;
}

.ecart-apres {
  color: var(--text);
}

/* Un ajout — une competence ou une experience qui n'existe pas dans le
   profil — se distingue d'une simple reformulation : c'est une affirmation
   nouvelle sur le parcours. */
.cv-ecarts-liste li.ecart-ajout {
  border-color: color-mix(in srgb, var(--attention) 45%, var(--border));
  background: var(--attention-soft);
}

/* Bloc verrouille : visuellement inerte, pour montrer que ces informations
   ne sont pas modifiables ici — et ne le sont pas non plus cote serveur. */
.cv-verrouille {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--taille-s);
  max-height: 260px;
  overflow-y: auto;
}

.cv-verrouille ul {
  margin: 2px 0 10px;
  padding-left: 18px;
}

.fait-titre {
  margin: 10px 0 2px;
  font-weight: 600;
  color: var(--text);
  font-size: var(--taille-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cv-verrouille > .fait-titre:first-child {
  margin-top: 0;
}

/* ================= Fenetre de relecture de la lettre ==================== */

/* Note d'avertissement : ton different de la note du CV, car la promesse
   n'est pas la meme (pas de garantie structurelle sur un texte libre). */
.cv-note-attention {
  border-color: color-mix(in srgb, var(--attention) 40%, transparent);
  background: var(--attention-soft);
  color: var(--text);
}

.lettre-paragraphe {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.lettre-paragraphe textarea {
  resize: vertical;
}

.lettre-paragraphe .btn {
  align-self: flex-start;
}

/* Bouton "Essayer un autre style" : pousse a gauche, loin de "Valider". */
.dialog-pied .pied-gauche {
  margin-right: auto;
}

/* Choix du style : de gros boutons plutot qu'une liste deroulante, pour lire
   la description de chaque style avant de depenser un appel payant. */
.styles-lettre {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 600px) {
  .styles-lettre {
    grid-template-columns: 1fr;
  }
}

.style-lettre {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  cursor: pointer;
}

.style-lettre:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: var(--ombre-3);
}

.style-lettre:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Le style de la lettre en cours de relecture, quand on en essaie un autre. */
.style-lettre[aria-current='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.style-lettre:disabled {
  cursor: progress;
  opacity: 0.6;
}

/* ==================== Tableau de suivi des candidatures ================= */

.suivi-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* Le tableau devient dense : on autorise le retour a la ligne sur les
   colonnes de texte, sinon la ligne devient interminable. */
.history-table td[data-label='Poste'],
.history-table td[data-label='Notes'] {
  white-space: normal;
  min-width: 180px;
}

.notes-input {
  min-width: 200px;
  font-size: var(--taille-s);
  padding: 4px 8px;
  resize: vertical;
}

.docs-etat {
  font-size: var(--taille-s);
  color: var(--text-muted);
}

.docs-presents {
  color: var(--contract-cdi);
  font-weight: 600;
}

/* ==================== Fenetre d'ajout d'une offre ====================== */

.ajout-url {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

/* Deux colonnes pour les champs courts, une seule sur petit ecran. */
.ajout-champs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.ajout-message {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: var(--rayon-s);
  font-size: var(--taille-s);
}

/* Un echec d'extraction n'est pas une erreur : LinkedIn bloque la lecture
   automatique par conception. Le message reste neutre et oriente vers le
   collage de texte, plutot que d'afficher un bandeau rouge. */
.ajout-info {
  border: 1px solid color-mix(in srgb, var(--attention) 35%, transparent);
  background: var(--attention-soft);
  color: var(--text);
}

.ajout-succes {
  border: 1px solid color-mix(in srgb, var(--succes) 35%, transparent);
  background: var(--succes-soft);
  color: var(--text);
}

/* ===================== Recherche automatique ============================ */

.recherche-etat {
  margin: 0 0 16px;
  padding: 9px 12px;
  border-radius: var(--rayon-s);
  font-size: var(--taille-s);
}

/* ============================ Page Profil =============================== */

.profil-chargement {
  margin: 0;
  padding: 24px;
  color: var(--text-muted);
}

/* Champs courts cote a cote, une seule colonne sur petit ecran. Meme
   principe que .ajout-champs, avec un minimum plus large : les libelles du
   profil ("Titre professionnel", "Établissement") sont plus longs. */
.profil-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  align-items: end;
}

/* Un champ qui n'attend que deux chiffres n'a pas a barrer tout l'ecran. */
.champ-etroit {
  max-width: 120px;
}

.profil-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

/* ================================ Page CV ================================
   Refonte du 2026-10-24 (inspiration : le parcours de cvmove.com, sans en
   reprendre ni les couleurs ni les formes). Le long formulaire d'un seul
   bloc est decoupe en rubriques, chacune dans sa carte, avec un sommaire qui
   dit ce qui est rempli et ce qui manque. CV et criteres de recherche sont
   sur deux onglets : la page ne s'etire plus a l'infini.
   js/profil.js (formulaire, sommaire, onglets), js/constructionCV.js (import
   et assistant pas a pas), js/listeRepetable.js (blocs repliables). */

/* --- Onglets de la page : Mon CV, Ma recherche, Administration --- */

.onglets-page {
  display: inline-flex;
  align-self: flex-start;
  gap: var(--espace-1);
  max-width: 100%;
  padding: var(--espace-1);
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  box-shadow: var(--ombre-1);
}

.onglet-page {
  display: inline-flex;
  align-items: center;
  gap: var(--espace-2);
  padding: var(--espace-2) var(--espace-4);
  font: inherit;
  font-size: var(--taille-m);
  font-weight: var(--graisse-moyenne);
  color: var(--text-muted);
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: var(--rayon-m);
  cursor: pointer;
  transition: background-color var(--duree-courte), color var(--duree-courte);
}

.onglet-page:hover {
  background: var(--bg);
  color: var(--text);
}

/* L'onglet ouvert : la selection, donc l'accent (Regle de la Voix Unique). */
.onglet-page[aria-selected='true'] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: var(--graisse-forte);
}

.panneau-page {
  display: flex;
  flex-direction: column;
  gap: var(--espace-6);
}

/* --- Disposition : le sommaire a gauche, les rubriques a droite --- */

.cv-disposition {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: var(--espace-6);
  align-items: start;
}

.cv-rubriques {
  display: flex;
  flex-direction: column;
  gap: var(--espace-5);
  min-width: 0;
}

/* --- Sommaire --- */

.sommaire {
  position: sticky;
  top: calc(var(--hauteur-barre) + var(--espace-5));
  display: flex;
  flex-direction: column;
  gap: var(--espace-4);
}

/* La completude : combien des rubriques indispensables sont remplies. Ce
   sont celles que verifie cvGuard.js avant toute generation. */
.completude {
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  padding: var(--espace-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  box-shadow: var(--ombre-1);
}

.completude-jauge {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
}

.completude-jauge svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.completude-fond,
.completude-valeur {
  fill: none;
  stroke-width: 6;
}

.completude-fond {
  stroke: var(--border);
}

/* L'anneau se remplit : c'est le moment fort de la page. Le trait est
   mesure sur 100 (pathLength) : 75 % de rempli = 25 de decalage. */
.completude-valeur {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset var(--duree-moment) var(--courbe-sortie), stroke var(--duree);
}

.completude[data-pret='oui'] .completude-valeur {
  stroke: var(--succes);
}

.completude-chiffre {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--taille-s);
  font-weight: var(--graisse-noire);
  font-variant-numeric: tabular-nums;
}

.completude-titre {
  margin: 0;
  font-weight: var(--graisse-titre);
  line-height: 1.3;
}

.completude-texte {
  margin: calc(var(--espace-1) / 2) 0 0;
  color: var(--text-muted);
  font-size: var(--taille-s);
  line-height: 1.35;
}

.sommaire-liste {
  display: flex;
  flex-direction: column;
  gap: calc(var(--espace-1) / 2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* position: relative : le libelle d'etat masque (.visually-hidden, en
   position absolue) reste ainsi contenu dans le lien. Sans ancetre
   positionne, il s'echappait de la rangee defilante du telephone et
   elargissait toute la page (1 653 px mesures pour un ecran de 390). */
.sommaire-lien {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  padding: var(--espace-2);
  color: var(--text-muted);
  font-size: var(--taille-m);
  font-weight: var(--graisse-moyenne);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--rayon-m);
  transition: background-color var(--duree-courte), color var(--duree-courte),
    border-color var(--duree-courte);
}

.sommaire-lien:hover {
  background: var(--surface);
  color: var(--text);
}

/* La rubrique a l'ecran, suivie au defilement (IntersectionObserver). */
.sommaire-lien[aria-current='location'] {
  background: var(--surface);
  color: var(--text);
  font-weight: var(--graisse-forte);
  border-color: var(--border);
  box-shadow: var(--ombre-1);
}

.sommaire-nom {
  flex: 1;
  min-width: 0;
}

.sommaire-etat {
  display: inline-flex;
  flex: none;
}

.sommaire-etat .icone {
  width: 18px;
  height: 18px;
}

.sommaire-etat[data-etat='rempli'] {
  color: var(--succes);
}

.sommaire-etat[data-etat='manque'] {
  color: var(--attention);
}

.sommaire-etat[data-etat='facultatif'] {
  color: var(--text-muted);
  font-size: var(--taille-xs);
}

/* Une rubrique qui devient complete : la coche eclot. */
.sommaire-etat.vient-de-cocher {
  animation: coche-eclot var(--duree-longue) var(--courbe-sortie);
}

@keyframes coche-eclot {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  60% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.sommaire-outils {
  display: flex;
  flex-direction: column;
  gap: var(--espace-2);
}

.sommaire-outils .btn {
  justify-content: flex-start;
}

/* --- Rubriques --- */

/* Une carte par rubrique ; tout ce qu'elle contient est espace par le meme
   ecart, au lieu de marges posees au cas par cas. */
.rubrique {
  display: flex;
  flex-direction: column;
  gap: var(--espace-4);
  padding: var(--espace-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  box-shadow: var(--ombre-1);
  scroll-margin-top: calc(var(--hauteur-barre) + var(--espace-5));
}

.rubrique > * {
  margin-top: 0;
  margin-bottom: 0;
}

.rubrique > .tete-pastille {
  margin-bottom: var(--espace-1);
}

.rubrique > .cv-sous-titre {
  margin-top: var(--espace-3);
}

.rubrique > .aide-ligne {
  margin-top: calc(-1 * var(--espace-3));
}

/* Les blocs d'une liste (experiences, formations...), les uns sous les
   autres. */
.liste-blocs {
  display: flex;
  flex-direction: column;
  gap: var(--espace-3);
}

.liste-blocs:empty {
  display: none;
}

/* « + Ajouter une experience » : toute la largeur, en pointilles, la ou le
   prochain bloc viendra se poser. */
.btn-ajouter {
  width: 100%;
  padding: var(--espace-3);
  color: var(--accent);
  background: transparent;
  border: 1px dashed var(--bordure-champ);
  box-shadow: none;
}

.btn-ajouter:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* --- Blocs repetables repliables (page CV seulement) ---
   L'ecran d'adaptation (index.html) garde ses blocs a plat : ces regles ne
   portent que sur les blocs poses dans une rubrique. */

/* min-width: 0 : un <fieldset> refuse sinon de retrecir sous la largeur de
   son contenu, et sur telephone les boutons du bloc sortaient de la carte. */
.rubrique .bloc-repetable {
  min-width: 0;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-m);
  transition: border-color var(--duree-courte), box-shadow var(--duree-courte);
}

.rubrique .bloc-repetable:last-of-type {
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.rubrique .bloc-repetable:not(.est-replie):not(.bloc-compact) {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--ombre-1);
}

/* Un bloc replie, ou une langue, est une simple rangee de liste : pas de
   cadre dans la carte de la rubrique (Regle du Cadre Unique), un filet
   dessous. Seul le bloc ouvert garde son contour. */
.rubrique .bloc-repetable.est-replie,
.rubrique .bloc-repetable.bloc-compact {
  background: transparent;
  border-color: transparent;
  border-bottom-color: var(--border);
  border-radius: 0;
}

.rubrique .bloc-repetable.est-replie .bloc-tete {
  padding-left: 0;
}

.rubrique .bloc-repetable.bloc-compact {
  padding-left: 0;
  padding-right: 0;
}

.rubrique .liste-blocs {
  gap: var(--espace-1);
}

.rubrique .bloc-tete {
  align-items: center;
  gap: var(--espace-2);
  margin: 0;
  padding: var(--espace-2) var(--espace-2) var(--espace-2) var(--espace-4);
}

.bloc-bascule {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--espace-3);
  min-width: 0;
  padding: var(--espace-2) 0;
  font: inherit;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--rayon-s);
  cursor: pointer;
}

.bloc-resume {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bloc-resume-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bloc-resume-titre {
  font-weight: var(--graisse-forte);
}

.bloc-resume-detail {
  color: var(--text-muted);
  font-size: var(--taille-m);
}

.bloc-resume-detail:empty {
  display: none;
}

.bloc-chevron {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform var(--duree) var(--courbe-sortie);
}

.bloc-repetable:not(.est-replie) .bloc-chevron {
  transform: rotate(180deg);
}

.rubrique .bloc-outils {
  align-items: center;
}

.rubrique .bloc-outils .btn-icon {
  width: 32px;
  height: 32px;
  box-shadow: none;
}

.rubrique .bloc-outils .btn-icon .icone {
  width: 16px;
  height: 16px;
}

.rubrique .bloc-corps {
  display: flex;
  flex-direction: column;
  gap: var(--espace-3);
  padding: 0 var(--espace-4) var(--espace-4);
}

.bloc-repetable.est-replie .bloc-corps {
  display: none;
}

.rubrique .bloc-compact {
  padding: var(--espace-3) var(--espace-4);
}

.rubrique .bloc-compact .bloc-outils {
  align-self: end;
  padding-bottom: var(--espace-1);
}

/* --- Barre d'enregistrement ---
   Collee au bas de l'ecran tant qu'on est dans les rubriques, elle se pose
   a la fin du formulaire. Elle dit toujours ou en est la saisie : rien
   n'est enregistre sans clic, il faut que ca se voie. */

.barre-enregistrement {
  position: sticky;
  bottom: var(--espace-4);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-3);
  padding: var(--espace-3) var(--espace-3) var(--espace-3) var(--espace-5);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  box-shadow: var(--ombre-2);
}

.barre-etat {
  display: flex;
  align-items: center;
  gap: var(--espace-2);
  margin-right: auto;
  color: var(--text-muted);
  font-size: var(--taille-m);
}

.barre-pastille {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--succes);
}

/* Premiere modification : la pastille passe a l'ambre, une onde part une
   fois, pour qu'on remarque que la barre attend un clic. */
.barre-pastille::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
}

.barre-enregistrement[data-etat='modifie'] .barre-pastille {
  background: var(--attention);
}

.barre-enregistrement[data-etat='modifie'] .barre-pastille::after {
  animation: pastille-onde var(--duree-moment) var(--courbe-sortie);
}

.barre-enregistrement[data-etat='modifie'] .barre-etat {
  color: var(--text);
  font-weight: var(--graisse-moyenne);
}

@keyframes pastille-onde {
  from {
    opacity: 0.55;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(3.2);
  }
}

/* Les scores des offres sont a recalculer : une seconde ligne dans la
   barre, avec son bouton. */
.barre-perimes {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-2) var(--espace-3);
  padding-top: var(--espace-3);
  border-top: 1px solid var(--border);
  font-size: var(--taille-m);
}

.barre-perimes p {
  margin: 0 auto 0 0;
}

/* --- Ecran de depart (CV vide) --- */

.import-zone {
  margin-bottom: var(--espace-1);
}

.depart-intro {
  margin: 0 0 var(--espace-5);
  color: var(--text-muted);
  max-width: 62ch;
}

.depart-choix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--espace-4);
}

/* Un vrai <button>, habille en carte : il se navigue au clavier. */
.choix-depart {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--espace-2);
  padding: var(--espace-6);
  font: inherit;
  color: var(--text);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  box-shadow: var(--ombre-1);
  cursor: pointer;
  transition: border-color var(--duree-courte), box-shadow var(--duree-courte),
    transform var(--duree-courte) var(--courbe-sortie);
}

.choix-depart:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: var(--ombre-2);
  transform: translateY(-2px);
}

.choix-depart:disabled {
  cursor: progress;
  opacity: 0.6;
}

.choix-depart .pastille-icone {
  margin-bottom: var(--espace-2);
}

.choix-titre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-2);
  font-size: var(--taille-l);
  font-weight: var(--graisse-titre);
}

.choix-recommande {
  padding: calc(var(--espace-1) / 2) var(--espace-2);
  color: var(--accent);
  font-size: var(--taille-xs);
  font-weight: var(--graisse-forte);
  background: var(--accent-soft);
  border-radius: var(--rayon-plein);
}

.choix-texte {
  color: var(--text-muted);
}

.choix-meta {
  margin-top: auto;
  padding-top: var(--espace-2);
  color: var(--accent);
  font-size: var(--taille-m);
  font-weight: var(--graisse-forte);
}

.depart-autre {
  margin: var(--espace-4) 0 0;
}

/* --- Assistant pas a pas : une question par ecran ---
   Le meme formulaire, une rubrique a la fois, dans une seule carte : la
   question en grand, le conseil dans une bulle, les boutons colles en bas. */

.mode-assistant .hors-assistant,
.mode-assistant .etape:not(.etape-active) {
  display: none;
}

/* Le reste de la page (onglets, criteres de recherche...) attend la fin du
   CV. */
.assistant-actif .onglets-page,
.assistant-actif .panneau-page:not(#panneau-cv) {
  display: none;
}

.mode-assistant .cv-disposition {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

.mode-assistant .cv-rubriques {
  gap: 0;
  padding: var(--espace-7) var(--espace-7) 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-xl);
  box-shadow: var(--ombre-1);
}

/* Dans la carte de l'assistant, la rubrique perd sa propre carte (pas de
   cadre dans un cadre) et son titre : la question le remplace. */
.mode-assistant .rubrique {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.mode-assistant .rubrique > .tete-pastille {
  display: none;
}

/* Aussi precis que la regle du bloc ouvert (.rubrique ...:not(...)), qui
   l'emportait sinon et laissait un contour autour du seul bloc. */
.mode-assistant .rubrique .bloc-repetable:only-child:not(.bloc-compact) {
  border-color: transparent;
  box-shadow: none;
}

.mode-assistant .bloc-repetable:only-child .bloc-tete {
  display: none;
}

.mode-assistant .bloc-repetable:only-child .bloc-corps {
  padding: 0;
}

.assistant-tete {
  margin-bottom: var(--espace-6);
}

.assistant-progression {
  display: flex;
  align-items: center;
  gap: var(--espace-4);
  margin-bottom: var(--espace-6);
}

.assistant-segments {
  display: flex;
  flex: 1;
  gap: var(--espace-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.assistant-segments li {
  flex: 1;
  height: 6px;
  border-radius: var(--rayon-plein);
  background: var(--border);
  transition: background-color var(--duree-longue) var(--courbe-sortie);
}

.assistant-segments li[data-etat='faite'] {
  background: var(--succes);
}

.assistant-segments li[data-etat='courante'] {
  background: var(--accent);
}

.assistant-compteur {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--taille-m);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.assistant-question {
  display: flex;
  align-items: center;
  gap: var(--espace-4);
}

.assistant-titre {
  margin: 0;
  font-size: var(--taille-3xl);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

.assistant-titre:focus {
  outline: none;
}

.bulle-conseil {
  display: flex;
  align-items: flex-start;
  gap: var(--espace-3);
  margin: var(--espace-5) 0 0;
  padding: var(--espace-3) var(--espace-4);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--rayon-l);
}

.bulle-conseil .icone {
  width: 20px;
  height: 20px;
  margin-top: calc(var(--espace-1) / 2);
  color: var(--accent);
}

.bulle-conseil p {
  margin: 0;
  max-width: 68ch;
}

.assistant-tete .alerte-attention {
  margin: var(--espace-4) 0 0;
}

/* Changement d'etape : la nouvelle arrive du cote ou l'on va. */
.mode-assistant .etape-active.entre-droite,
.assistant-question.entre-droite {
  animation: etape-droite var(--duree-longue) var(--courbe-sortie);
}

.mode-assistant .etape-active.entre-gauche,
.assistant-question.entre-gauche {
  animation: etape-gauche var(--duree-longue) var(--courbe-sortie);
}

@keyframes etape-droite {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@keyframes etape-gauche {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}

.assistant-nav {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-2);
  margin: var(--espace-6) calc(-1 * var(--espace-7)) 0;
  padding: var(--espace-4) var(--espace-7);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--rayon-xl) var(--rayon-xl);
}

.assistant-astuce {
  margin-left: auto;
  color: var(--text-muted);
  font-size: var(--taille-s);
}

.assistant-astuce kbd {
  padding: 1px 6px;
  font: inherit;
  font-size: var(--taille-xs);
  background: var(--surface-2);
  border: 1px solid var(--bordure-champ);
  border-radius: var(--rayon-s);
}

/* Suivant a droite, les deux autres a gauche. */
.assistant-nav .btn-primary {
  margin-left: auto;
}

.assistant-astuce + .btn-primary {
  margin-left: 0;
}

/* Pas de touche Entree sur un ecran tactile : l'astuce n'y a pas de sens. */
@media (hover: none) {
  .assistant-astuce {
    display: none;
  }
}

/* --- Bilan de l'import et champs a verifier --- */

.import-bilan p {
  margin: 0 0 6px;
}

.import-bilan ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.import-bilan .import-trop-long {
  color: var(--danger);
}

input.a-verifier,
textarea.a-verifier {
  border-color: var(--attention);
  background: var(--attention-soft);
}

/* A verifier n'est pas une erreur : meme forme que .cv-alerte, autre ton. */
.alerte-attention {
  border-color: var(--attention);
  background: var(--attention-soft);
  color: var(--text);
}

.alerte-attention ul {
  margin: 6px 0 0;
  padding-left: 18px;
  overflow-wrap: anywhere;
}

/* --- Onglet Ma recherche : les deux champs de « Ou chercher » --- */

.criteres-lieu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: var(--espace-3);
  align-items: start;
}

/* --- Telephone et tablette --- */

@media (max-width: 900px) {
  .cv-disposition {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Le sommaire devient une rangee de pastilles qui defile, en tete. Il ne
     colle plus : sous la barre du haut, il mangerait la moitie de l'ecran. */
  .sommaire {
    position: static;
  }

  /* La rangee defile : un fondu sur le bord droit le montre (sa barre de
     defilement est masquee sur telephone), et une marge de fin laisse la
     derniere pastille sortir du fondu. */
  .sommaire-liste {
    flex-direction: row;
    gap: var(--espace-2);
    overflow-x: auto;
    padding: 0 var(--espace-8) var(--espace-1) 0;
    mask-image: linear-gradient(to right, black calc(100% - var(--espace-8)), transparent);
  }

  /* Les pastilles gardent leur largeur et leur nom sur une ligne : en se
     resserrant, « Qualités et langues » passait sur trois lignes, et toute
     la rangee prenait cette hauteur (un vide de 50 px sous elle). */
  .sommaire-liste > li {
    flex: none;
  }

  .sommaire-nom {
    white-space: nowrap;
  }

  .sommaire-lien {
    background: var(--surface);
    border-color: var(--border);
  }

  .sommaire-outils {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  /* Sur telephone, la barre du haut tient sur trois lignes (logo, actions,
     onglets) : 136 px mesures a 375 px de large. */
  :root {
    --hauteur-barre: 136px;
  }

  .sommaire-liste {
    scrollbar-width: none;
  }

  /* Le premier ecran du telephone ne doit pas etre que de l'habillage : la
     note du cadenas perd son cadre, l'anneau tient sur une ligne. */
  .cv-note-icone {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .completude {
    padding: var(--espace-3);
  }

  .completude-jauge {
    width: 40px;
    height: 40px;
  }

  .completude-texte {
    display: none;
  }

  .onglets-page {
    display: flex;
    align-self: stretch;
  }

  .onglet-page {
    flex: 1;
    justify-content: center;
    padding: var(--espace-2) var(--espace-3);
  }

  .rubrique {
    padding: var(--espace-4);
  }

  .mode-assistant .cv-rubriques {
    padding: var(--espace-5) var(--espace-4) 0;
    border-radius: var(--rayon-l);
  }

  .assistant-nav {
    margin: var(--espace-5) calc(-1 * var(--espace-4)) 0;
    padding: var(--espace-3) var(--espace-4);
    border-radius: 0 0 var(--rayon-l) var(--rayon-l);
  }

  .assistant-titre {
    font-size: var(--taille-2xl);
  }

  .assistant-question .pastille-icone-l {
    width: 44px;
    height: 44px;
  }

  .barre-enregistrement {
    bottom: var(--espace-2);
    padding-left: var(--espace-4);
  }
}

/* Journal des erreurs (page Profil, administrateurs) */
.liste-erreurs {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.liste-erreurs li {
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  padding: 10px 12px;
}

.liste-erreurs .erreur-message {
  margin: 4px 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: var(--taille-s);
  overflow-wrap: anywhere;
}

/* Un bloc = une experience, une formation, une categorie de competences ou
   une langue. Le <fieldset> est volontaire : il regroupe des champs qui vont
   ensemble, et les lecteurs d'ecran l'annoncent comme tel. */
.bloc-repetable {
  margin: 0;
  padding: var(--espace-4) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.bloc-repetable:last-of-type {
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--espace-3);
}

.bloc-compact {
  padding: 10px 14px;
}

.bloc-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.bloc-outils {
  display: flex;
  align-items: end;
  gap: 4px;
}

/* Un libelle indispensable au lecteur d'ecran mais redondant a l'oeil, quand
   un titre juste au-dessus dit deja de quoi il s'agit. Retire du flux sans
   etre masque : display:none le rendrait invisible aussi pour l'assistance. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ========================= Marques sur les offres ======================= */

/* Une offre pour laquelle un CV a ete produit ou une candidature envoyee.
   Sans cette marque, rien ne distinguait a l'oeil les offres deja traitees
   des 100 autres : on regenerait un CV pour une offre deja traitee sans le
   savoir. */
.badge-done {
  color: var(--contract-cdi);
}

.offer-card[data-status="traitee"] {
  /* Legerement en retrait : deja fait, donc moins urgent a lire. */
  opacity: 0.72;
}

.offer-card[data-status="traitee"]:hover {
  opacity: 1;
}

/* ============================ Page Avancee ==============================
   Refonte du 2026-10-24 : quatre chiffres qui menent quelque part, ce qu'il
   y a a faire, puis deux graphiques qui racontent quelque chose (l'entonnoir
   de l'offre a l'entretien, le rythme des candidatures). Aucune librairie :
   la CSP interdit tout script externe ; l'entonnoir est en CSS, la courbe en
   SVG construit par js/avancee.js. */

/* Les grands chiffres de l'accueil (.tuiles, accueil.js) gardent ces regles. */
.tuiles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-4) 0;
}

.tuile {
  padding: 0 var(--espace-6);
  border-left: 1px solid var(--border);
}

.tuile:first-child {
  padding-left: 0;
  border-left: 0;
}

.tuile-valeur {
  font-size: var(--taille-2xl);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Rien a compter (compte neuf) : une phrase, pas une rangee de zeros. */
.tuiles-vide {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--taille-m);
}

.tuile-libelle {
  margin-top: 4px;
  font-size: var(--taille-s);
  color: var(--text-muted);
}

/* --- Les quatre chiffres : chacun est un lien vers la page qui agit --- */

.avancee-tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--espace-4);
}

.tuile-chiffre {
  display: flex;
  flex-direction: column;
  gap: calc(var(--espace-1) / 2);
  padding: var(--espace-5);
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  box-shadow: var(--ombre-1);
  transition: border-color var(--duree-courte), box-shadow var(--duree-courte),
    transform var(--duree-courte) var(--courbe-sortie);
}

.tuile-chiffre:hover {
  border-color: var(--bordure-champ);
  box-shadow: var(--ombre-2);
  transform: translateY(-2px);
}

.tuile-chiffre-haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--espace-3);
}

.tuile-fleche {
  color: var(--text-muted);
  transition: transform var(--duree) var(--courbe-sortie), color var(--duree-courte);
}

.tuile-chiffre:hover .tuile-fleche {
  color: var(--accent);
  transform: translateX(3px);
}

.tuile-chiffre-valeur {
  font-size: var(--taille-3xl);
  font-weight: var(--graisse-noire);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.tuile-chiffre-libelle {
  font-weight: var(--graisse-moyenne);
}

.tuile-chiffre-detail {
  color: var(--text-muted);
  font-size: var(--taille-s);
}

/* Une relance en retard : la tuile le dit par son contour et sa ligne. */
.tuile-chiffre[data-alerte='oui'] {
  border-color: var(--attention);
}

.tuile-chiffre[data-alerte='oui'] .tuile-chiffre-detail {
  color: var(--attention);
  font-weight: var(--graisse-forte);
}

/* --- A faire maintenant --- */

/* Le panneau qui demande quelque chose : un contour d'accent, sans crier ;
   rien a faire, il redevient un panneau comme les autres. */
.panel-action {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.panel-action.rien-a-faire {
  border-color: var(--border);
}

.liste-action {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.liste-action li {
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  padding: var(--espace-3) 0;
  border-top: 1px solid var(--border);
}

.action-texte {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.item-titre {
  font-weight: var(--graisse-forte);
}

.item-detail {
  color: var(--text-muted);
  font-size: var(--taille-m);
}

.item-retard {
  color: var(--attention);
  font-size: var(--taille-m);
  font-weight: var(--graisse-forte);
}

.liste-action .btn {
  flex: none;
}

.liste-action + .profil-actions {
  margin-top: var(--espace-4);
}

/* Le score d'une offre a traiter, dans une pastille de la couleur de son
   niveau (memes teintes que les pastilles de la page Offres). */
.pastille-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--rayon-m);
  color: var(--couleur-niveau, var(--niveau-faible));
  background: color-mix(in srgb, var(--couleur-niveau, var(--niveau-faible)) 11%, transparent);
  font-size: var(--taille-m);
  font-weight: var(--graisse-noire);
  font-variant-numeric: tabular-nums;
}

.pastille-score[data-niveau='excellente'] { --couleur-niveau: var(--niveau-excellente); }
.pastille-score[data-niveau='bonne'] { --couleur-niveau: var(--niveau-bonne); }
.pastille-score[data-niveau='moyenne'] { --couleur-niveau: var(--niveau-moyenne); }

/* --- Les deux graphiques, cote a cote sur un grand ecran --- */

.avancee-graphiques {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: var(--espace-5);
  align-items: start;
}

/* L'entonnoir : de l'offre trouvee a l'entretien. Chaque barre est rognee
   (clip-path) plutot qu'etiree : ses coins restent ronds pendant qu'elle se
   remplit, de haut en bas, l'une apres l'autre. */
.entonnoir {
  display: flex;
  flex-direction: column;
  gap: var(--espace-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.entonnoir-etape {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) 3.5rem;
  align-items: center;
  gap: var(--espace-3);
}

.entonnoir-libelle {
  font-size: var(--taille-m);
  font-weight: var(--graisse-moyenne);
}

.entonnoir-piste {
  height: 28px;
  border-radius: var(--rayon-s);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}

.entonnoir-barre {
  height: 100%;
  border-radius: var(--rayon-s);
  background: var(--couleur-etape, var(--accent));
  clip-path: inset(0 calc((1 - var(--part, 0)) * 100%) 0 0 round var(--rayon-s));
  transition: clip-path var(--duree-moment) var(--courbe-sortie);
  transition-delay: calc(var(--rang, 0) * var(--decalage));
}

.entonnoir-etape:nth-child(1) { --couleur-etape: color-mix(in srgb, var(--accent) 32%, var(--surface)); }
.entonnoir-etape:nth-child(2) { --couleur-etape: color-mix(in srgb, var(--accent) 50%, var(--surface)); }
.entonnoir-etape:nth-child(3) { --couleur-etape: color-mix(in srgb, var(--accent) 72%, var(--surface)); }
.entonnoir-etape:nth-child(4) { --couleur-etape: var(--accent); }
.entonnoir-etape:nth-child(5) { --couleur-etape: var(--succes); }

.entonnoir-valeur {
  text-align: right;
  font-size: var(--taille-l);
  font-weight: var(--graisse-noire);
  font-variant-numeric: tabular-nums;
}

.entonnoir-etape:nth-child(5) .entonnoir-valeur {
  color: var(--succes);
}

/* Le filet court sur toute la carte, meme si la phrase est une aide d'une
   ligne (.aide-ligne, limitee a 62ch). */
.entonnoir-explication {
  max-width: none;
  margin: var(--espace-4) 0 0;
  padding-top: var(--espace-3);
  border-top: 1px solid var(--border);
}

/* La courbe de rythme : ligne, aire legere, moyenne en pointilles. */
.courbe-rythme {
  position: relative;
}

.courbe-rythme svg {
  display: block;
  width: 100%;
  overflow: visible;
  border-radius: var(--rayon-s);
}

.courbe-rythme svg:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.courbe-grille {
  stroke: var(--border);
  stroke-width: 1;
}

.courbe-texte {
  fill: var(--text-muted);
  font-family: var(--font);
  font-size: var(--taille-xs);
}

.courbe-aire {
  fill: color-mix(in srgb, var(--accent) 12%, transparent);
}

.courbe-ligne {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.courbe-moyenne {
  stroke: var(--text-muted);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.courbe-point {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}

.courbe-point-actuel {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2.5;
}

.courbe-point,
.courbe-point-actuel {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--duree-courte) var(--courbe-sortie);
}

.courbe-point.est-choisi,
.courbe-point-actuel.est-choisi {
  transform: scale(1.6);
}

.courbe-point.est-choisi {
  fill: var(--accent);
}

.courbe-repere {
  stroke: var(--bordure-champ);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

/* Le detail d'une semaine, au survol ou aux fleches du clavier. */
.courbe-bulle {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 6px 10px;
  color: var(--surface);
  font-size: var(--taille-s);
  line-height: 1.4;
  white-space: nowrap;
  background: var(--text);
  border-radius: var(--rayon-s);
  box-shadow: var(--ombre-2);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
}

.courbe-bulle strong {
  display: block;
}

/* Un graphique sans rien a montrer : une phrase et son picto, sans cadre
   (Regle du Cadre Unique : on est deja dans un panneau). */
.graphique-vide {
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  margin: 0;
  color: var(--text-muted);
}

/* --- Details de tes offres (replie en bas de page) --- */

.avancee-details > summary {
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  list-style: none;
  cursor: pointer;
  border-radius: var(--rayon-s);
}

.avancee-details > summary::-webkit-details-marker {
  display: none;
}

.avancee-details > summary h2 {
  margin: 0;
  font-size: var(--taille-xl);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.015em;
}

.avancee-details[open] > summary {
  margin-bottom: var(--espace-5);
}

.avancee-details[open] > summary .bloc-chevron {
  transform: rotate(180deg);
}

.details-groupe + .details-groupe {
  margin-top: var(--espace-5);
}

/* Barre de repartition : une seule barre horizontale segmentee, plus lisible
   qu'un camembert pour cinq valeurs, et lisible sans couleur grace aux
   libelles de la legende. */
.barre-repartition {
  display: flex;
  height: 12px;
  border-radius: var(--rayon-plein);
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 10px;
}

.barre-segment {
  height: 100%;
}

.legende {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: var(--taille-m);
  color: var(--text-muted);
}

.legende-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legende-puce {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

@media (max-width: 640px) {
  .entonnoir-etape {
    grid-template-columns: 6.5rem minmax(0, 1fr) 2.5rem;
    gap: var(--espace-2);
  }

  /* Le texte prend toute la ligne, le bouton passe dessous : sinon le titre
     d'une offre tenait sur 100 px et cinq lignes. */
  .liste-action li {
    flex-wrap: wrap;
  }

  .action-texte {
    flex-basis: calc(100% - 40px - var(--espace-3));
  }

  .liste-action .btn {
    margin-left: calc(40px + var(--espace-3));
  }

  /* Deux tuiles par ligne : quatre tuiles pleine largeur faisaient 450 px
     a faire defiler avant la premiere action. */
  .avancee-tuiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--espace-3);
  }

  .tuile-chiffre {
    padding: var(--espace-4);
  }

  .tuile-chiffre-haut {
    margin-bottom: var(--espace-2);
  }

  .tuile-chiffre-valeur {
    font-size: var(--taille-2xl);
  }
}

/* ================= Suivi des candidatures : vue en colonnes =============
   Une colonne par statut (server/services/statutsCandidature.js). La couleur
   de chaque colonne reprend un token deja defini dans les deux themes : rien
   de nouveau a maintenir en mode sombre. */

.vue-bascule {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--rayon-plein);
  background: var(--bg);
  border: 1px solid var(--border);
}

.vue-bouton {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--taille-s);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--rayon-plein);
  cursor: pointer;
  transition: background-color var(--duree), color var(--duree), box-shadow var(--duree);
}

.vue-bouton[aria-pressed='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--ombre-3);
}

.tableau-colonnes {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.colonne {
  --teinte: var(--text-muted);
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 12px;
  border-radius: var(--rayon-l);
  background: color-mix(in srgb, var(--teinte) 6%, var(--bg));
  scroll-snap-align: start;
  transition: background-color var(--duree), box-shadow var(--duree);
}

.colonne[data-statut='envoyee'] { --teinte: var(--accent); }
.colonne[data-statut='entretien_programme'] { --teinte: var(--niveau-excellente); }
.colonne[data-statut='relance_a_faire'] { --teinte: var(--niveau-moyenne); }
.colonne[data-statut='sans_suite'] { --teinte: var(--niveau-faible); }

.colonne.est-survolee {
  background: color-mix(in srgb, var(--teinte) 16%, var(--bg));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--teinte) 55%, transparent);
}

.colonne-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 10px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--teinte);
}

.colonne-tete h3 {
  margin: 0;
  font-size: var(--taille-m);
  font-weight: 700;
}

.colonne-compte {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: var(--rayon-plein);
  background: var(--teinte);
  color: var(--surface);
  font-size: var(--taille-xs);
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.colonne-pile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.colonne-vide {
  margin: 0;
  padding: 16px 12px;
  border: 1px dashed color-mix(in srgb, var(--teinte) 35%, var(--border));
  border-radius: var(--rayon-l);
  color: var(--text-muted);
  font-size: var(--taille-s);
  line-height: 1.45;
  text-align: center;
}

.carte {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  background: var(--surface);
  box-shadow: var(--ombre-1);
  cursor: grab;
  animation: carte-entree 0.45s var(--courbe-sortie) both;
  animation-delay: calc(var(--rang, 0) * 40ms);
  transition: box-shadow var(--duree), transform var(--duree), opacity var(--duree);
}

.carte:hover {
  box-shadow: var(--ombre-3);
}

.carte.est-saisie {
  opacity: 0.45;
  cursor: grabbing;
}

/* La carte qui vient de changer de colonne se signale une fois. */
.carte.vient-d-arriver {
  animation: carte-arrivee 0.6s var(--courbe-sortie);
}

@keyframes carte-entree {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes carte-arrivee {
  0% { transform: scale(0.96); box-shadow: 0 0 0 3px var(--accent-glow); }
  100% { transform: none; }
}

.carte-tete {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.carte-initiales {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--rayon-m);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--taille-xs);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.carte-titre {
  margin: 0;
  font-size: var(--taille-m);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.carte-lieu {
  margin: 2px 0 0;
  font-size: var(--taille-s);
}

.carte-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--taille-xs);
}

.carte-relance {
  color: var(--danger);
}

.carte-details {
  font-size: var(--taille-s);
}

.carte-details > summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
}

.carte-details[open] {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.carte-details .notes-input,
.carte-details .relance-champ {
  min-width: 0;
  width: 100%;
}

.carte-champ {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
}

.carte-details .btn-danger {
  align-self: flex-start;
}

.carte-pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.carte-fleches {
  display: inline-flex;
  gap: 4px;
}

.carte-fleche {
  min-width: 34px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .carte,
  .carte.vient-d-arriver {
    animation: none;
  }
}

/* ===================== Apercu d'une candidature =========================
   Panneau lateral de la page Candidatures (public/js/apercuCandidature.js).
   Il entre par la droite (transform seulement) et, sur un ecran large,
   pousse la page : le tableau occupe la moitie gauche et reste cliquable.
   Sur telephone, il couvre l'ecran. Couleurs : tokens des deux themes. */

.apercu-candidature {
  position: fixed;
  top: var(--hauteur-barre);
  right: 0;
  bottom: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  width: var(--largeur-apercu);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--ombre-3);
  transform: translateX(100%);
  transition: transform var(--duree-longue) var(--courbe-sortie);
}

.apercu-candidature[hidden] {
  display: none;
}

.apercu-candidature.est-entre {
  transform: none;
}

@media (min-width: 901px) {
  /* La page laisse la place au panneau au lieu d'etre recouverte. */
  body.apercu-ouvert .container {
    max-width: none;
    margin-left: 0;
    margin-right: var(--largeur-apercu);
  }
}

@media (max-width: 900px) {
  .apercu-candidature {
    top: 0;
    z-index: 30;
    width: 100%;
    border-left: 0;
  }
}

.apercu-tete {
  display: grid;
  gap: var(--espace-2);
  padding: var(--espace-4) var(--espace-6);
  border-bottom: 1px solid var(--border);
}

.apercu-barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-3);
}

.apercu-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--espace-2);
}

.apercu-rang {
  min-width: 5.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.apercu-titre {
  margin: var(--espace-1) 0 0;
  font-size: var(--taille-2xl);
  font-weight: var(--graisse-titre);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

/* Le titre recoit le focus a l'ouverture (lecteurs d'ecran) : un cadre de
   focus autour d'un titre ne dirait rien de plus. */
.apercu-titre:focus {
  outline: none;
}

.apercu-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-2);
  margin: 0;
}

.apercu-statut {
  --teinte: var(--text-muted);
  color: var(--teinte);
}

/* Meme teinte que la colonne du statut. */
.apercu-statut[data-statut='envoyee'] { --teinte: var(--accent); }
.apercu-statut[data-statut='entretien_programme'] { --teinte: var(--niveau-excellente); }
.apercu-statut[data-statut='relance_a_faire'] { --teinte: var(--niveau-moyenne); }
.apercu-statut[data-statut='sans_suite'] { --teinte: var(--niveau-faible); }

.apercu-rubriques {
  justify-self: start;
  margin-top: var(--espace-2);
}

.apercu-corps {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--espace-5) var(--espace-6) var(--espace-8);
  background: var(--bg);
  scrollbar-color: var(--bordure-champ) transparent;
}

.apercu-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-2) var(--espace-3);
  margin-bottom: var(--espace-4);
}

.apercu-actions .count {
  margin: 0;
}

.apercu-liens {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--espace-2);
}

/* La feuille : le document tel qu'il sera lu, pose sur le fond du panneau. */
.apercu-feuille {
  max-width: 72ch;
  padding: var(--espace-6);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  background: var(--surface);
  box-shadow: var(--ombre-1);
  font-size: var(--taille-m);
  line-height: 1.55;
}

.apercu-feuille p {
  margin: 0;
}

.apercu-feuille-tete {
  display: grid;
  gap: var(--espace-1);
  padding-bottom: var(--espace-3);
  border-bottom: 1px solid var(--border);
}

.apercu-cv-nom {
  font-size: var(--taille-xl);
  font-weight: var(--graisse-noire);
  letter-spacing: -0.01em;
}

.apercu-cv-titre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-2);
  color: var(--accent-encre);
  font-weight: var(--graisse-forte);
}

.apercu-portfolio {
  overflow-wrap: anywhere;
}

.apercu-rubrique-titre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-2);
  margin: var(--espace-5) 0 var(--espace-2);
  font-size: var(--taille-base);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.01em;
}

/* Ce que le modele a reformule ou choisi pour l'offre (titre, presentation,
   competences) ; tout le reste est recopie du profil. */
.apercu-adapte {
  color: var(--accent);
  font-weight: var(--graisse-forte);
  letter-spacing: 0;
}

.apercu-competences,
.apercu-fiche {
  display: grid;
  grid-template-columns: minmax(0, max-content) 1fr;
  gap: var(--espace-1) var(--espace-4);
  margin: 0;
}

.apercu-fiche dt {
  color: var(--text-muted);
}

.apercu-competences dt {
  font-weight: var(--graisse-forte);
}

.apercu-competences dd,
.apercu-fiche dd {
  margin: 0;
}

.apercu-fiche {
  max-width: 72ch;
  padding: var(--espace-4) var(--espace-5);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  background: var(--surface);
  font-size: var(--taille-m);
}

.apercu-entree + .apercu-entree {
  margin-top: var(--espace-3);
}

.apercu-entree-titre {
  font-weight: var(--graisse-forte);
}

.apercu-puces {
  margin: var(--espace-1) 0 0;
  padding-left: var(--espace-5);
}

.apercu-puces li + li {
  margin-top: var(--espace-1);
}

.apercu-lettre-texte {
  font-size: var(--taille-base);
  line-height: 1.65;
}

.apercu-lettre-texte p + p {
  margin-top: var(--espace-3);
}

.apercu-notes {
  max-width: 72ch;
  margin: 0;
  white-space: pre-wrap;
}

.apercu-annonce {
  max-width: 72ch;
  font-size: var(--taille-m);
  line-height: 1.6;
}

.apercu-annonce-debut,
.apercu-annonce-texte {
  margin: 0;
  white-space: pre-line;
}

/* Les premieres lignes seulement ; le texte entier se deplie a la demande. */
.apercu-annonce-debut {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.apercu-annonce:has(.apercu-annonce-repli[open]) .apercu-annonce-debut {
  display: none;
}

.apercu-annonce-repli > summary {
  margin: var(--espace-2) 0;
  color: var(--accent);
  font-weight: var(--graisse-forte);
  cursor: pointer;
}

.apercu-annonce .btn {
  margin-top: var(--espace-3);
}

.apercu-vide {
  display: grid;
  justify-items: center;
  gap: var(--espace-3);
  padding: var(--espace-7) var(--espace-5);
  border: 1px dashed var(--border);
  border-radius: var(--rayon-l);
  color: var(--text-muted);
  text-align: center;
}

.apercu-vide p {
  margin: 0;
}

/* La carte dont l'apercu est ouvert. */
.carte.est-ouverte {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--ombre-2);
}

.carte-ouvrir {
  overflow-wrap: anywhere;
}

.lien-apercu {
  font-weight: var(--graisse-forte);
}

.lien-apercu[aria-expanded='true'] {
  color: var(--accent);
}

/* ============================== Chargement ==============================
   Animations d'attente (public/js/chargement.js). Trois niveaux :
   - .attente     panneau d'une generation (lettre, CV, entretien) ;
   - .est-occupe  petit cercle dans un bouton qui attend ;
   - .squelette   lignes grises d'une page qui charge ses donnees.
   Couleurs : uniquement des tokens deja definis dans les deux themes. Tout
   s'arrete avec prefers-reduced-motion (fin de section). */

.attente {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 16px 18px;
  text-align: center;
}

.attente-illustration {
  width: 132px;
  height: 110px;
  overflow: visible;
}

.attente-etape {
  min-height: 1.5em;
  margin: 4px 0 0;
  font-weight: 700;
  font-size: var(--taille-base);
}

.attente-etape-nouvelle {
  animation: attente-phrase 0.45s var(--courbe-sortie);
}

@keyframes attente-phrase {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.attente-duree {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--taille-s);
}

/* Barre indeterminee : un trait qui glisse, sans pretendre a un pourcentage. */
.attente-barre {
  position: relative;
  width: min(240px, 80%);
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}

.attente-barre span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: var(--accent);
  animation: attente-barre 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes attente-barre {
  from { transform: translateX(-110%); }
  to { transform: translateX(280%); }
}

/* --- Elements communs des illustrations */

.att-feuille {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1.5;
}

.att-texte,
.att-ligne {
  stroke: var(--text-muted);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.55;
}

/* --- Lettre : cinq lignes ecrites l'une apres l'autre, la plume les suit.
   Une animation par ligne, sur le meme cycle de 5 s, pour qu'elles restent
   synchronisees avec la plume d'un tour a l'autre. */

.att-ligne {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: 5s linear infinite both;
}

.att-ligne-1 { animation-name: att-l1; }
.att-ligne-2 { animation-name: att-l2; }
.att-ligne-3 { animation-name: att-l3; }
.att-ligne-4 { animation-name: att-l4; }
.att-ligne-5 { animation-name: att-l5; }

@keyframes att-l1 { 0% { stroke-dashoffset: 60; } 16%, 88% { stroke-dashoffset: 0; opacity: 0.55; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes att-l2 { 0%, 17% { stroke-dashoffset: 60; } 32%, 88% { stroke-dashoffset: 0; opacity: 0.55; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes att-l3 { 0%, 33% { stroke-dashoffset: 60; } 48%, 88% { stroke-dashoffset: 0; opacity: 0.55; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes att-l4 { 0%, 49% { stroke-dashoffset: 60; } 64%, 88% { stroke-dashoffset: 0; opacity: 0.55; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes att-l5 { 0%, 65% { stroke-dashoffset: 60; } 76%, 88% { stroke-dashoffset: 0; opacity: 0.55; } 100% { stroke-dashoffset: 0; opacity: 0; } }

.att-plume {
  animation: att-plume 5s linear infinite;
}

.att-plume-corps {
  fill: var(--accent);
}

.att-plume-pointe {
  fill: var(--text);
}

@keyframes att-plume {
  0% { transform: translate(32px, 24px); }
  16% { transform: translate(84px, 24px); }
  17% { transform: translate(32px, 37px); }
  32% { transform: translate(84px, 37px); }
  33% { transform: translate(32px, 50px); }
  48% { transform: translate(76px, 50px); }
  49% { transform: translate(32px, 63px); }
  64% { transform: translate(84px, 63px); }
  65% { transform: translate(32px, 76px); }
  76%, 100% { transform: translate(62px, 76px); }
}

/* --- CV : le titre prend l'intitule du poste, la presentation se
   reformule, deux competences echangent leur place. */

.att-titre {
  fill: var(--border);
  animation: att-titre 3.6s ease-in-out infinite;
}

@keyframes att-titre {
  0%, 15% { fill: var(--border); }
  30%, 85% { fill: var(--accent); }
  100% { fill: var(--border); }
}

.att-presentation {
  animation: att-presentation 3.6s ease-in-out infinite;
}

@keyframes att-presentation {
  0%, 35% { stroke: var(--text-muted); opacity: 0.55; }
  50%, 80% { stroke: var(--accent); opacity: 0.9; }
  100% { stroke: var(--text-muted); opacity: 0.55; }
}

.att-puce {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.2;
}

.att-puce-1 { animation: att-puce-1 3.6s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.att-puce-3 { animation: att-puce-3 3.6s cubic-bezier(0.65, 0, 0.35, 1) infinite; fill: var(--accent); }

@keyframes att-puce-1 {
  0%, 55% { transform: none; }
  70%, 100% { transform: translateX(38px); }
}

@keyframes att-puce-3 {
  0%, 55% { transform: none; }
  70%, 100% { transform: translateX(-38px); }
}

/* --- Entretien : trois questions arrivent, chacune recoit sa reponse. */

.att-bulle {
  animation: 4.5s var(--courbe-sortie) infinite both;
}

.att-bulle-1 { animation-name: att-bulle-1; }
.att-bulle-2 { animation-name: att-bulle-2; }
.att-bulle-3 { animation-name: att-bulle-3; }

@keyframes att-bulle-1 { 0% { opacity: 0; transform: translateY(8px); } 10%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes att-bulle-2 { 0%, 25% { opacity: 0; transform: translateY(8px); } 35%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes att-bulle-3 { 0%, 50% { opacity: 0; transform: translateY(8px); } 60%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.att-bulle-fond {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1.5;
}

.att-coche-fond {
  fill: var(--niveau-excellente);
}

.att-coche {
  fill: none;
  stroke: var(--surface);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Bouton qui attend : un cercle devant le texte. */

.est-occupe {
  cursor: progress;
}

.est-occupe::before {
  content: '';
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.12em;
  animation: attente-tour 0.7s linear infinite;
}

/* Un bouton desactive est a demi transparent (.btn:disabled) : celui qui
   travaille reste lisible, c'est lui qu'on regarde. */
.btn.est-occupe:disabled {
  opacity: 0.85;
}

@keyframes attente-tour {
  to { transform: rotate(360deg); }
}

/* --- Page qui charge : des lignes grises qui scintillent. */

.squelette {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.squelette-ligne {
  display: block;
  height: 12px;
  border-radius: var(--rayon-s);
  background: linear-gradient(90deg, var(--border) 0%, var(--bg) 50%, var(--border) 100%);
  background-size: 200% 100%;
  animation: attente-scintille 1.4s ease-in-out infinite;
}

.squelette-ligne:nth-child(2) { width: 82%; }
.squelette-ligne:nth-child(3) { width: 64%; }

.squelette-carte {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  background: var(--surface);
}

.squelette-carte .squelette-ligne:first-child {
  height: 16px;
  width: 55%;
}

@keyframes attente-scintille {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.squelette-court {
  width: 220px;
  max-width: 100%;
}

.accueil-apercu-liste .squelette-ligne {
  flex: 1;
}

/* Fenetre d'attente de l'adaptation du CV (index.html). */
.dialog-attente {
  width: min(420px, 92vw);
}

.dialog-attente .dialog-inner {
  text-align: center;
}

/* Rien a cliquer dans cette fenetre : le navigateur y pose le focus et
   l'entourait d'un cadre blanc sans utilite. */
.dialog-attente:focus,
.dialog-attente:focus-visible {
  outline: none;
}

.dialog-attente h2 {
  margin: 0;
}

/* --- Mouvement reduit : tout est fixe, dans son etat final lisible. */

@media (prefers-reduced-motion: reduce) {
  .attente *,
  .attente-barre span,
  .squelette-ligne,
  .est-occupe::before {
    animation: none !important;
  }

  .att-ligne {
    stroke-dashoffset: 0;
  }

  .att-plume {
    transform: translate(62px, 76px);
  }

  .attente-barre span {
    width: 100%;
    opacity: 0.35;
  }

  .est-occupe::before {
    border-style: dotted;
    border-right-color: currentColor;
  }
}

/* ========================= Choix des metiers ===========================
   Page Profil, section Recherche (public/js/choixMetiers.js). */

.choix-metiers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.metiers-choisis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.metiers-choisis:empty {
  display: none;
}

.pastille-metier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 12px;
  border-radius: var(--rayon-plein);
  background: var(--accent-soft);
  color: var(--text);
  font-size: var(--taille-m);
  font-weight: 600;
  animation: pastille-arrivee 0.3s var(--courbe-sortie);
}

.pastille-libre {
  background: color-mix(in srgb, var(--niveau-moyenne) 14%, transparent);
}

.pastille-note {
  color: var(--niveau-moyenne);
  font-size: var(--taille-xs);
  font-weight: 700;
}

.pastille-retirer {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--taille-xs);
  cursor: pointer;
}

.pastille-retirer:hover,
.pastille-retirer:focus-visible {
  background: var(--surface);
  color: var(--danger);
}

@keyframes pastille-arrivee {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: none; }
}

.combo {
  position: relative;
  max-width: 520px;
}

.combo input {
  width: 100%;
}

.combo-liste {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--rayon-m);
  background: var(--surface);
  box-shadow: var(--ombre-3);
}

.combo-option {
  padding: 9px 12px;
  border-radius: var(--rayon-m);
  cursor: pointer;
  font-size: var(--taille-m);
}

.combo-option:hover,
.combo-option[aria-selected='true'] {
  background: var(--accent-soft);
  color: var(--text);
}

.combo-vide {
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: var(--taille-s);
}

.lien-formule {
  color: var(--accent);
  font-size: var(--taille-s);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .pastille-metier {
    animation: none;
  }
}

/* ====================== Offres reservees (gratuit) ======================
   Formule gratuite : un echantillon d'offres ouvertes, les autres en carte
   reservee (services/echantillon.js). Le flou est un decor : aucune donnee
   de l'offre n'est dessous, le serveur ne l'envoie pas. */

.bandeau-essentielle {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
  padding: 16px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--rayon-l);
  background: var(--accent-soft);
}

.bandeau-icone,
.reservee-cadenas {
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.bandeau-icone {
  width: 44px;
  height: 44px;
}

.bandeau-icone svg,
.reservee-cadenas svg {
  width: 55%;
  height: 55%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.bandeau-texte {
  flex: 1;
  min-width: 0;
}

.bandeau-titre {
  margin: 0;
  font-size: var(--taille-base);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bandeau-detail {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: var(--taille-m);
  line-height: 1.45;
}

a.bandeau-action {
  flex: none;
  text-decoration: none;
}

/* --- La carte reservee */

.offre-reservee {
  /* Le flou et le voile occupent la meme case de grille : la carte prend la
     hauteur de son contenu, et le bouton n'est jamais coupe. */
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.offre-reservee:hover {
  transform: none;
}

.reservee-haut {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reservee-flou {
  grid-row: 2;
  grid-column: 1;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  filter: blur(3px);
  opacity: 0.8;
}

.reservee-ligne {
  display: block;
  height: 10px;
  width: 78%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--border), var(--bg), var(--border));
  background-size: 200% 100%;
  animation: attente-scintille 2.6s ease-in-out infinite;
}

.reservee-ligne-titre {
  height: 16px;
  width: 58%;
}

.reservee-ligne-courte {
  width: 42%;
}

.reservee-voile {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px 4px;
  text-align: center;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--surface) 35%, transparent),
    var(--surface) 55%
  );
}

.reservee-cadenas {
  width: 38px;
  height: 38px;
  margin-bottom: 4px;
}

.reservee-titre {
  margin: 0;
  font-weight: 700;
  font-size: var(--taille-base);
}

.reservee-texte {
  margin: 0 0 8px;
  max-width: 44ch;
  color: var(--text-muted);
  font-size: var(--taille-s);
  line-height: 1.45;
}

.reservee-voile a.btn {
  text-decoration: none;
}

/* Une offre Excellente reservee se signale : c'est elle qui donne envie. */
.offre-reservee[data-niveau='excellente'] {
  border-color: color-mix(in srgb, var(--niveau-excellente) 45%, var(--border));
  box-shadow: 0 10px 28px -18px color-mix(in srgb, var(--niveau-excellente) 70%, transparent);
}

.offre-reservee[data-niveau='excellente'] .reservee-cadenas {
  background: color-mix(in srgb, var(--niveau-excellente) 15%, transparent);
  color: var(--niveau-excellente);
}

@media (max-width: 640px) {
  .bandeau-essentielle {
    flex-wrap: wrap;
  }

  a.bandeau-action {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reservee-ligne {
    animation: none;
  }
}

/* ===================== Documents dans le tableau ======================== */

.docs-liens {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.doclien {
  font-size: var(--taille-xs);
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--rayon-s);
  padding: 2px 6px;
  white-space: nowrap;
}

.doclien:hover {
  border-color: var(--accent);
}

.relance-champ {
  min-width: 140px;
  font-size: var(--taille-s);
  padding: 4px 6px;
}

/* ========================== Niveau du score ============================= */

/* Excellente, Bonne, Moyenne, Faible : meme pastille teintee que les autres
   badges, la couleur vient du niveau (voir les --niveau-* en tete). */
.badge-niveau {
  color: var(--niveau-faible);
}

.badge-niveau[data-niveau="excellente"] { color: var(--niveau-excellente); }
.badge-niveau[data-niveau="bonne"] { color: var(--niveau-bonne); }
.badge-niveau[data-niveau="moyenne"] { color: var(--niveau-moyenne); }

/* ====================== Score du CV avant / apres ======================= */

.cv-score {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  background: var(--bg);
}

.cv-score > .cv-sous-titre:first-child {
  margin-top: 0;
}

.cv-score-comparaison {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin: 8px 0 10px;
}

.cv-score-colonne {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.cv-score-valeur {
  font-size: var(--taille-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.cv-score-fleche {
  font-size: var(--taille-xl);
  color: var(--text-muted);
}

/* ===================== Recherche automatique du jour ==================== */

/* Case a cocher du profil, avec son explication juste dessous. */
.case-avec-aide {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--taille-m);
  cursor: pointer;
}

.case-avec-aide input {
  width: auto;
  margin: 3px 0 0;
}

/* Pas d'attribut style="" dans le HTML : la CSP 'self' le bloquerait. */
.aide-case {
  display: block;
  margin-top: 2px;
}

/* ======================== Preparation d'entretien ======================= */

/* Bouton du tableau de suivi : vert quand la fiche est prete (a relire),
   bleu quand elle reste a preparer. Teintes tirees de tokens deja definis
   dans les deux themes. En bouton principal (entretien programme), le
   degrade de .btn-primary reprend la main. */
.btn.entretien-pret {
  background: color-mix(in srgb, var(--niveau-excellente) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--niveau-excellente) 45%, transparent);
  color: var(--niveau-excellente);
  font-weight: 600;
}

.btn.entretien-pret:hover:not(:disabled) {
  background: color-mix(in srgb, var(--niveau-excellente) 20%, var(--surface));
  border-color: var(--niveau-excellente);
}

.btn.entretien-a-preparer:not(.btn-primary) {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
  font-weight: 600;
}

.btn.entretien-a-preparer:not(.btn-primary):hover:not(:disabled) {
  border-color: var(--accent);
}

.entretien-chargement {
  margin: 16px 0;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--rayon-l);
  color: var(--text-muted);
  text-align: center;
}

.entretien-section {
  margin-top: 20px;
}

.entretien-liste {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Une question par carte : on la lit, on prepare sa reponse, on passe a la
   suivante. */
.entretien-carte {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--rayon-m);
  background: var(--surface);
}

.entretien-carte.point-faible {
  border-color: color-mix(in srgb, var(--attention) 40%, var(--border));
  background: var(--attention-soft);
}

.entretien-question {
  margin: 0 0 6px;
  font-weight: 600;
}

.entretien-ligne {
  margin: 4px 0 0;
  font-size: var(--taille-s);
}

.entretien-libelle {
  font-weight: 600;
  color: var(--text-muted);
}

.entretien-date {
  margin: 4px 0 0;
}

/* ============================ Pages de compte ===========================
   Connexion, inscription, mot de passe oublie, confirmation, Mon compte.
   Uniquement des variables existantes : les deux themes suivent seuls. */

.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-carte {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-xl);
  box-shadow: var(--ombre-3);
  padding: 28px 24px;
}

.auth-carte .logo {
  margin: 0 0 6px;
}

.auth-intro {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: var(--taille-m);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* L'attribut hidden doit toujours masquer : sans cette regle, une classe qui
   fixe display (flex...) l'emporte, et un formulaire deja envoye ou un lien
   de secours restaient affiches. */
[hidden] {
  display: none !important;
}

.auth-form .btn-primary {
  margin-top: 4px;
  justify-content: center;
}

.auth-succes {
  margin: 12px 0 0;
  color: var(--niveau-excellente);
  font-size: var(--taille-m);
}

.auth-liens {
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--taille-s);
}

.auth-liens a {
  color: var(--accent);
}

.compte-ligne {
  margin: 0 0 8px;
}

.compte-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.compte-quotas {
  margin: 12px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--taille-m);
}

/* --- Abonnement (page Mon compte) ---
   Deux formules presentees cote a cote, puis la case obligatoire d'acces
   immediat (.consentement, plus bas). Le fieldset perd sa bordure par defaut,
   qui ferait une boite dans la boite. */
.abonnement-choix {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.abonnement-choix legend {
  padding: 0;
  margin-bottom: 8px;
}

.abonnement-offre {
  flex: 1 1 220px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  background: var(--surface);
  cursor: pointer;
  font-size: var(--taille-m);
}

/* Comme .consentement : la regle generale donne width: 100% a tout <input>,
   ce qui ferait deborder le bouton radio et son texte. */
.abonnement-offre input {
  width: auto;
  flex: none;
  margin: 2px 0 0;
}

.abonnement-offre .count {
  display: block;
  margin-top: 2px;
}

.abonnement-offre:has(input:checked) {
  border-color: var(--accent);
}

/* ============================= Pages legales ============================
   Mentions legales, confidentialite, conditions d'utilisation : des pages
   publiques, sans barre de navigation, faites pour etre lues. Largeur de
   ligne volontairement etroite (une ligne trop longue se relit mal) et un
   pied qui renvoie vers les deux autres depuis chacune.

   POURQUOI LES <mark> SONT ROUGES
   Ces pages sont des modeles a completer. Une zone restee « [À COMPLÉTER] »
   doit sauter aux yeux a la relecture, pas se fondre dans le texte. Le
   serveur refuse de demarrer en production tant qu'il en reste une
   (server/index.js). */

.legal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 24px;
  flex: 1;
}

.legal-retour {
  margin: 0 0 24px;
}

.legal h1 {
  margin: 0 0 8px;
  font-size: var(--taille-2xl);
}

.legal h2 {
  margin: 32px 0 8px;
  font-size: var(--taille-l);
}

.legal p,
.legal li {
  line-height: 1.65;
}

.legal ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal a {
  color: var(--accent);
}

.legal mark {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 1px 5px;
  border-radius: var(--rayon-m);
}

.pied-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  padding: 20px 16px 32px;
  border-top: 1px solid var(--border);
  font-size: var(--taille-s);
}

.pied-legal a {
  color: var(--text-muted);
}

.pied-legal a[aria-current='page'] {
  color: var(--text);
}

/* Le meme pied, glisse sous la page d'accueil : il est deja dans un pied de
   page, il n'en reprend donc ni la bordure ni les marges. */
.accueil-pied .pied-legal {
  border-top: 0;
  padding: 4px 0 0;
}

/* Sous une carte de connexion, la carte est centree verticalement : le pied
   se pose en dessous sans pousser la carte vers le haut. */
.auth-body .pied-legal {
  border-top: 0;
  margin-top: 24px;
  padding-bottom: 0;
}

/* La case « J'accepte les conditions » de l'inscription. Meme forme que
   .case-avec-aide : la case et son texte alignes en haut, pour que le texte
   puisse passer a la ligne sans decaler la case.

   width: auto est indispensable. La regle generale plus haut donne
   width: 100% a tout <input> (les champs de saisie en ont besoin) ; sans ce
   rappel, la case a cocher prend toute la largeur de la carte et pousse son
   texte hors de l'ecran. Les autres cases du projet font pareil. */
.consentement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--taille-s);
  color: var(--text-muted);
  line-height: 1.5;
  cursor: pointer;
}

.consentement input {
  width: auto;
  flex: none;
  margin: 2px 0 0;
}

.consentement a {
  color: var(--accent);
}

/* ============= Téléchargement du CV : choix de la mise en page ========== */

/* Fenetre plus large que les autres : les choix a gauche, l'exemple de CV
   fictif a droite, qui reste visible pendant qu'on fait defiler les choix. */
#telechargement-cv-dialog {
  width: min(1040px, 94vw);
}

.telechargement-cv-corps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
  margin: 0 0 12px;
}

.apercu-cv-reel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.apercu-cv-reel img,
.apercu-cv-etat {
  width: 100%;
  aspect-ratio: 210 / 297;
  border: 1px solid var(--border);
  border-radius: var(--rayon-s);
  background: var(--cv-couleur-papier);
  box-shadow: var(--ombre-1);
}

.apercu-cv-reel img {
  display: block;
  transition: opacity var(--duree) var(--courbe-sortie);
}

/* Pendant que la nouvelle image se prepare, l'ancienne reste visible mais
   attenuee : on voit que le choix a ete pris en compte. */
.apercu-cv-reel.en-cours img {
  opacity: 0.45;
}

.apercu-cv-etat {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: var(--espace-4);
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-2);
}

.apercu-cv-etat[hidden] {
  display: none;
}

.apercu-cv-reel figcaption {
  font-size: var(--taille-s);
  color: var(--text-muted);
}

@media (max-width: 1000px) {
  .telechargement-cv-corps {
    grid-template-columns: minmax(0, 1fr) 230px;
  }
}

@media (max-width: 760px) {
  .telechargement-cv-corps {
    grid-template-columns: 1fr;
  }

  /* Sur un telephone, l'apercu passe en tete, en plus petit. */
  .apercu-cv-reel {
    position: static;
    order: -1;
    width: min(240px, 100%);
    margin: 0 auto;
  }
}

/* Deux familles (ATS, envoi direct), puis la couleur et la photo. Chaque
   carte montre l'apercu fictif dans la couleur cochee (telechargementCV.js). */
.choix-cv {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 12px;
}


.mises-en-page,
.couleurs-cv {
  margin: 0;
  padding: 0;
  border: 0;
}

.mises-en-page legend,
.couleurs-cv legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: var(--taille-s);
  font-weight: 600;
  color: var(--text);
}

.mises-en-page-grille {
  display: grid;
  /* 130 px : deux cartes cote a cote meme sur un telephone, sinon neuf
     cartes empilees font une tres longue fenetre. */
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

/* Pastilles de couleur : de vrais boutons radio, le rond n'est qu'un habit. */
.couleurs-cv-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.couleur-cv {
  position: relative;
  display: block;
  cursor: pointer;
}

.couleur-cv input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.couleur-cv-rond {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--bordure-champ);
}

.couleur-cv:has(input:checked) .couleur-cv-rond {
  box-shadow: 0 0 0 2px var(--accent);
}

.couleur-cv:has(input:focus-visible) .couleur-cv-rond {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.couleur-cv[data-couleur='noir'] .couleur-cv-rond { background: var(--cv-couleur-noir); }
.couleur-cv[data-couleur='ardoise'] .couleur-cv-rond { background: var(--cv-couleur-ardoise); }
.couleur-cv[data-couleur='marine'] .couleur-cv-rond { background: var(--cv-couleur-marine); }
.couleur-cv[data-couleur='petrole'] .couleur-cv-rond { background: var(--cv-couleur-petrole); }
.couleur-cv[data-couleur='sapin'] .couleur-cv-rond { background: var(--cv-couleur-sapin); }
.couleur-cv[data-couleur='bordeaux'] .couleur-cv-rond { background: var(--cv-couleur-bordeaux); }
.couleur-cv[data-couleur='prune'] .couleur-cv-rond { background: var(--cv-couleur-prune); }
.couleur-cv[data-couleur='brique'] .couleur-cv-rond { background: var(--cv-couleur-brique); }

.case-photo-cv {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-weight: 600;
  cursor: pointer;
}

.case-photo-cv input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.mise-en-page-conseil {
  align-self: flex-start;
  margin-top: 2px;
}

/* Toute la carte est cliquable : c'est le <label> du bouton radio. Le radio
   reste visible (en haut a gauche) : c'est lui qui porte le focus clavier. */
.mise-en-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 12px 38px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rayon-l);
  cursor: pointer;
}

.mise-en-page input {
  position: absolute;
  top: 14px;
  left: 14px;
  /* Les champs du site sont en pleine largeur : le radio, lui, garde sa
     taille naturelle. */
  width: auto;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.mise-en-page:hover {
  border-color: var(--accent);
}

.mise-en-page:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--accent-soft);
}

.mise-en-page:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Apercu de chaque carte : le CV fictif de l'exemple (GET
   /api/applications/apercu-modele), dans la couleur et avec ou sans photo
   choisies. Le cadre garde la proportion A4 pendant le chargement, sur un
   fond de papier blanc dans les deux themes. */
.apercu-carte {
  display: block;
  width: 100%;
  max-width: 120px;
  aspect-ratio: 210 / 297;
  margin-bottom: 6px;
  overflow: hidden;
  background: var(--cv-couleur-papier);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.apercu-carte img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--duree) var(--courbe-sortie);
}

/* L'image d'une autre couleur se prepare : l'ancienne reste, attenuee. */
.apercu-carte.en-cours img {
  opacity: 0.45;
}

.telechargement-cv-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}

.telechargement-cv-action .count {
  color: var(--accent);
}

/* Le CV du suivi est un bouton (il ouvre le choix), habille comme les liens
   de documents voisins. */
button.doclien {
  font-family: inherit;
  background: none;
  cursor: pointer;
}

/* ===================== Photo du profil (CV design) ===================== */

.photo-profil {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.photo-apercu {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
}

.photo-vide {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--taille-xs);
  color: var(--text-muted);
  background: var(--accent-soft);
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Le champ fichier est masque visuellement : le focus clavier se voit donc
   sur le bouton qui l'habille. */
.photo-choisir:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===================== Credits dans la barre du haut =====================

   Pastille posee par barreCompte.js a cote de « Compte ». */
.pastille-credits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--rayon-plein);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--taille-s);
  font-weight: var(--graisse-forte);
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pastille-credits:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.pastille-credits[data-vide='oui'] {
  background: var(--attention-soft);
  color: var(--attention);
}

body[data-credits='gratuit'] .pastille-credits {
  background: var(--bg);
  color: var(--text-muted);
}

/* Le cout a cote des boutons qui generent (voir barreCompte.js : en CSS pour
   survivre aux changements de texte du bouton pendant une generation). */
body[data-credits='payant'] .offer-actions [data-action='cv']::after,
body[data-credits='payant'] .offer-actions [data-action='letter']::after,
body[data-credits='payant'] #detail-cv::after,
body[data-credits='payant'] #detail-lettre::after {
  content: '· 1 crédit';
  font-size: var(--taille-xs);
  font-weight: var(--graisse-moyenne);
  opacity: 0.8;
}

body[data-credits='gratuit'] .offer-actions [data-action='cv']::after,
body[data-credits='gratuit'] #detail-cv::after {
  content: 'Essentielle';
  padding: 1px 6px;
  border-radius: var(--rayon-plein);
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--taille-xs);
  font-weight: var(--graisse-forte);
}


/* ============================== Aides repliees ============================

   Une question en lien discret, la reponse en dessous : on apprend le jargon
   (score, credit, ATS) au moment ou on le croise, sans tutoriel a suivre. */
.aide {
  margin: 0 0 var(--espace-4);
  font-size: var(--taille-m);
}

.aide > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: var(--graisse-moyenne);
  cursor: pointer;
  list-style: none;
  border-radius: var(--rayon-s);
}

.aide > summary::-webkit-details-marker {
  display: none;
}

.aide > summary:hover {
  text-decoration: underline;
}

.aide-corps {
  margin-top: var(--espace-2);
  padding: var(--espace-3) var(--espace-4);
  border-radius: var(--rayon-m);
  background: var(--accent-soft);
  max-width: 78ch;
}

.aide-corps p {
  margin: 0 0 var(--espace-2);
}

.aide-corps p:last-child {
  margin-bottom: 0;
}


/* ============================ Filtres replies ============================

   La barre ne garde que ce qui sert tous les jours (recherche, contrat,
   periode, tri) ; le reste se deplie. */
.filtres-plus {
  align-self: flex-end;
}

/* Ouvert, le bloc passe sur sa propre ligne, sous la barre. */
.filtres-plus[open] {
  flex-basis: 100%;
  order: 10;
}

.filtres-plus > summary {
  list-style: none;
  width: fit-content;
}

.filtres-plus > summary::-webkit-details-marker {
  display: none;
}

.filtres-plus[open] > summary {
  background: var(--accent-soft);
  color: var(--accent);
}

.filtres-plus-corps {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--espace-3);
  margin-top: var(--espace-3);
  padding: var(--espace-4);
  border-radius: var(--rayon-m);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* ===================== Liste vide : le parcours en 3 temps ===================== */

.empty-state .vide-titre {
  margin: 0 0 var(--espace-2);
  font-size: var(--taille-l);
  font-weight: var(--graisse-titre);
  color: var(--text);
}

.empty-state .vide-texte {
  margin: 0 auto var(--espace-4);
  max-width: 52ch;
}

.vide-temps {
  display: inline-flex;
  flex-direction: column;
  gap: var(--espace-2);
  margin: 0 auto var(--espace-5);
  padding-left: var(--espace-5);
  text-align: left;
  color: var(--text-muted);
}

.vide-temps strong {
  color: var(--text);
  font-weight: var(--graisse-forte);
}

.vide-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--espace-2);
}

/* ============================ Premiers pas ===============================

   Le guide des quatre etapes (premiersPas.js). Une carte calme : la seule
   couleur est l'accent de l'etape en cours et de sa progression. */
.premiers-pas {
  display: flex;
  flex-direction: column;
  gap: var(--espace-4);
}

.premiers-pas-tete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--espace-4);
}

.premiers-pas-titre {
  margin: 0;
  font-size: var(--taille-xl);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.015em;
}

.premiers-pas-progression {
  margin: var(--espace-1) 0 0;
  color: var(--text-muted);
  font-size: var(--taille-m);
}

/* Le fil : quatre segments sur une ligne (deux par deux sur un telephone).
   Le trait au-dessus de chaque etape fait la barre de progression. */
.premiers-pas-etapes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: var(--espace-3) var(--espace-4);
}

.etape-guide {
  display: flex;
  align-items: center;
  gap: var(--espace-2);
  padding-top: var(--espace-3);
  border-top: 3px solid var(--border);
  color: var(--text-muted);
  font-size: var(--taille-m);
}

.etape-guide[data-etat='faite'] {
  border-top-color: var(--succes);
}

.etape-guide[data-etat='courante'] {
  border-top-color: var(--accent);
  color: var(--text);
  font-weight: var(--graisse-forte);
}

.etape-pastille {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: var(--rayon-plein);
  border: 1.5px solid var(--bordure-champ);
  font-size: var(--taille-xs);
  font-weight: var(--graisse-titre);
  font-variant-numeric: tabular-nums;
}

.etape-guide[data-etat='courante'] .etape-pastille {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.etape-guide[data-etat='faite'] .etape-pastille {
  border-color: var(--succes);
  background: var(--succes);
  color: var(--surface);
}

.etape-pastille .icone {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

/* La carte de l'etape en cours : la seule boite du guide. */
.etape-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--espace-4) var(--espace-6);
  padding: var(--espace-5) var(--espace-6);
  border-radius: var(--rayon-l);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  background: var(--accent-soft);
}

.etape-detail-texte {
  flex: 1 1 340px;
  min-width: 0;
}

.etape-detail-titre {
  margin: 0;
  font-size: var(--taille-l);
  font-weight: var(--graisse-titre);
}

.etape-aide {
  margin: var(--espace-1) 0 0;
  color: var(--text-muted);
  font-size: var(--taille-m);
  max-width: 70ch;
}

/* ============================== Annonces =================================

   Messages brefs en bas de l'ecran (dialogue.js). Une erreur reste jusqu'a
   ce qu'on la ferme ; le reste disparait seul. */
.annonces {
  position: fixed;
  inset: auto var(--espace-5) var(--espace-5) auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: var(--espace-2);
  width: min(420px, calc(100vw - 2 * var(--espace-5)));
  pointer-events: none;
}

/* Dans une fenetre ouverte, en bas de celle-ci. */
.annonces-fenetre {
  position: sticky;
  inset: auto 0 0 auto;
  margin: 0 var(--espace-5) var(--espace-5) auto;
}

.annonce {
  display: flex;
  align-items: flex-start;
  gap: var(--espace-3);
  padding: var(--espace-3) var(--espace-2) var(--espace-3) var(--espace-4);
  border-radius: var(--rayon-m);
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--ombre-3);
  pointer-events: auto;
  animation: annonce-entree var(--duree-longue) var(--courbe-sortie);
}

.annonce > .icone {
  margin-top: 2px;
}

.annonce-succes > .icone {
  color: var(--succes);
}

.annonce-erreur {
  background: var(--danger-soft);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
}

.annonce-erreur > .icone {
  color: var(--danger);
}

.annonce-texte {
  flex: 1;
  margin: 2px 0 0;
  font-size: var(--taille-m);
}

.annonce-lien {
  color: inherit;
  font-weight: var(--graisse-forte);
}

.annonce .annonce-fermer {
  width: 28px;
  height: 28px;
  color: inherit;
  opacity: 0.75;
}

.annonce .annonce-fermer:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
  opacity: 1;
}

@keyframes annonce-entree {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ====================== Fenetres de dialogue.js ========================== */

.dialog-message {
  width: min(520px, 92vw);
}

.dialog-message-corps {
  margin-top: var(--espace-3);
  color: var(--text);
}

.dialog-message-corps > p {
  margin: 0 0 var(--espace-3);
}

.dialog-message-corps > p.count {
  margin-top: calc(-1 * var(--espace-2));
}

/* ===================== Apercu pour un compte gratuit ===================== */

.dialog-apercu {
  width: min(640px, 94vw);
}

.apercu-bloc {
  margin: var(--espace-4) 0;
  padding: var(--espace-4) var(--espace-5);
  border-radius: var(--rayon-m);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.apercu-intertitre {
  display: flex;
  align-items: center;
  gap: var(--espace-2);
  margin: 0 0 var(--espace-2);
  font-size: var(--taille-base);
  font-weight: var(--graisse-titre);
  color: var(--text);
}

.apercu-badge-exemple {
  color: var(--attention);
}

.apercu-offre {
  margin: 0 0 var(--espace-2);
  font-weight: var(--graisse-forte);
}

.apercu-niveau {
  display: flex;
  align-items: center;
  gap: var(--espace-2);
  margin: 0 0 var(--espace-3);
  font-size: var(--taille-m);
  color: var(--text-muted);
}

.apercu-bloc p {
  font-size: var(--taille-m);
}

.apercu-mots,
.apercu-exemple-liste {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--espace-1) var(--espace-4);
  margin: 0;
  font-size: var(--taille-m);
}

.apercu-mots dt,
.apercu-exemple-liste dt {
  font-weight: var(--graisse-forte);
}

.apercu-mots dd,
.apercu-exemple-liste dd {
  margin: 0;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .apercu-mots,
  .apercu-exemple-liste {
    grid-template-columns: 1fr;
  }

  .apercu-mots dd,
  .apercu-exemple-liste dd {
    margin-bottom: var(--espace-2);
  }
}

.apercu-formule {
  margin: var(--espace-4) 0 0;
  font-size: var(--taille-m);
  color: var(--text-muted);
}

/* ============================ Telephone ==================================

   Sous 640 px : la barre du haut tient sur deux lignes (logo et actions,
   puis les onglets), les panneaux respirent moins, le titre de page reduit.
   La pastille « Formule gratuite » cede sa place : « Compte » y mene aussi. */
@media (max-width: 640px) {
  .topbar-actions {
    gap: var(--espace-1);
  }

  body[data-credits='gratuit'] .pastille-credits {
    display: none;
  }

  .container {
    padding: var(--espace-5) var(--espace-4) var(--espace-7);
    gap: var(--espace-4);
  }

  .panel:not(.panel-nu) {
    padding: var(--espace-4);
  }

  .etape-detail {
    padding: var(--espace-4);
  }

  .page-titre {
    font-size: var(--taille-2xl);
  }

  .page-actions,
  .page-actions .btn {
    width: 100%;
  }

  .dialog-inner {
    padding: var(--espace-5) var(--espace-4) var(--espace-5);
  }
}

/* =========================== Mouvement reduit ===========================

   Une personne qui a demande moins d'animations a son systeme (vertiges,
   migraines, attention) ne doit en subir aucune : toutes les durees tombent
   a presque zero, d'un coup, pour toute l'application. Les animations qui
   portent une information (barre de progression) arrivent ainsi directement
   a leur etat final. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ Page Offres : titre cliquable et telephone (2026-11-11) ============ */

/* Le titre d'une offre ouvre son detail. C'est un vrai bouton (clavier,
   lecteurs d'ecran) qui garde l'allure du titre : le souligne au survol dit
   qu'il s'ouvre. */
.offer-title-lien {
  all: unset;
  /* all: unset laisse le texte herite : on le recale a gauche, comme un titre. */
  text-align: start;
  cursor: pointer;
  border-radius: var(--rayon-s);
}

.offer-title-lien:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.offer-title-lien:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Bouton « Filtres » : n'existe que sur telephone. */
.filtres-bascule {
  display: none;
}

@media (max-width: 640px) {
  .filtres-bascule {
    display: inline-flex;
    min-height: 44px;
  }

  /* Filtres replies : il ne reste que la recherche et le bouton. */
  .filters:not(.filtres-ouverts) > :not(.field-grow:first-child):not(.filtres-bascule) {
    display: none;
  }

  /* Un doigt n'est pas un pointeur : 44 px de haut pour tout bouton, sur
     toutes les pages (30 px auparavant pour les petits boutons des cartes
     d'offre et de candidature). */
  .btn {
    min-height: 44px;
  }

  .offer-actions .btn-sm {
    padding-inline: var(--espace-3);
  }

  /* Meme hauteur pour la bascule Colonnes / Liste de la page Candidatures,
     qui n'est pas un .btn. */
  .vue-bouton {
    min-height: 44px;
  }

  /* Les fenetres de relecture (CV, lettre, ajout) prennent tout l'ecran : a
     92 % de large, il restait une marge inutile et deux defilements imbriques. */
  .dialog-large {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
}
