/* Police Inter chargée via <link> dans le <head> de chaque page HTML (avec
   preconnect), pas via @import ici - @import bloque le CSSOM et ajoute un
   aller-retour réseau séquentiel supplémentaire avant le premier rendu texte. */

/* ── Reset & Base ────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Accessibilité : contenu visible uniquement des lecteurs d'écran ───── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Thème Dark - WCAG AA ────────────────────────────────────────── */
:root {
  --bg-base:     #17181a;
  --bg-surface:  #1c1e21;
  --bg-elevated: #24262a;
  --bg-overlay:  #2c2e31;

  --border:      rgba(255,255,255,0.10);
  --border-hover:rgba(255,255,255,0.18);

  /* Variante réservée aux contrôles de formulaire interactifs (WCAG 1.4.11, 3:1 minimum) - `--border` reste plus discret pour les éléments décoratifs (cartes, séparateurs) qui n'ont pas cette exigence. */
  --border-field:      rgba(255,255,255,0.34); /* 3.10:1 ✓ */
  --border-field-hover:rgba(255,255,255,0.42); /* 4.00:1 ✓ */

  /* Contraste minimum 4.5:1 sur bg-surface (#0f1011) */
  --text-primary:   #f0f0f0;   /* 18.5:1 ✓ */
  --text-secondary: #b0b0b0;   /* 8.3:1  ✓ */
  --text-muted:     #808080;   /* 4.6:1  ✓ (était #555 = 2.7:1 ✗) */

  --accent:      #818cf8;      /* indigo-400 - 5.1:1 sur dark ✓ */
  --accent-glow: rgba(129,140,248,0.3);
  --accent-soft: rgba(129,140,248,0.12);

  --success: #34d399;          /* emerald-400 - 5.4:1 ✓ */
  --error:   #f87171;          /* red-400 - 4.6:1 ✓ */

  /* Tokens sémantiques pour tags - dark */
  --tag-blue-bg:    rgba(96,165,250,0.12);
  --tag-blue-text:  #93c5fd;   /* 5.8:1 sur bg-elevated ✓ */
  --tag-blue-bdr:   rgba(96,165,250,0.25);
  --tag-green-bg:   rgba(52,211,153,0.12);
  --tag-green-text: #6ee7b7;   /* 6.1:1 ✓ */
  --tag-green-bdr:  rgba(52,211,153,0.25);
  --tag-purple-bg:  rgba(167,139,250,0.12);
  --tag-purple-text:#c4b5fd;   /* 6.4:1 ✓ */
  --tag-purple-bdr: rgba(167,139,250,0.25);

  /* Skill pills dark */
  --pill-hard-bg:   rgba(96,165,250,0.12);
  --pill-hard-text: #93c5fd;
  --pill-hard-bdr:  rgba(96,165,250,0.25);
  --pill-soft-bg:   rgba(52,211,153,0.12);
  --pill-soft-text: #6ee7b7;
  --pill-soft-bdr:  rgba(52,211,153,0.25);
  --pill-tools-bg:  rgba(167,139,250,0.12);
  --pill-tools-text:#c4b5fd;
  --pill-tools-bdr: rgba(167,139,250,0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --theme-icon-sun: block;
  --theme-icon-moon: none;

  /* ── Échelle d'espacement (mobile-first) ──────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* ── Échelle typographique fluide (clamp : mobile → desktop) ───────── */
  --font-sm:   clamp(0.78rem, 0.74rem + 0.2vw, 0.86rem);
  --font-base: clamp(0.84rem, 0.8rem + 0.2vw, 0.92rem);
  --font-lg:   clamp(1.05rem, 0.98rem + 0.4vw, 1.3rem);
  --font-xl:   clamp(1.4rem, 1.2rem + 1vw, 1.9rem);

  /* ── Cible tactile minimale (WCAG 2.5.5, mobile) ────────────────────── */
  --tap-target: 44px;
}

/* ── Thème Light - WCAG AA ───────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:     #f4f5f7;
  --bg-surface:  #ffffff;
  --bg-elevated: #f0f1f4;
  --bg-overlay:  #e4e6eb;

  --border:      rgba(0,0,0,0.09);
  --border-hover:rgba(0,0,0,0.17);

  /* Variante réservée aux contrôles de formulaire interactifs (WCAG 1.4.11, 3:1 minimum) - `--border` reste plus discret pour les éléments décoratifs (cartes, séparateurs) qui n'ont pas cette exigence. */
  --border-field:      rgba(0,0,0,0.44); /* 3.18:1 ✓ */
  --border-field-hover:rgba(0,0,0,0.52); /* 4.16:1 ✓ */

  /* Contraste minimum 4.5:1 sur bg-surface (#ffffff) */
  --text-primary:   #111827;   /* 18.1:1 ✓ */
  --text-secondary: #374151;   /* 10.7:1 ✓ */
  --text-muted:     #6b7280;   /* 4.7:1  ✓ (était #aaa = 2.3:1 ✗) */

  --accent:      #4f46e5;      /* indigo-600 - 5.9:1 sur blanc ✓ */
  --accent-glow: rgba(79,70,229,0.18);
  --accent-soft: rgba(79,70,229,0.08);

  --success: #065f46;          /* emerald-900 - 8.5:1 ✓ */
  --error:   #991b1b;          /* red-900 - 8.4:1 ✓ */

  /* Tokens sémantiques pour tags - light */
  --tag-blue-bg:    #eff6ff;
  --tag-blue-text:  #1d4ed8;   /* blue-700 - 6.9:1 ✓ */
  --tag-blue-bdr:   #bfdbfe;
  --tag-green-bg:   #ecfdf5;
  --tag-green-text: #065f46;   /* emerald-900 - 8.5:1 ✓ */
  --tag-green-bdr:  #a7f3d0;
  --tag-purple-bg:  #f5f3ff;
  --tag-purple-text:#4c1d95;   /* violet-900 - 9.2:1 ✓ */
  --tag-purple-bdr: #ddd6fe;

  /* Skill pills light */
  --pill-hard-bg:   #eff6ff;
  --pill-hard-text: #1d4ed8;
  --pill-hard-bdr:  #bfdbfe;
  --pill-soft-bg:   #ecfdf5;
  --pill-soft-text: #065f46;
  --pill-soft-bdr:  #a7f3d0;
  --pill-tools-bg:  #f5f3ff;
  --pill-tools-text:#4c1d95;
  --pill-tools-bdr: #ddd6fe;
}

[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .sidebar::before {
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
}

[data-theme="light"] .topbar {
  background: rgba(244,244,246,0.85);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #d0d0d5;
}

/* ── Toggle bouton ───────────────────────────────────────────────── */
.theme-toggle {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

html { font-size: 14px; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ───────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2b2d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a3b3d; }

/* ── Layout ──────────────────────────────────────────────────────────── */

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */

.sidebar {
  width: min(84vw, 280px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 50;
}

.sidebar.open { transform: translateX(0); }

@media (min-width: 992px) {
  .sidebar {
    width: 220px;
    position: relative;
    height: auto;
    transform: none;
    transition: none;
    z-index: 10;
  }
}

/* subtle gradient top-left glow */
.sidebar::before {
  content: '';
  position: absolute;
  top: -60px; left: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(99,102,241,0.4);
}

.sidebar-logo-text {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.sidebar-logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 8px 4px;
  margin-top: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}

.nav-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-link.nav-active {
  background: var(--accent-soft);
  color: #a5b4fc;
}

.nav-link.nav-active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 16px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-link .nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-link.nav-active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-footer-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  flex-shrink: 0;
}

/* ── Main area ───────────────────────────────────────────────────────── */

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(8,9,10,0.8);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-title::before {
  content: '';
  width: 1px; height: 12px;
  background: var(--border-hover);
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--accent-soft);
  border: 1px solid rgba(99,102,241,0.2);
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 500;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.content-inner {
  max-width: 780px;
  margin: 0 auto;
}

/* ── Skip link (accessibilité) ───────────────────────────────────────── */

.skip-link {
  position: absolute; top: -60px; left: 8px; z-index: 10000;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-sm); text-decoration: none; font-size: 0.85rem;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }

/* ── Page header ─────────────────────────────────────────────────────── */

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Cards ───────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--border-hover); }

.card-inset {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.card-accent {
  background: var(--bg-surface);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.card-accent::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.6), transparent);
}

/* ── Section title ───────────────────────────────────────────────────── */

.section-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Labels & Inputs ─────────────────────────────────────────────────── */

.label {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.label-hint {
  font-weight: 400;
  color: var(--text-muted);
}

.input-field {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.84rem;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.input-field::placeholder { color: var(--text-muted); }

.input-field:hover { border-color: var(--border-field-hover); }

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea.input-field {
  resize: vertical;
  line-height: 1.6;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px rgba(99,102,241,0.3);
}

.btn-primary:not(:disabled):hover {
  background: linear-gradient(135deg, #7577f3, #8b4bf5);
  box-shadow: 0 4px 16px rgba(99,102,241,0.35), 0 0 0 1px rgba(99,102,241,0.4);
  transform: translateY(-1px);
}

.btn-primary:not(:disabled):active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:not(:disabled):hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 10px;
}

.btn-ghost:hover { color: var(--text-primary); background: var(--bg-elevated); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
  font-size: 0.76rem;
  padding: 5px 10px;
}

.btn-danger:hover { background: rgba(239,68,68,0.18); }

.btn-lg {
  padding: 12px 24px;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
}

/* ── Tags ────────────────────────────────────────────────────────────── */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

.tag-blue   { background: var(--tag-blue-bg);   color: var(--tag-blue-text);   border: 1px solid var(--tag-blue-bdr); }
.tag-green  { background: var(--tag-green-bg);  color: var(--tag-green-text);  border: 1px solid var(--tag-green-bdr); }
.tag-purple { background: var(--tag-purple-bg); color: var(--tag-purple-text); border: 1px solid var(--tag-purple-bdr); }

/* ── Alerts ──────────────────────────────────────────────────────────── */

.alert-success { color: var(--success); font-size: 0.82rem; }
.alert-error   { color: var(--error);   font-size: 0.82rem; }

/* ── Progress bar ────────────────────────────────────────────────────── */

.progress-track {
  height: 2px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 4px;
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to { left: 200%; }
}

/* ── Dot loader ──────────────────────────────────────────────────────── */

.dot-loader {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dot-loader span {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.dot-loader span:nth-child(1) { animation-delay: 0s; }
.dot-loader span:nth-child(2) { animation-delay: 0.2s; }
.dot-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 60%, 100% { transform: scale(1); opacity: 0.4; }
  30%            { transform: scale(1.5); opacity: 1; }
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; display:inline-block; }

/* ── Divider ─────────────────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── CV Preview (fond blanc propre pour l'export PDF) ────────────────── */

.cv-document {
  background: #ffffff;
  color: #1a1a1a;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  line-height: 1.65;
  padding: 40px 44px;
  border-radius: var(--radius-md);
}

/* ── Sections repliables (details/summary) ───────────────────────────── */

details.fold { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color 0.2s; }
details.fold:hover { border-color: var(--border-hover); }
details.fold[open] summary .chevron { transform: rotate(90deg); }

details.fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: 10px;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary:hover { background: var(--bg-elevated); }

.fold-body { padding: 0 20px 18px; }
details.fold[open] .fold-body { animation: fade-down 0.18s ease; }

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fold-title { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.fold-subtitle { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

.chevron {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 100px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.count-badge.has-items {
  background: var(--accent-soft);
  border-color: rgba(99,102,241,0.2);
  color: #a5b4fc;
}

/* ── Tag pills (compétences) ─────────────────────────────────────────── */

.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  min-height: 42px;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tag-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 10px;
  border-radius: 100px;
  font-size: 0.76rem;
  font-weight: 500;
  background: var(--bg-overlay);
  border: 1px solid var(--border-hover);
  color: var(--text-secondary);
  white-space: nowrap;
}
.skill-pill button {
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  padding: 0;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
}
.skill-pill button:hover { background: rgba(239,68,68,0.15); color: #f87171; }

.pill-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.78rem;
  color: var(--text-primary);
  font-family: inherit;
  min-width: 120px;
  flex: 1;
}
.pill-input::placeholder { color: var(--text-muted); }

/* Skill categories - tokens accessibles */
.skill-pill.hard  { background: var(--pill-hard-bg);  border-color: var(--pill-hard-bdr);  color: var(--pill-hard-text);  font-weight: 600; }
.skill-pill.soft  { background: var(--pill-soft-bg);  border-color: var(--pill-soft-bdr);  color: var(--pill-soft-text);  font-weight: 600; }
.skill-pill.tools { background: var(--pill-tools-bg); border-color: var(--pill-tools-bdr); color: var(--pill-tools-text); font-weight: 600; }

/* ── Diff panel (import IA) ──────────────────────────────────────────── */

.diff-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  z-index: 90;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.diff-panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: min(560px, 100vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: slide-from-right 0.25s cubic-bezier(0.4,0,0.2,1);
}
@keyframes slide-from-right {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.diff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.diff-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.diff-footer {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.diff-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.diff-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.diff-item.add {
  background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.25);
}
.diff-item.add .diff-sign { color: var(--success); font-weight: 700; font-size: 0.9rem; }

.diff-item.replace {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
}
.diff-item.replace .diff-sign { color: #d97706; font-weight: 700; font-size: 0.9rem; }

.diff-item input[type=checkbox] {
  margin-top: 2px;
  width: 14px; height: 14px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.diff-item-text { flex: 1; color: var(--text-secondary); }
.diff-item-text strong { color: var(--text-primary); }

.diff-strategy {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}
.diff-strategy button {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.12s;
}
.diff-strategy button.active {
  background: var(--accent);
  color: white;
}

.diff-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

/* ── Compact experience row ──────────────────────────────────────────── */

.exp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}
.exp-row:hover { border-color: var(--border-hover); }
.exp-row-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
  opacity: 0.5;
}
.exp-row[data-open="true"] .exp-row-dot { opacity: 1; }

/* ── Toggle switch ───────────────────────────────────────────────────── */

.toggle-track {
  width: 38px; height: 22px;
  background: var(--bg-overlay);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: left 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-track.on {
  background: var(--accent);
}

.toggle-track.on::after {
  left: 19px;
}

/* ── Score ATS ───────────────────────────────────────────────────────── */

.ats-ring {
  transform: rotate(-90deg);
  transform-origin: center;
}

.ats-ring-track {
  fill: none;
  stroke: var(--bg-elevated);
  stroke-width: 8;
}

.ats-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ats-bar-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 100px;
  overflow: hidden;
  flex: 1;
}

.ats-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Barre sticky "Sauvegarder" ──────────────────────────────────────── */

.save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px var(--border);
  backdrop-filter: blur(12px);
  margin-top: 8px;
  transition: box-shadow 0.2s;
}

.save-bar:has(button:not(:disabled)):hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--border-hover);
}

.save-bar-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Boutons de réordonnancement ─────────────────────────────────────── */

.reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}

.reorder-btn {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  font-size: 11px;
  line-height: 1;
}

.reorder-btn:hover:not(:disabled) {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.reorder-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* ── CV édition inline ───────────────────────────────────────────────── */

.cv-edit-mode {
  outline: 2px dashed var(--accent) !important;
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.cv-edit-mode [contenteditable] {
  border-radius: 3px;
  transition: background 0.12s;
  outline: none;
}

.cv-edit-mode [contenteditable]:hover {
  background: rgba(99,102,241,0.08);
  cursor: text;
}

.cv-edit-mode [contenteditable]:focus {
  background: rgba(99,102,241,0.12);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.3);
}

.cv-edit-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

/* ── Sélecteur mois/année ────────────────────────────────────────────── */

input[type="month"].input-field {
  cursor: pointer;
  color-scheme: dark;
}

[data-theme="light"] input[type="month"].input-field {
  color-scheme: light;
}

/* ── JSON Editor ─────────────────────────────────────────────────────── */

.json-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.json-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: none;
}

.json-textarea {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  width: 100%;
  min-height: 520px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-field);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--text-primary);
  padding: 16px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.json-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.json-error {
  padding: 10px 14px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--error);
  font-family: monospace;
}

/* ── Animations d'entrée ─────────────────────────────────────────────── */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fade-up 0.3s ease forwards;
}

/* ── Responsive : layout général (mobile-first, 3 paliers) ─────────────
   Mobile   : < 576px  (styles de base, hors media query)
   Tablette : ≥ 576px
   Desktop  : ≥ 992px  (sidebar fixe, burger masqué) ─────────────────── */

.content-area { padding: var(--space-4); }
.topbar { padding: 0 var(--space-4); }

#burger { display: flex; }

@media (min-width: 576px) {
  .content-area { padding: var(--space-5); }
  .topbar { padding: 0 var(--space-5); }
}

@media (min-width: 992px) {
  .content-area { padding: 28px; }
  .topbar { padding: 0 28px; }
  #burger { display: none !important; }
}

/* Cibles tactiles ≥44px sous le palier tablette */
@media (max-width: 575.98px) {
  .btn, .nav-link, .theme-toggle, .input-field, select.input-field,
  .toggle-track, .reorder-btn, .skill-pill button {
    min-height: var(--tap-target);
  }
  .btn { min-width: var(--tap-target); }
  .nav-link { padding: 12px 10px; }
  .reorder-btn, .skill-pill button, .theme-toggle { min-width: var(--tap-target); }
}

/* ── Tableaux (admin) : scroll horizontal plutôt que refonte en cartes ── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
}
.table-wrap table { min-width: 640px; width: 100%; border-collapse: collapse; }

/* ── Formulaires : colonne unique et boutons pleine largeur sous 576px ── */
@media (max-width: 575.98px) {
  .form-grid, .ats-free-grid, .landing-explainer {
    grid-template-columns: 1fr !important;
  }
  .save-bar, .diff-footer, .landing-cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .save-bar .btn, .diff-footer .btn, .landing-cta-row .btn,
  form .btn-primary, form .btn-secondary {
    width: 100%;
  }
}

/* ── Éditeur de CV : formulaire plein écran / bascule aperçu sur mobile ─
   Structure attendue côté JS (cv-editor.js) : un wrapper .cv-editor-layout
   contenant .cv-editor-form et .cv-editor-preview, plus un bouton
   .cv-preview-toggle visible uniquement sous le palier desktop. ────────── */
@media (max-width: 991.98px) {
  .cv-editor-layout { display: block; }
  .cv-editor-layout .cv-editor-form,
  .cv-editor-layout .cv-editor-preview { display: none; width: 100%; }
  .cv-editor-layout.cv-view-form .cv-editor-form { display: block; }
  .cv-editor-layout.cv-view-preview .cv-editor-preview { display: block; }

  .cv-preview-toggle {
    position: sticky; top: 0; z-index: 15;
    display: flex; gap: 8px; padding: 10px 0;
    background: var(--bg-base);
  }
  .cv-preview-toggle .btn { flex: 1; }

  .cv-editor-preview .cv-document-scale-wrap {
    overflow: auto;
    display: flex;
    justify-content: center;
  }
  .cv-editor-preview .cv-document {
    transform: scale(var(--cv-scale, 0.6));
    transform-origin: top center;
  }
}

@media (min-width: 992px) {
  .cv-editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    align-items: start;
  }
  .cv-editor-layout .cv-editor-form,
  .cv-editor-layout .cv-editor-preview { display: block; }
  .cv-preview-toggle { display: none; }
}

/* ── Search inputs utilisés comme tag-inputs (pas de bouton ×) ───────── */

.pill-input[type="search"]::-webkit-search-cancel-button,
.pill-input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  display: none;
}

/* ── Animation suggestions ATS appliquées ────────────────────────────── */

@keyframes breath-green {
  0%, 100% { background: transparent; }
  50%       { background: rgba(16,185,129,0.18); }
}

.ats-applied {
  animation: breath-green 1.4s ease-in-out 4;
  border-radius: 3px;
  outline: 1.5px solid rgba(16,185,129,0.5);
  outline-offset: 1px;
}

/* ── Landing page publique (visiteurs non connectés) ──────────────────── */
#landing { min-height: 100vh; background: var(--bg-base); color: var(--text-primary); }

.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px); max-width: 1200px; margin: 0 auto;
}
.landing-nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.landing-nav-logo-icon {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
}

.landing-hero { max-width: 900px; margin: 0 auto; padding: clamp(40px, 8vw, 90px) 24px 50px; text-align: center; }
.landing-hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; line-height: 1.15; margin: 0 0 18px; }
.landing-hero p.lead { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-secondary); line-height: 1.6; max-width: 640px; margin: 0 auto 28px; }

.landing-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

.landing-section { max-width: 1080px; margin: 0 auto; padding: 50px 24px; }
.landing-section h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; margin: 0 0 14px; text-align: center; }
.landing-section .section-lead { color: var(--text-secondary); text-align: center; max-width: 640px; margin: 0 auto 36px; line-height: 1.6; }

.landing-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.landing-step { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 20px; }
.landing-step-num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 12px;
}
.landing-step h3 { font-size: 0.98rem; margin: 0 0 8px; }
.landing-step p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; margin: 0; }

.landing-explainer { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.landing-explainer + .landing-explainer { margin-top: 48px; }
.landing-explainer h3 { font-size: 1.2rem; margin: 0 0 12px; }
.landing-explainer p { color: var(--text-secondary); line-height: 1.65; font-size: 0.92rem; }

.landing-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.landing-feature { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; }
.landing-feature h3 { font-size: 0.88rem; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.landing-feature p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.landing-feature p a { color: inherit; text-decoration: underline; text-decoration-color: rgba(99,102,241,.5); text-underline-offset: 2px; }
.landing-feature p a:hover { color: #6366f1; }

.landing-faq { max-width: 760px; margin: 0 auto; }
.landing-faq-item { border-bottom: 1px solid var(--border); padding: 18px 0; }
.landing-faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 0.92rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.landing-faq-item summary::-webkit-details-marker { display: none; }
.landing-faq-item p { color: var(--text-secondary); font-size: 0.86rem; line-height: 1.6; margin: 12px 0 0; }

.landing-footer { border-top: 1px solid var(--border); padding: 32px 24px; text-align: center; color: var(--text-muted); font-size: 0.78rem; }
.landing-footer a { color: var(--text-muted); text-decoration: none; margin: 0 8px; }

/* ── ATS Check gratuit, sans inscription (landing, lead gen) ────────────── */
.ats-free-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ats-free-field label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.ats-free-field textarea { min-height: 180px; }
.ats-free-actions { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ats-free-cta { margin-top: 20px; padding: 16px 18px; border-radius: var(--radius-md); background: rgba(99,102,241,.06); border: 1px solid rgba(99,102,241,.2); text-align: center; }
.ats-free-cta p { margin: 0 0 12px; font-size: 0.88rem; color: var(--text-secondary); }

@media (max-width: 720px) {
  .landing-explainer { grid-template-columns: 1fr; }
  .landing-nav { flex-direction: column; gap: 14px; }
  .ats-free-grid { grid-template-columns: 1fr; }
}

/* ── Articles SEO (guides CV ATS / personnalisé / adapté) ──────────────── */
.article-hero { max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 60px) 24px 10px; }
.article-hero .breadcrumb { font-size: 0.78rem; color: var(--text-muted); margin: 0 0 18px; }
.article-hero .breadcrumb a { color: var(--text-muted); text-decoration: none; }
.article-hero .breadcrumb a:hover { color: var(--text-secondary); }
.article-hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.2; margin: 0 0 14px; }
.article-hero .article-lead { font-size: 1.02rem; color: var(--text-secondary); line-height: 1.6; margin: 0 0 6px; }
.article-hero .article-meta { font-size: 0.76rem; color: var(--text-muted); margin: 14px 0 0; }

.article-body { max-width: 760px; margin: 0 auto; padding: 20px 24px 10px; }
.article-body h2 { font-size: 1.35rem; font-weight: 800; margin: 40px 0 14px; }
.article-body h3 { font-size: 1.05rem; font-weight: 700; margin: 26px 0 10px; }
.article-body p { color: var(--text-secondary); line-height: 1.75; font-size: 0.95rem; margin: 0 0 16px; }
.article-body ul, .article-body ol { color: var(--text-secondary); line-height: 1.7; font-size: 0.95rem; margin: 0 0 16px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--text-primary); }
.article-body a { color: #6366f1; }
.article-body .article-callout {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px 20px; margin: 24px 0; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65;
}
.article-callout strong { color: var(--text-primary); }
.article-related { max-width: 760px; margin: 0 auto; padding: 30px 24px 60px; border-top: 1px solid var(--border); }
.article-related h2 { font-size: 1.1rem; margin: 26px 0 14px; }
.article-related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.article-related a { color: #6366f1; text-decoration: none; font-size: 0.92rem; font-weight: 600; }
.article-related a:hover { text-decoration: underline; }

@media print {
  .ats-applied {
    animation: none !important;
    outline: none !important;
    background: transparent !important;
  }
}

@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;
  }
}
