/* ============================================================
   CV BUILDER — style.css
   Structure :
   1. Reset & variables globales
   2. Layout application (deux panneaux)
   3. Styles du formulaire
   4. Sélecteur de templates (cartes)
   5. Zone d'aperçu et toolbar
   6. ── TEMPLATE 1 : Minimaliste ──
   7. ── TEMPLATE 2 : Professionnel ──
   8. ── TEMPLATE 3 : Moderne ──
   9. ── TEMPLATE 4 : Élégant ──
  10. ── TEMPLATE 5 : Compact ATS ──
  11. ── TEMPLATE 6 : Technique ──
  12. Éléments communs du CV (partagés par tous les templates)
  13. Toast / feedback
  14. Impression (@media print)
   ============================================================ */


/* ============================================================
   1. RESET & VARIABLES GLOBALES
   ============================================================ */

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

:root {
  /* Couleurs interface */
  --ui-bg:         #f1f3f5;
  --panel-bg:      #ffffff;
  --panel-border:  #dee2e6;
  --input-border:  #ced4da;
  --input-focus:   #6366f1;
  --label-color:   #495057;
  --hint-color:    #868e96;
  --text-primary:  #212529;

  /* Boutons */
  --btn-primary:   #6366f1;
  --btn-primary-h: #4f46e5;
  --btn-secondary: #0ea5e9;
  --btn-secondary-h: #0284c7;
  --btn-outline-bd: #6366f1;

  /* Misc */
  --radius:        6px;
  --radius-lg:     10px;
  --shadow-card:   0 2px 12px rgba(0,0,0,.08);
  --shadow-cv:     0 4px 32px rgba(0,0,0,.15);
  --transition:    .18s ease;

  /* Largeur A4 (794 px à 96 dpi) */
  --a4-width:      794px;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--ui-bg);
}


/* ============================================================
   2. LAYOUT APPLICATION
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: 400px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Panneau formulaire ── */
.form-panel {
  overflow-y: auto;
  background: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  padding: 24px 20px 40px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.form-panel::-webkit-scrollbar { width: 5px; }
.form-panel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* En-tête de l'application */
.form-header {
  text-align: center;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--panel-border);
}

.app-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--btn-primary);
  letter-spacing: -.5px;
}

.app-subtitle {
  font-size: 13px;
  color: var(--hint-color);
  margin-top: 2px;
}

/* ── Panneau aperçu ── */
.preview-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ui-bg);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: white;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.preview-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.preview-hint {
  font-size: 12px;
  color: var(--hint-color);
  margin-right: 10px;
}

.preview-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.preview-scroll::-webkit-scrollbar { width: 6px; }
.preview-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }


/* ============================================================
   3. STYLES DU FORMULAIRE
   ============================================================ */

.form-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--label-color);
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header .section-title { margin-bottom: 0; }

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--label-color);
  margin-bottom: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: #fafafa;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}

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

.form-hint {
  font-size: 11px;
  color: var(--hint-color);
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Entrées répétables (expériences, formations, compétences) ── */
.entry-block {
  background: #f8faff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
}

.entry-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.entry-block-title {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── Boutons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--btn-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.btn-primary:hover { background: var(--btn-primary-h); box-shadow: 0 4px 12px rgba(99,102,241,.4); }

.btn-secondary {
  background: var(--btn-secondary);
  color: white;
  box-shadow: 0 2px 8px rgba(14,165,233,.25);
}
.btn-secondary:hover { background: var(--btn-secondary-h); }

.btn-outline {
  background: transparent;
  color: var(--btn-outline-bd);
  border: 1.5px solid var(--btn-outline-bd);
}
.btn-outline:hover { background: rgba(99,102,241,.06); }

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  background: var(--btn-primary);
  color: white;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition);
}
.btn-sm:hover { background: var(--btn-primary-h); }

.btn-add {
  font-size: 12px;
  font-weight: 600;
  color: var(--btn-primary);
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-add:hover { background: rgba(99,102,241,.16); }

.btn-remove {
  font-size: 16px;
  line-height: 1;
  color: #ef4444;
  background: rgba(239,68,68,.08);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.btn-remove:hover { background: rgba(239,68,68,.18); }

/* ── Boutons d'action principaux ── */
.action-buttons {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--panel-border);
}

.copy-feedback {
  font-size: 12px;
  color: #16a34a;
  text-align: center;
  min-height: 18px;
  margin-top: 6px;
}


/* ============================================================
   4. SÉLECTEUR DE TEMPLATES (cartes)
   ============================================================ */

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 8px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  background: white;
}

.template-card:hover {
  border-color: #a5b4fc;
  box-shadow: var(--shadow-card);
}

.template-card.selected {
  border-color: var(--btn-primary);
  background: #f5f3ff;
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.template-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Miniature du template */
.template-thumb {
  width: 70px;
  height: 90px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 3px;
  padding: 6px 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.tt-header-block {
  height: 18px;
  border-radius: 1px;
  margin: -6px -5px 0;
  width: calc(100% + 10px);
  flex-shrink: 0;
}

.tt-bar {
  height: 3px;
  background: #ccc;
  border-radius: 2px;
  width: 100%;
}
.tt-name  { height: 5px; background: #555; width: 70%; }
.tt-sub   { background: #999; width: 50%; }
.tt-short { width: 55%; }
.tt-medium { width: 75%; }
.tt-rule  { height: 1px; background: #ddd; }

.template-label {
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
  text-align: center;
  pointer-events: none;
}

.template-card.selected .template-label {
  color: var(--btn-primary);
}


/* ============================================================
   4b. SÉLECTEUR DE COULEURS
   ============================================================ */

.color-pickers {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.color-picker-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.color-picker-item label {
  font-size: 11px;
  font-weight: 600;
  color: var(--label-color);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.color-picker-item input[type="color"] {
  width: 100%;
  height: 34px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 2px 3px;
  background: white;
  transition: border-color var(--transition);
}

.color-picker-item input[type="color"]:hover {
  border-color: #a5b4fc;
}

.btn-reset-colors {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), color var(--transition);
}

.btn-reset-colors:hover {
  border-color: #a5b4fc;
  color: var(--btn-primary);
}


/* ============================================================
   5. ZONE D'APERÇU
   ============================================================ */

/* Conteneur général du CV rendu */
.cv-preview {
  width: var(--a4-width);
  min-height: 1123px;   /* A4 à 96 dpi */
  background: white;
  box-shadow: var(--shadow-cv);
  position: relative;
  user-select: text;    /* texte sélectionnable */
}

/* Placeholder vide */
.cv-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 1123px;
  color: #adb5bd;
  text-align: center;
  line-height: 1.6;
  padding: 40px;
}

.cv-placeholder p { font-size: 14px; }


/* ============================================================
   12. ÉLÉMENTS COMMUNS À TOUS LES TEMPLATES
       (classes partagées utilisées par buildCVHTML dans JS)
   ============================================================ */

/* Les templates surchargeront ces valeurs via leurs propres classes */
.cv-section { margin-top: 0; }
.cv-job-title-line { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px; }
.cv-job-company  { font-weight: 600; }
.cv-job-dates    { font-size: .88em; color: #666; white-space: nowrap; }
.cv-job-desc     { margin-top: 4px; }
.cv-job-desc ul  { padding-left: 18px; }
.cv-job-desc li  { margin-bottom: 2px; }
.cv-skill-group  { margin-bottom: 6px; }
.cv-skill-category { font-weight: 700; }
.cv-skill-list   { display: inline; }
.cv-contact-items { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.cv-contact-item  { font-size: .9em; }


/* ============================================================
   6. TEMPLATE 1 — MINIMALISTE
   ============================================================ */

/*
   Design : blanc, typographie system-ui, règles fines,
   beaucoup d'espace, palette neutre.
*/

.template-minimal {
  /* Variables universelles — surchargées par les color pickers */
  --cv-primary:    #222222;
  --cv-secondary:  #888888;
  /* Variables du template */
  --t-accent:      var(--cv-primary);
  --t-sub:         #666666;
  --t-rule:        #e0e0e0;
  --t-section-clr: var(--cv-secondary);

  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #222;
  padding: 50px 48px;
  line-height: 1.55;
  font-size: 13.5px;
}

.template-minimal .cv-header {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--t-accent);
}

.template-minimal .cv-name {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: #111;
  margin: 0;
}

.template-minimal .cv-headline {
  font-size: 14px;
  color: var(--t-sub);
  margin-top: 4px;
}

.template-minimal .cv-contact-items {
  margin-top: 10px;
  gap: 4px 20px;
}

.template-minimal .cv-contact-item {
  font-size: 12.5px;
  color: var(--t-sub);
}

.template-minimal .cv-section {
  margin-top: 22px;
}

.template-minimal .cv-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--t-section-clr);
  border-bottom: 1px solid var(--t-rule);
  padding-bottom: 5px;
  margin-bottom: 12px;
  font-weight: 700;
}

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

.template-minimal .cv-job-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.template-minimal .cv-job-company {
  color: #444;
}

.template-minimal .cv-job-dates {
  color: var(--t-sub);
  font-size: 12px;
}

.template-minimal .cv-job-desc {
  color: #444;
  margin-top: 5px;
  font-size: 13px;
}

.template-minimal .cv-summary-text {
  color: #444;
  font-size: 13.5px;
}

.template-minimal .cv-skills-text {
  color: #444;
}


/* ============================================================
   7. TEMPLATE 2 — PROFESSIONNEL
   ============================================================ */

/*
   Design : navy foncé, Georgia serif, accents de bordure,
   look classique et corporate.
*/

.template-professional {
  --cv-primary:    #1a2744;
  --cv-secondary:  #c8d0e0;
  --t-navy:        var(--cv-primary);
  --t-body:        #1a1a1a;
  --t-sub:         #4a5568;
  --t-rule:        var(--cv-secondary);

  font-family: Georgia, 'Times New Roman', serif;
  color: var(--t-body);
  padding: 48px 50px;
  line-height: 1.6;
  font-size: 13.5px;
}

.template-professional .cv-header {
  margin-bottom: 24px;
}

.template-professional .cv-name {
  font-size: 32px;
  font-weight: 700;
  color: var(--t-navy);
  letter-spacing: -.3px;
  margin: 0;
}

.template-professional .cv-headline {
  font-size: 14px;
  color: var(--t-sub);
  font-style: italic;
  margin-top: 5px;
}

.template-professional .cv-contact-items {
  margin-top: 12px;
  border-top: 2px solid var(--t-navy);
  border-bottom: 1px solid var(--t-rule);
  padding: 8px 0;
}

.template-professional .cv-contact-item {
  font-size: 12.5px;
  color: var(--t-sub);
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.template-professional .cv-section {
  margin-top: 24px;
}

.template-professional .cv-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--t-navy);
  border-left: 4px solid var(--t-navy);
  padding-left: 10px;
  margin-bottom: 14px;
  letter-spacing: .2px;
}

.template-professional .cv-entry {
  margin-bottom: 16px;
}

.template-professional .cv-job-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--t-body);
}

.template-professional .cv-job-company {
  color: var(--t-navy);
  font-weight: 700;
}

.template-professional .cv-job-dates {
  color: var(--t-sub);
  font-size: 12.5px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-style: italic;
}

.template-professional .cv-job-desc {
  color: var(--t-sub);
  font-size: 13px;
  margin-top: 6px;
}

.template-professional .cv-summary-text {
  color: var(--t-sub);
  font-style: italic;
  border-left: 3px solid var(--t-rule);
  padding-left: 12px;
}


/* ============================================================
   8. TEMPLATE 3 — MODERNE
   ============================================================ */

/*
   Design : barre d'en-tête colorée (cyan/teal), sans-serif clean,
   titres de section soulignés de couleur.
   HTML linéaire — visuellement moderne mais ATS-compatible.
*/

.template-modern {
  --cv-primary:    #0891b2;
  --cv-secondary:  #0e7490;
  --t-teal:        var(--cv-primary);
  --t-teal-dark:   var(--cv-secondary);
  --t-body:        #1e293b;
  --t-sub:         #64748b;

  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--t-body);
  line-height: 1.6;
  font-size: 13.5px;
  padding: 0;
}

.template-modern .cv-header {
  background: var(--t-teal);
  color: white;
  padding: 36px 48px 28px;
}

.template-modern .cv-name {
  font-size: 30px;
  font-weight: 700;
  color: white;
  margin: 0;
  letter-spacing: -.3px;
}

.template-modern .cv-headline {
  font-size: 14px;
  color: rgba(255,255,255,.85);
  margin-top: 5px;
}

.template-modern .cv-contact-items {
  margin-top: 12px;
  gap: 4px 18px;
}

.template-modern .cv-contact-item {
  font-size: 12.5px;
  color: rgba(255,255,255,.9);
}

/* Corps du CV après l'en-tête */
.template-modern .cv-body {
  padding: 28px 48px 40px;
}

.template-modern .cv-section {
  margin-top: 22px;
}

.template-modern .cv-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--t-teal);
  border-bottom: 2px solid var(--t-teal);
  padding-bottom: 5px;
  margin-bottom: 14px;
}

.template-modern .cv-entry {
  margin-bottom: 16px;
}

.template-modern .cv-job-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--t-body);
}

.template-modern .cv-job-company {
  color: var(--t-teal-dark);
  font-weight: 600;
}

.template-modern .cv-job-dates {
  color: var(--t-sub);
  font-size: 12.5px;
}

.template-modern .cv-job-desc {
  color: var(--t-sub);
  margin-top: 5px;
  font-size: 13px;
}

.template-modern .cv-summary-text {
  color: var(--t-sub);
  font-size: 13.5px;
}


/* ============================================================
   9. TEMPLATE 4 — ÉLÉGANT
   ============================================================ */

/*
   Design : centré, serif (Georgia), accents or/taupe,
   en-tête centré, espacements généreux, raffinement.
*/

.template-elegant {
  --cv-primary:    #8b6914;
  --cv-secondary:  #c4a35a;
  --t-dark:        #2c1810;
  --t-gold:        var(--cv-primary);
  --t-gold-light:  var(--cv-secondary);
  --t-body:        #3d2b1f;
  --t-sub:         #7c6050;

  font-family: Georgia, 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  color: var(--t-body);
  padding: 56px 60px;
  line-height: 1.65;
  font-size: 13.5px;
}

.template-elegant .cv-header {
  text-align: center;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--t-gold-light);
}

.template-elegant .cv-name {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--t-dark);
  margin: 0;
}

.template-elegant .cv-headline {
  font-size: 14px;
  color: var(--t-gold);
  font-style: italic;
  margin-top: 6px;
  letter-spacing: .5px;
}

.template-elegant .cv-contact-items {
  justify-content: center;
  margin-top: 12px;
  gap: 4px 20px;
}

.template-elegant .cv-contact-item {
  font-size: 12.5px;
  color: var(--t-sub);
  font-style: italic;
}

.template-elegant .cv-section {
  margin-top: 26px;
}

.template-elegant .cv-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--t-gold);
  text-align: center;
  font-style: italic;
  letter-spacing: 1px;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--t-gold-light);
}

.template-elegant .cv-entry {
  margin-bottom: 18px;
}

.template-elegant .cv-job-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--t-dark);
}

.template-elegant .cv-job-company {
  color: var(--t-gold);
  font-weight: 700;
}

.template-elegant .cv-job-dates {
  color: var(--t-sub);
  font-size: 12.5px;
  font-style: italic;
}

.template-elegant .cv-job-desc {
  color: var(--t-sub);
  margin-top: 6px;
  font-size: 13px;
}

.template-elegant .cv-summary-text {
  color: var(--t-sub);
  font-style: italic;
  text-align: center;
}


/* ============================================================
   10. TEMPLATE 5 — COMPACT ATS
   ============================================================ */

/*
   Design : noir pur sur blanc, Arial, densité maximale,
   aucun élément décoratif, parsing ATS optimal.
   Conçu pour être le plus compatible possible avec tous les ATS.
*/

.template-compact {
  --cv-primary:    #000000;
  --cv-secondary:  #333333;

  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  background: #fff;
  padding: 22px 28px;
  font-size: 12px;
  line-height: 1.45;
}

.template-compact .cv-header {
  margin-bottom: 8px;
}

.template-compact .cv-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--cv-primary);
  margin: 0;
  letter-spacing: 0;
}

.template-compact .cv-headline {
  font-size: 12px;
  color: var(--cv-secondary);
  margin-top: 2px;
  font-weight: 600;
}

.template-compact .cv-contact-items {
  margin-top: 5px;
  gap: 2px 12px;
}

.template-compact .cv-contact-item {
  font-size: 11.5px;
  color: var(--cv-secondary);
}

.template-compact .cv-section {
  margin-top: 10px;
}

.template-compact .cv-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cv-primary);
  border-bottom: 1px solid var(--cv-primary);
  padding-bottom: 1px;
  margin-bottom: 6px;
  letter-spacing: .3px;
}

.template-compact .cv-entry {
  margin-bottom: 8px;
}

.template-compact .cv-job-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--cv-primary);
}

.template-compact .cv-job-company {
  font-weight: 700;
  color: var(--cv-primary);
}

.template-compact .cv-job-dates {
  font-size: 11.5px;
  color: var(--cv-secondary);
}

.template-compact .cv-job-desc {
  font-size: 11.5px;
  color: #333;
  margin-top: 3px;
}

.template-compact .cv-job-desc ul {
  padding-left: 14px;
}

.template-compact .cv-summary-text {
  font-size: 12px;
  color: #333;
}


/* ============================================================
   11. TEMPLATE 6 — TECHNIQUE
   ============================================================ */

/*
   Design : accentuation bleue tech, typographie monospace pour
   les en-têtes, fond léger gris-bleuté, look développeur/data.
   Reste ATS-compatible (fond clair, texte noir).
*/

.template-technical {
  --cv-primary:    #2563eb;
  --cv-secondary:  #1e3a8a;
  --t-blue:        var(--cv-primary);
  --t-blue-dark:   var(--cv-secondary);
  --t-blue-light:  #eff6ff;
  --t-body:        #1e293b;
  --t-sub:         #475569;
  --t-rule:        #bfdbfe;

  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--t-body);
  background: #f8fafc;
  padding: 0;
  line-height: 1.6;
  font-size: 13.5px;
}

.template-technical .cv-header {
  background: white;
  border-left: 5px solid var(--t-blue);
  padding: 32px 48px;
  border-bottom: 1px solid var(--t-rule);
}

.template-technical .cv-name {
  font-size: 27px;
  font-weight: 700;
  color: var(--t-blue-dark);
  font-family: 'Courier New', Consolas, 'Lucida Console', monospace;
  letter-spacing: -.5px;
  margin: 0;
}

.template-technical .cv-headline {
  font-size: 13px;
  color: var(--t-sub);
  margin-top: 4px;
  font-family: 'Courier New', Consolas, monospace;
  letter-spacing: .5px;
}

.template-technical .cv-contact-items {
  margin-top: 12px;
  gap: 4px 16px;
}

.template-technical .cv-contact-item {
  font-size: 12px;
  color: var(--t-sub);
  font-family: 'Courier New', Consolas, monospace;
}

.template-technical .cv-body {
  padding: 28px 48px 40px;
}

.template-technical .cv-section {
  margin-top: 22px;
}

.template-technical .cv-section-title {
  font-size: 12px;
  font-weight: 700;
  font-family: 'Courier New', Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--t-blue);
  background: var(--t-blue-light);
  border-left: 3px solid var(--t-blue);
  padding: 4px 10px;
  margin-bottom: 14px;
}

.template-technical .cv-entry {
  margin-bottom: 16px;
}

.template-technical .cv-job-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--t-body);
}

.template-technical .cv-job-company {
  color: var(--t-blue);
  font-weight: 700;
  font-family: 'Courier New', Consolas, monospace;
  font-size: .95em;
}

.template-technical .cv-job-dates {
  color: var(--t-sub);
  font-size: 12px;
  font-family: 'Courier New', Consolas, monospace;
}

.template-technical .cv-job-desc {
  color: var(--t-sub);
  margin-top: 5px;
  font-size: 13px;
}

.template-technical .cv-summary-text {
  color: var(--t-sub);
  font-size: 13.5px;
}

.template-technical .cv-skill-category {
  color: var(--t-blue-dark);
  font-family: 'Courier New', Consolas, monospace;
}


/* ============================================================
   13. MODAL FEEDBACK AVANT IMPRESSION
   ============================================================ */

body.modal-open { overflow: hidden; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: white;
  border-radius: 18px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  transform: translateY(18px) scale(.98);
  transition: transform .22s ease;
}

.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-icon {
  font-size: 32px;
  margin-bottom: 10px;
  line-height: 1;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}

.modal-subtitle {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.modal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.modal-label .required {
  color: #ef4444;
  margin-left: 2px;
}

/* ── Star rating ── */
.star-rating {
  display: flex;
  gap: 4px;
}

.star {
  font-size: 34px;
  color: #d1d5db;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 3px;
  line-height: 1;
  transition: color .1s, transform .1s;
}

.star:hover,
.star.active {
  color: #f59e0b;
}

.star:hover { transform: scale(1.15); }

.star-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #f59e0b;
  min-height: 18px;
  margin-top: 5px;
}

/* ── Modal form fields ── */
.modal-box .form-group {
  margin-bottom: 18px;
}

.modal-box textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
  transition: border-color .15s;
  box-sizing: border-box;
  color: #1e293b;
}

.modal-box textarea:focus {
  outline: none;
  border-color: var(--btn-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.feedback-error {
  font-size: 13px;
  font-weight: 600;
  color: #ef4444;
  margin-bottom: 14px;
  min-height: 18px;
}

.modal-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  font-size: 14px;
  border-radius: 10px;
}


/* ============================================================
   13b. TOAST / FEEDBACK
   ============================================================ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e293b;
  color: white;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ============================================================
   14. IMPRESSION — @media print
   ============================================================ */

/*
   @page supprime les marges que le navigateur ajoute par défaut
   autour de la feuille (header/footer de navigation, marges papier).
   Sans ça, le navigateur ajoute ~12-15 mm de chaque côté, ce qui
   rétrécit le contenu et change les proportions par rapport à l'aperçu.
*/
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  /* Masquer toute l'interface — on n'imprime que le CV */
  .form-panel,
  .preview-toolbar,
  .preview-scroll > *:not(.cv-preview),
  .toast,
  .modal-overlay {
    display: none !important;
  }

  /* Supprimer les marges html/body héritées */
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    height: auto !important;
  }

  /* Réinitialiser le layout à un flux normal */
  .app {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .preview-panel {
    display: block !important;
    overflow: visible !important;
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .preview-scroll {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    align-items: unset !important;
  }

  /*
     Largeur exacte A4 (210 mm = 794 px à 96 dpi).
     On ne touche PAS aux polices ni aux paddings internes —
     les styles de chaque template s'appliquent tels quels,
     ce qui garantit un résultat identique à l'aperçu écran.
  */
  .cv-preview {
    width: 210mm !important;
    min-height: 297mm !important;
    box-shadow: none !important;
    margin: 0 !important;
  }

  /* Préserver les couleurs et fonds lors de l'impression */
  .cv-preview,
  .cv-preview * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
