*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1e3a5f;
  --primary-light: #2a5a8f;
  --primary-dark: #142942;
  --accent: #e8f0fe;
  --accent-hover: #d0e2fc;
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --text: #1a2332;
  --text-light: #5a6a7e;
  --text-muted: #8899aa;
  --border: #d8dee6;
  --border-light: #e8ecf1;
  --danger: #dc3545;
  --danger-hover: #c82333;
  --success: #28a745;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(30, 58, 95, 0.08);
  --shadow-lg: 0 8px 30px rgba(30, 58, 95, 0.12);
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', 'Georgia', serif;
  color: var(--primary-dark);
  line-height: 1.3;
}

/* --- Utility --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 380px;
}

.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }
.toast--info { background: var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(40px); }
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  background: var(--primary);
  color: #fff;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.navbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar__brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar__brand svg {
  width: 28px;
  height: 28px;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar__link {
  color: rgba(255,255,255,0.85);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.navbar__link:hover,
.navbar__link--active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

.navbar__link--logout {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
}

.navbar__link--logout:hover {
  background: var(--danger);
  border-color: var(--danger);
}

/* ============================================================
   AUTH PAGES (Login / Register)
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-card__title {
  text-align: center;
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.auth-card__subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.auth-card__logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-card__logo svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
  background: #fff;
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-input--error {
  border-color: var(--danger);
}

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* --- Validation champs --- */
.field-error   { color: #e53e3e; font-size: 0.78rem; margin-top: 4px; }
.input--error  { border-color: #e53e3e !important; }
.required-star { color: #e53e3e; margin-left: 2px; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-light);
}

.btn--secondary {
  background: var(--accent);
  color: var(--primary);
}

.btn--secondary:hover {
  background: var(--accent-hover);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  background: var(--danger-hover);
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
}

.btn--outline:hover {
  background: var(--accent);
  border-color: var(--primary);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.82rem;
}

.btn--lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* --- Spinner --- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner--dark {
  border-color: rgba(30,58,95,0.2);
  border-top-color: var(--primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-card__footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.auth-card__footer a {
  font-weight: 600;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard {
  padding: 40px 0;
}

.dashboard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard__title {
  font-size: 1.8rem;
}

.dashboard__subtitle {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-top: 4px;
  font-family: 'Inter', sans-serif;
}

/* --- CV Grid --- */
.cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.cv-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1.5px solid var(--border-light);
  padding: 28px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.cv-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.cv-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cv-card__name {
  font-size: 1.2rem;
  font-family: 'Playfair Display', serif;
  color: var(--primary-dark);
}

.cv-card__date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: 'Inter', sans-serif;
}

.cv-card__job {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
}

.cv-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.cv-card__tag {
  background: var(--accent);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.cv-card__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.cv-card__actions .btn {
  flex: 1;
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  margin: 0 auto 20px;
}

.empty-state__title {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.empty-state__text {
  color: var(--text-light);
  margin-bottom: 24px;
  font-family: 'Inter', sans-serif;
}

/* ============================================================
   CV BUILDER
   ============================================================ */
.builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: calc(100vh - 64px);
}

.builder__form {
  padding: 32px;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
  background: var(--bg);
}

.builder__preview {
  background: #e2e8f0;
  padding: 32px;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.builder__form-title {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

/* --- Sections du formulaire --- */
.form-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  border: 1.5px solid var(--border-light);
}

.form-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.form-section__title {
  font-size: 1.1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section__title svg {
  width: 20px;
  height: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* --- Photo Upload --- */
.photo-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.photo-upload:hover {
  border-color: var(--primary);
  background: var(--accent);
}

.photo-upload.drag-over {
  border-color: var(--primary);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.photo-upload__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.photo-upload__preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: var(--transition);
}

.photo-upload__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.photo-upload__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.photo-upload__placeholder svg {
  width: 32px;
  height: 32px;
  opacity: 0.7;
}

.photo-upload__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.photo-upload__text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.photo-upload__hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.photo-upload__remove {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

.photo-upload.has-photo {
  border-style: solid;
  border-color: var(--primary);
  background: var(--bg-card);
}

/* --- Repeatable items (experience, education, etc.) --- */
.repeatable-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
  position: relative;
}

.repeatable-item__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.repeatable-item__remove:hover {
  color: var(--danger);
  background: rgba(220, 53, 69, 0.1);
}

/* --- Builder actions bar --- */
.builder__actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

/* ============================================================
   CV PREVIEW (A4-like)
   ============================================================ */
.cv-preview {
  width: 210mm;
  min-height: 297mm;
  background: #fff;
  box-shadow: var(--shadow-lg);
  padding: 40px;
  font-size: 10pt;
  line-height: 1.5;
  color: #222;
  font-family: 'Inter', sans-serif;
}

.cv-preview__header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--primary);
  margin-bottom: 24px;
}

.cv-preview__photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  flex-shrink: 0;
}

.cv-preview__photo--placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  flex-shrink: 0;
  border: 3px solid var(--primary);
}

.cv-preview__name {
  font-family: 'Playfair Display', serif;
  font-size: 22pt;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.cv-preview__job {
  font-size: 12pt;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.cv-preview__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 9pt;
  color: #555;
}

.cv-preview__contact-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cv-preview__contact-item svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

/* --- CV Sections --- */
.cv-section {
  margin-bottom: 20px;
}

.cv-section__title {
  font-family: 'Playfair Display', serif;
  font-size: 13pt;
  color: var(--primary);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cv-entry {
  margin-bottom: 14px;
}

.cv-entry__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.cv-entry__title {
  font-weight: 700;
  font-size: 10.5pt;
  color: #222;
}

.cv-entry__date {
  font-size: 9pt;
  color: #777;
  white-space: nowrap;
}

.cv-entry__subtitle {
  font-size: 9.5pt;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.cv-entry__desc {
  font-size: 9.5pt;
  color: #444;
}

/* --- Skills --- */
.cv-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cv-skill-tag {
  background: var(--accent);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 9pt;
  font-weight: 500;
}

/* --- Languages --- */
.cv-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.cv-lang {
  font-size: 9.5pt;
}

.cv-lang__name {
  font-weight: 600;
}

.cv-lang__level {
  color: #777;
}

/* --- About / Profile --- */
.cv-about {
  font-size: 9.5pt;
  color: #444;
  line-height: 1.6;
}

/* ============================================================
   MODAL / CONFIRM DIALOG
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal__title {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.modal__text {
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .builder {
    grid-template-columns: 1fr;
  }

  .builder__form,
  .builder__preview {
    max-height: none;
  }

  .builder__preview {
    padding: 20px;
  }

  .cv-preview {
    width: 100%;
    min-height: auto;
    padding: 24px;
  }
}

@media (max-width: 600px) {
  .auth-card {
    padding: 32px 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .cv-grid {
    grid-template-columns: 1fr;
  }

  .navbar__inner {
    height: auto;
    padding: 12px 0;
    flex-direction: column;
    gap: 12px;
  }

  .cv-preview__header {
    flex-direction: column;
    text-align: center;
  }

  .cv-preview__contact {
    justify-content: center;
  }

  .dashboard__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   PRINT / EXPORT PDF
   ============================================================ */

/* Supprime l'URL, la date et les numéros de page ajoutés
   automatiquement par le navigateur en bas/haut de page      */
@page {
  size: A4;
  margin: 0;
}

@media print {
  body {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Masquer tout sauf la prévisualisation du CV */
  .navbar,
  .builder__form,
  .builder__actions,
  .no-print,
  .toast-container {
    display: none !important;
  }

  .builder {
    display: block;
    padding: 0 !important;
    margin: 0 !important;
  }

  .builder__preview {
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
  }

  /* Le CV occupe exactement la feuille A4 */
  .cv-preview {
    box-shadow: none !important;
    width: 210mm !important;
    min-height: 297mm !important;
    padding: 20mm !important;
    margin: 0 !important;
    page-break-inside: avoid;
  }
}

/* ============================================================
   STYLES DE CV — 5 RENDUS DISTINCTS
   Chaque style est scope sous .cv-preview--sX
   ============================================================ */

/* Wrapper de base commun a tous les styles */
.cv-preview {
  width: 210mm;
  min-height: 297mm;
  background: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 10pt;
  line-height: 1.5;
  color: #222;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

/* ============================================================
   STYLE 1 — Classique Pro
   Bleu professionnel, header photo + nom, sections avec
   titres soulignés en bleu. Identique au style original.
   ============================================================ */
.cv-preview--s1 {
  padding: 40px;
}

/* Header */
.cv-preview--s1 .s1-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 3px solid #1e3a5f;
  margin-bottom: 24px;
}
.cv-preview--s1 .s1-photo {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #1e3a5f;
  flex-shrink: 0;
}
.cv-preview--s1 .s1-photo-placeholder {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: #e8f0fe;
  display: flex; align-items: center; justify-content: center;
  color: #1e3a5f;
  font-size: 2rem; font-weight: 700;
  font-family: 'Playfair Display', serif;
  flex-shrink: 0;
  border: 3px solid #1e3a5f;
}
.cv-preview--s1 .s1-name {
  font-family: 'Playfair Display', serif;
  font-size: 22pt; color: #142942;
  margin-bottom: 4px;
}
.cv-preview--s1 .s1-job {
  font-size: 12pt; color: #1e3a5f;
  font-weight: 600; margin-bottom: 8px;
}
.cv-preview--s1 .s1-contact {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 9pt; color: #555;
}
.cv-preview--s1 .s1-ci {
  display: flex; align-items: center; gap: 4px;
}

/* Sections */
.cv-preview--s1 .s1-section { margin-bottom: 20px; }
.cv-preview--s1 .s1-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 11pt; color: #1e3a5f;
  padding-bottom: 5px;
  border-bottom: 2px solid #e8f0fe;
  margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cv-preview--s1 .s1-about {
  font-size: 9.5pt; color: #444; line-height: 1.6;
}

/* Entrees */
.cv-preview--s1 .s1-entry { margin-bottom: 13px; }
.cv-preview--s1 .s1-entry-header {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 3px;
}
.cv-preview--s1 .s1-entry-title { font-weight: 700; font-size: 10pt; }
.cv-preview--s1 .s1-entry-date  { font-size: 9pt; color: #777; white-space: nowrap; }
.cv-preview--s1 .s1-entry-sub   { font-size: 9.5pt; color: #1e3a5f; font-weight: 600; margin-bottom: 3px; }
.cv-preview--s1 .s1-entry-desc  { font-size: 9pt; color: #444; }

/* Competences */
.cv-preview--s1 .s1-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-preview--s1 .s1-skill-tag {
  background: #e8f0fe; color: #142942;
  padding: 4px 12px; border-radius: 20px;
  font-size: 9pt; font-weight: 500;
}

/* Langues */
.cv-preview--s1 .s1-langs { display: flex; flex-wrap: wrap; gap: 16px; }
.cv-preview--s1 .s1-lang  { font-size: 9.5pt; }


/* ============================================================
   STYLE 2 — Sidebar Moderne
   Colonne sombre à gauche (contact + compétences),
   contenu principal à droite sur fond blanc.
   ============================================================ */
.cv-preview--s2 {
  padding: 0;
  display: flex;
}

.cv-preview--s2 .s2-wrapper {
  display: flex;
  width: 100%;
  align-items: flex-start;
}

/* Sidebar */
.cv-preview--s2 .s2-sidebar {
  width: 38%;
  background: #1e3a5f;
  padding: 36px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.cv-preview--s2 .s2-photo {
  width: 90px; height: 90px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.35);
  margin-bottom: 14px;
}
.cv-preview--s2 .s2-photo-placeholder {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.8rem; font-weight: 700;
  font-family: 'Playfair Display', serif;
  border: 3px solid rgba(255,255,255,0.35);
  margin-bottom: 14px;
}
.cv-preview--s2 .s2-name {
  font-family: 'Playfair Display', serif;
  font-size: 14pt; font-weight: 700; color: #fff;
  text-align: center; margin-bottom: 4px;
}
.cv-preview--s2 .s2-job {
  font-size: 9pt; color: rgba(255,255,255,0.7);
  text-align: center; margin-bottom: 0;
}
.cv-preview--s2 .s2-divider {
  width: 80%; height: 1px;
  background: rgba(255,255,255,0.18);
  margin: 18px 0; align-self: center;
}
.cv-preview--s2 .s2-sec { width: 100%; }
.cv-preview--s2 .s2-sec-title {
  font-size: 8pt; font-weight: 700;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 10px;
}
.cv-preview--s2 .s2-contact-item {
  font-size: 8.5pt; color: rgba(255,255,255,0.85);
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
  word-break: break-all;
}
.cv-preview--s2 .s2-skill-label {
  font-size: 8.5pt; color: rgba(255,255,255,0.85);
  margin-bottom: 3px;
}
.cv-preview--s2 .s2-skill-bar {
  height: 4px; background: rgba(255,255,255,0.15);
  border-radius: 2px; margin-bottom: 8px; overflow: hidden;
}
.cv-preview--s2 .s2-skill-fill {
  height: 100%; width: 75%;
  background: #6cb4ee; border-radius: 2px;
}
.cv-preview--s2 .s2-lang-item {
  font-size: 8.5pt; color: rgba(255,255,255,0.85);
  margin-bottom: 6px;
}
.cv-preview--s2 .s2-lang-item span {
  color: rgba(255,255,255,0.55); font-size: 8pt;
}

/* Main */
.cv-preview--s2 .s2-main {
  flex: 1; padding: 36px 28px;
  background: #fff;
}
.cv-preview--s2 .s2-main-section { margin-bottom: 22px; }
.cv-preview--s2 .s2-main-title {
  font-size: 11pt; font-weight: 700; color: #1e3a5f;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid #e8f0fe;
  padding-bottom: 5px; margin-bottom: 12px;
}
.cv-preview--s2 .s2-about {
  font-size: 9.5pt; color: #444; line-height: 1.6;
}
.cv-preview--s2 .s2-entry { margin-bottom: 13px; }
.cv-preview--s2 .s2-entry-header {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 3px;
}
.cv-preview--s2 .s2-entry-title { font-weight: 700; font-size: 10pt; }
.cv-preview--s2 .s2-entry-date  { font-size: 9pt; color: #777; white-space: nowrap; }
.cv-preview--s2 .s2-entry-sub   { font-size: 9pt; color: #1e3a5f; font-weight: 600; margin-bottom: 3px; }
.cv-preview--s2 .s2-entry-desc  { font-size: 9pt; color: #555; }


/* ============================================================
   STYLE 3 — Minimaliste
   Noir et blanc, typographie légère, séparateurs fins.
   Pas de couleur, laisser le contenu parler.
   ============================================================ */
.cv-preview--s3 {
  padding: 48px 50px;
}

.cv-preview--s3 .s3-header { margin-bottom: 24px; }
.cv-preview--s3 .s3-name {
  font-family: 'Playfair Display', serif;
  font-size: 26pt; font-weight: 400;
  color: #111; letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.cv-preview--s3 .s3-job {
  font-size: 11pt; color: #666;
  font-weight: 400; margin-bottom: 10px;
  letter-spacing: 0.2px;
}
.cv-preview--s3 .s3-contact {
  display: flex; flex-wrap: wrap; gap: 18px;
  font-size: 8.5pt; color: #888;
}
.cv-preview--s3 .s3-hr {
  border: none; border-top: 1px solid #ddd;
  margin: 16px 0;
}
.cv-preview--s3 .s3-section { margin-bottom: 22px; }
.cv-preview--s3 .s3-section-title {
  font-size: 7.5pt; font-weight: 700;
  color: #111; text-transform: uppercase;
  letter-spacing: 2.5px; margin-bottom: 10px;
  font-family: 'Inter', sans-serif;
}
.cv-preview--s3 .s3-text {
  font-size: 9.5pt; color: #444; line-height: 1.7;
}
.cv-preview--s3 .s3-entry { margin-bottom: 14px; }
.cv-preview--s3 .s3-entry-header {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 2px;
}
.cv-preview--s3 .s3-entry-title {
  font-weight: 600; font-size: 10pt; color: #111;
}
.cv-preview--s3 .s3-entry-date {
  font-size: 8.5pt; color: #aaa;
}
.cv-preview--s3 .s3-entry-sub {
  font-size: 9pt; color: #666;
  font-style: italic; margin-bottom: 3px;
}
.cv-preview--s3 .s3-skills-inline {
  font-size: 9.5pt; color: #444;
  line-height: 1.8;
}
.cv-preview--s3 .s3-langs { display: flex; flex-wrap: wrap; gap: 16px; }
.cv-preview--s3 .s3-lang  { font-size: 9.5pt; color: #444; }


/* ============================================================
   STYLE 4 — Créatif Timeline
   Header gradient bleu océan, barre de contact sombre,
   corps 2 colonnes, timeline pour les expériences,
   badges colorés pour les compétences.
   ============================================================ */
.cv-preview--s4 {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Header gradient */
.cv-preview--s4 .s4-header {
  background: linear-gradient(135deg, #0f4c75 0%, #1b6ca8 60%, #118ab2 100%);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.cv-preview--s4 .s4-photo {
  width: 80px; height: 80px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.cv-preview--s4 .s4-photo-placeholder {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.6rem; font-weight: 700;
  font-family: 'Playfair Display', serif;
  border: 3px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.cv-preview--s4 .s4-name {
  font-family: 'Playfair Display', serif;
  font-size: 20pt; font-weight: 700; color: #fff;
  margin-bottom: 4px;
}
.cv-preview--s4 .s4-job {
  font-size: 10pt; color: rgba(255,255,255,0.85);
}

/* Barre contact */
.cv-preview--s4 .s4-contact-bar {
  background: #0a3553;
  padding: 8px 32px;
  display: flex; flex-wrap: wrap; gap: 20px;
}
.cv-preview--s4 .s4-ci {
  font-size: 8pt; color: rgba(255,255,255,0.75);
  display: flex; align-items: center; gap: 4px;
}

/* Corps */
.cv-preview--s4 .s4-body {
  display: flex;
  align-items: flex-start;
  padding: 24px 24px 24px 24px;
  gap: 20px;
  background: #f8fafc;
}
.cv-preview--s4 .s4-left  { width: 38%; }
.cv-preview--s4 .s4-right { flex: 1; border-left: 1px solid #e0e7ef; padding-left: 20px; }

.cv-preview--s4 .s4-section { margin-bottom: 20px; }
.cv-preview--s4 .s4-section-title {
  font-size: 9pt; font-weight: 700;
  color: #0f4c75; text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.cv-preview--s4 .s4-section-title::after {
  content: ''; flex: 1; height: 1.5px;
  background: linear-gradient(90deg, #1b6ca8, transparent);
}
.cv-preview--s4 .s4-about {
  font-size: 9.5pt; color: #445; line-height: 1.6;
}

/* Badges compétences colorés */
.cv-preview--s4 .s4-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-preview--s4 .s4-tag {
  font-size: 8.5pt; font-weight: 600;
  padding: 3px 10px; border-radius: 12px;
}
.cv-preview--s4 .s4-tag-blue   { background: #e3f2fd; color: #0d47a1; }
.cv-preview--s4 .s4-tag-green  { background: #e8f5e9; color: #1b5e20; }
.cv-preview--s4 .s4-tag-orange { background: #fff3e0; color: #e65100; }
.cv-preview--s4 .s4-tag-purple { background: #f3e5f5; color: #4a148c; }
.cv-preview--s4 .s4-tag-teal   { background: #e0f2f1; color: #004d40; }

.cv-preview--s4 .s4-lang {
  font-size: 9pt; color: #445; margin-bottom: 4px;
}

/* Timeline */
.cv-preview--s4 .s4-timeline {
  position: relative;
  padding-left: 18px;
}
.cv-preview--s4 .s4-timeline::before {
  content: '';
  position: absolute; left: 5px; top: 4px; bottom: 0;
  width: 2px; background: #1b6ca8;
}
.cv-preview--s4 .s4-tl-item {
  position: relative; margin-bottom: 14px;
}
.cv-preview--s4 .s4-tl-dot {
  position: absolute; left: -18px; top: 3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #1b6ca8; border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px #1b6ca8;
}
.cv-preview--s4 .s4-tl-header {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 2px;
}
.cv-preview--s4 .s4-tl-title { font-weight: 700; font-size: 10pt; color: #1a2332; }
.cv-preview--s4 .s4-tl-date  { font-size: 8.5pt; color: #888; white-space: nowrap; }
.cv-preview--s4 .s4-tl-sub   { font-size: 9pt; color: #1b6ca8; font-weight: 600; margin-bottom: 3px; }
.cv-preview--s4 .s4-tl-desc  { font-size: 9pt; color: #555; }


/* ============================================================
   STYLE 5 — Élégant Prestige
   En-tête nuit étoilée (#1a1a2e), accent or (#c9a227),
   2 colonnes asymétriques, typographie serif classique.
   ============================================================ */
.cv-preview--s5 {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Header nuit */
.cv-preview--s5 .s5-header {
  background: #1a1a2e;
  padding: 30px 36px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.cv-preview--s5 .s5-photo {
  width: 88px; height: 88px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid #c9a227;
  flex-shrink: 0;
}
.cv-preview--s5 .s5-header-text { flex: 1; }
.cv-preview--s5 .s5-name {
  font-family: 'Playfair Display', serif;
  font-size: 20pt; font-weight: 700;
  color: #fff; letter-spacing: 1.5px;
  margin-bottom: 5px;
}
.cv-preview--s5 .s5-job {
  font-size: 10pt; color: #c9a227;
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 10px; font-family: 'Inter', sans-serif;
}
.cv-preview--s5 .s5-contact {
  display: flex; flex-wrap: wrap; gap: 14px;
}
.cv-preview--s5 .s5-ci {
  font-size: 8.5pt; color: rgba(255,255,255,0.6);
  font-family: 'Inter', sans-serif;
}

/* Ligne dorée séparatrice */
.cv-preview--s5 .s5-gold-line {
  height: 3px;
  background: linear-gradient(90deg, transparent, #c9a227, #f0d060, #c9a227, transparent);
}

/* Corps */
.cv-preview--s5 .s5-body {
  display: flex;
  align-items: flex-start;
  background: #fff;
}
.cv-preview--s5 .s5-left {
  width: 34%;
  background: #faf8f4;
  border-right: 1px solid #e8e0d0;
  padding: 28px 22px;
  box-sizing: border-box;
}
.cv-preview--s5 .s5-right {
  flex: 1;
  padding: 28px 28px;
  box-sizing: border-box;
}

.cv-preview--s5 .s5-section { margin-bottom: 22px; }
.cv-preview--s5 .s5-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 10pt; font-weight: 700;
  color: #1a1a2e; text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #c9a227;
  padding-bottom: 4px; margin-bottom: 12px;
}

/* Competences */
.cv-preview--s5 .s5-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-preview--s5 .s5-skill-tag {
  font-size: 8.5pt; color: #1a1a2e;
  border: 1.5px solid #c9a227;
  padding: 3px 9px; border-radius: 4px;
  font-family: 'Inter', sans-serif;
  background: transparent;
}

/* Langues */
.cv-preview--s5 .s5-lang {
  display: flex; flex-direction: column;
  margin-bottom: 8px;
}
.cv-preview--s5 .s5-lang-name  { font-size: 9.5pt; font-weight: 700; color: #1a1a2e; }
.cv-preview--s5 .s5-lang-level { font-size: 8.5pt; color: #c9a227; font-style: italic; }

/* Contenu principal */
.cv-preview--s5 .s5-about {
  font-size: 9.5pt; color: #444; line-height: 1.7;
}
.cv-preview--s5 .s5-entry { margin-bottom: 14px; }
.cv-preview--s5 .s5-entry-header {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 2px;
}
.cv-preview--s5 .s5-entry-title { font-weight: 700; font-size: 10pt; color: #1a1a2e; }
.cv-preview--s5 .s5-entry-date  { font-size: 8.5pt; color: #aaa; white-space: nowrap; }
.cv-preview--s5 .s5-entry-sub {
  font-size: 9pt; color: #c9a227;
  font-weight: 600; font-style: italic; margin-bottom: 4px;
}
.cv-preview--s5 .s5-entry-desc  { font-size: 9pt; color: #555; }


/* ============================================================
   PRINT — Compatibilité multi-styles
   ============================================================ */
@page {
  size: A4;
  margin: 0;
}

@media print {
  body { background: white !important; margin: 0 !important; padding: 0 !important; }

  .navbar, .builder__form, .builder__actions, .no-print, .toast-container {
    display: none !important;
  }

  .builder { display: block; padding: 0 !important; margin: 0 !important; }

  .builder__preview {
    background: none !important; padding: 0 !important;
    margin: 0 !important; max-height: none !important;
    overflow: visible !important; display: block !important;
  }

  /* Style 1 et 3 */
  .cv-preview--s1,
  .cv-preview--s3 {
    box-shadow: none !important;
    width: 210mm !important;
    min-height: 297mm !important;
  }

  /* Style 2 : sidebar */
  .cv-preview--s2 {
    box-shadow: none !important;
    width: 210mm !important;
    min-height: 297mm !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Style 4 et 5 : couleurs de fond à forcer */
  .cv-preview--s4,
  .cv-preview--s5 {
    box-shadow: none !important;
    width: 210mm !important;
    min-height: 297mm !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Forcer les fonds colorés en impression */
  .s2-sidebar,
  .s4-header, .s4-contact-bar,
  .s5-header, .s5-gold-line {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}