:root {
  --navy: #0B1A33;
  --navy-soft: #142445;
  --white: #FFFFFF;
  --paper: #FDFCFA;
  --paper-shadow: #EFE9DA;
  --text-dark: #1A2233;
  --text-muted: #5B6478;
  --gold: #C6A15B;
  --gold-light: #DCC894;
  --line: #0B1A331a;
  --font-display: 'Fraunces', serif;
  --font-serif: 'Source Serif 4', serif;
  --font-ui: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--navy);
  font-family: var(--font-ui);
  color: var(--text-dark);
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid #ffffff14;
  min-height: 40px;
}
.topbar-logo { height: 52px; width: auto; display: block; }
.examples-nav-link {
  color: var(--gold-light);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #ffffff26;
  padding: 8px 14px;
  border-radius: 20px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.examples-nav-link:hover { border-color: var(--gold); background: #ffffff0d; }

/* LAYOUT */
.app {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 48px;
  padding: 40px;
  align-items: start;
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; padding: 20px; gap: 28px; }
  .form-panel { position: static; }
}

/* FORM PANEL */
.form-panel {
  background: var(--navy-soft);
  border: 1px solid #ffffff14;
  border-radius: 6px;
  padding: 32px;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.completion-wrap {
  position: sticky;
  top: -32px;
  margin: -32px -32px 24px;
  padding: 14px 32px 10px;
  background: var(--navy-soft);
  z-index: 4;
  border-bottom: 1px solid #ffffff14;
}
.completion-track {
  height: 5px;
  background: #ffffff1a;
  border-radius: 4px;
  overflow: hidden;
}
.completion-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--gold), var(--gold-light));
  border-radius: 4px;
  transition: width 0.4s ease;
}
.completion-label {
  display: block;
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: #9AA2B4;
  text-align: right;
}

.confetti-zone {
  position: relative;
  height: 0;
  overflow: visible;
}
.confetti-piece {
  position: absolute;
  top: 0;
  width: 7px;
  height: 12px;
  opacity: 0.95;
  animation: confetti-fall 1.1s ease-in forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(90px) rotate(540deg); opacity: 0; }
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin: 28px 0 10px;
  border-top: 1px solid #ffffff1a;
  padding-top: 18px;
}
.eyebrow:first-child { margin-top: 0; border-top: none; padding-top: 0; }

/* PHOTO UPLOAD */
.photo-upload { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.photo-circle {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 1.5px dashed var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  background: #ffffff0d;
  cursor: pointer; padding: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.photo-circle:hover { border-color: var(--gold); background: #ffffff14; }
.photo-circle img { width: 100%; height: 100%; object-fit: cover; }
#photo-placeholder { font-size: 22px; opacity: 0.8; }
.photo-remove {
  position: absolute; top: -2px; right: -2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--navy); border: 1px solid var(--gold);
  color: var(--gold-light); font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.photo-caption { font-size: 12.5px; color: #A9B0C0; }

label {
  display: block; font-size: 13px; color: #E9ECF3;
  margin-bottom: 6px; margin-top: 14px;
}
label .hint { display: block; font-size: 11px; color: #9AA2B4; font-weight: 400; margin-top: 2px; }

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

.rich-field { position: relative; }
.bold-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #ffffff33;
  background: #142445;
  color: #E9ECF3;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}
.bold-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.bold-btn.active { background: var(--gold); border-color: var(--gold); color: var(--navy); }

.field-warning {
  font-size: 11.5px;
  color: #E4A85B;
  margin: 6px 0 0;
  line-height: 1.4;
}
.field-warning:empty { display: none; }

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #C9CFDC;
  margin-top: 14px;
  line-height: 1.5;
}
.consent-label input { width: auto; margin-top: 2px; flex-shrink: 0; }
.consent-label a { color: var(--gold-light); }

input, textarea {
  width: 100%;
  background: #ffffff0d;
  border: 1px solid #ffffff26;
  border-radius: 5px;
  padding: 10px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--white);
  resize: vertical;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input::placeholder, textarea::placeholder { color: #8992A6; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #ffffff14;
  box-shadow: 0 0 0 3px #C6A15B26;
}

/* CONTROLES DE PERSONNALISATION */
.seg-control {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.seg-btn {
  flex: 1;
  background: #ffffff0d;
  border: 1px solid #ffffff26;
  color: #C9CFDC;
  font-family: var(--font-ui);
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg-btn:hover { border-color: #ffffff4d; }
.seg-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  font-weight: 600;
}

.swatch-row { display: flex; gap: 10px; margin-top: 8px; }
.swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: var(--white); box-shadow: 0 0 0 2px var(--gold); }

/* PAIEMENT */
.paypal-container { margin-top: 20px; min-height: 45px; }

.price-line { margin-top: 14px; text-align: center; }
.price-line strong { display: block; font-family: var(--font-display); font-size: 18px; color: var(--white); }
.price-line span { display: block; font-size: 11.5px; color: var(--gold-light); letter-spacing: 0.04em; margin-top: 2px; }

.payment-status {
  margin-top: 10px;
  font-size: 12.5px;
  text-align: center;
  color: var(--gold-light);
  min-height: 16px;
  border-radius: 5px;
  padding: 0;
  transition: background 0.2s ease, padding 0.2s ease;
}
.payment-status.error {
  color: #FBDADA;
  background: #7A2E2E;
  padding: 10px 12px;
  animation: pulse-alert 0.5s ease;
}
.payment-status.success {
  color: #DFF6E4;
  background: #24593A;
  padding: 10px 12px;
}
@keyframes pulse-alert {
  0% { box-shadow: 0 0 0 0 #E4898966; }
  100% { box-shadow: 0 0 0 8px #E4898900; }
}

.trust-badge {
  margin-top: 10px;
  font-size: 11px;
  text-align: center;
  color: #8992A6;
  line-height: 1.4;
}

.reset-link {
  display: block;
  margin: 24px auto 0;
  background: none;
  border: none;
  color: #6C7488;
  font-size: 11.5px;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}
.reset-link:hover { color: #A9B0C0; }

/* PREVIEW PANEL */
.preview-panel { display: flex; justify-content: center; }
.cv-wrapper { position: relative; width: 100%; max-width: 720px; }

.cv {
  background: var(--paper);
  width: 100%;
  min-height: 900px;
  box-shadow: 0 40px 80px -24px #00000080, 0 4px 16px -4px #0000004d, 0 0 0 1px var(--paper-shadow);
  border-radius: 3px;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--side-w, 250px) 1fr;
}
.cv[data-width="narrow"] { --side-w: 195px; }
.cv[data-width="medium"] { --side-w: 250px; }
.cv[data-width="wide"]   { --side-w: 300px; }

.cv[data-sidebar="right"] { grid-template-columns: 1fr var(--side-w, 250px); }
.cv[data-sidebar="right"] .cv-sidebar { order: 2; }
.cv[data-sidebar="right"] .cv-main { order: 1; }

@media (max-width: 900px) {
  .cv { grid-template-columns: 1fr; }
  .cv[data-sidebar="right"] { grid-template-columns: 1fr; }
  .cv[data-sidebar="right"] .cv-sidebar { order: 1; }
  .cv[data-sidebar="right"] .cv-main { order: 2; }
}

/* Thèmes de couleur : chaque thème définit un fond de bandeau + une couleur d'accent */
.cv[data-theme="gold"]     { --side-bg: #17202E; --accent: #C6A15B; --side-text: #E9ECF3; --side-muted: #A9B0C0; }
.cv[data-theme="teal"]     { --side-bg: #0E5E58; --accent: #8FE6DB; --side-text: #EAFBF8; --side-muted: #BFE9E3; }
.cv[data-theme="navy"]     { --side-bg: #16324B; --accent: #6FC1F0; --side-text: #EAF3FB; --side-muted: #B9CEE0; }
.cv[data-theme="bordeaux"] { --side-bg: #551B2B; --accent: #E2A6B4; --side-text: #FBEAEE; --side-muted: #F3DCE1; }
.cv[data-theme="emeraude"] { --side-bg: #123C29; --accent: #7ED9A6; --side-text: #E9FBF1; --side-muted: #B9E0C9; }
.cv[data-theme="anthracite"] { --side-bg: #2B2F36; --accent: #B8C4D0; --side-text: #EDEFF2; --side-muted: #C6CCD3; }
.cv[data-theme="prune"] { --side-bg: #3B1F3D; --accent: #D9A8E0; --side-text: #F5E9F7; --side-muted: #E0BFE6; }
.cv[data-theme="ocre"] { --side-bg: #5C3A21; --accent: #E8B978; --side-text: #FBEFE1; --side-muted: #EACCA4; }

/* Taille de texte : multiplicateur appliqué aux tailles du corps du CV */
.cv[data-font-size="s"] { --fs: 0.88; }
.cv[data-font-size="m"] { --fs: 1; }
.cv[data-font-size="l"] { --fs: 1.16; }

/* Couleur du texte principal (contenu, hors accents de thème) */
.cv[data-text-color="anthracite"] { --body-text: #1A2233; }
.cv[data-text-color="marine"]     { --body-text: #0B1A33; }
.cv[data-text-color="brun"]       { --body-text: #3B2A1F; }
.cv[data-text-color="noir"]       { --body-text: #000000; }
.cv[data-text-color="ardoise"]    { --body-text: #44494F; }
.cv[data-text-color="foret"]      { --body-text: #1F3B2C; }
.cv[data-text-color="petrole"]    { --body-text: #0F3F44; }

/* Calque flouté "verre dépoli" : le CV en dessous n'est jamais modifié,
   ce qui garantit un export PDF toujours net (l'overlay n'est pas capturé). */
.blur-overlay {
  position: absolute; inset: 0;
  border-radius: 3px;
  background: rgba(253, 252, 250, 0.18);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; text-align: center;
  transition: opacity 0.25s ease;
}
.blur-overlay.unlocked { opacity: 0; pointer-events: none; }
.blur-overlay .lock {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  color: var(--navy);
  background: var(--white);
  padding: 13px 22px;
  border-radius: 30px;
  box-shadow: 0 12px 32px -8px #00000050, 0 0 0 1px #0B1A3312;
  max-width: 82%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ===== SIDEBAR (bandeau) ===== */
.cv-sidebar {
  background: var(--side-bg, #17202E);
  color: var(--side-text, #E9ECF3);
  padding: 40px 26px;
}
@media (max-width: 900px) { .cv-sidebar { padding: 28px 22px; } }

.sidebar-photo-wrap { display: flex; justify-content: center; margin-bottom: 18px; }
.p-photo {
  width: 104px; height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent, #C6A15B);
}

.sidebar-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  text-align: center;
  margin: 0;
  color: #fff;
  line-height: 1.2;
}
.sidebar-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  text-align: center;
  color: var(--accent, #C6A15B);
  margin: 6px 0 0;
}

.sidebar-block { margin-top: 28px; }
.sidebar-block:empty,
.sidebar-block.is-empty { display: none; }
.sidebar-block h2 {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent, #C6A15B);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.contact-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.contact-list li {
  font-size: calc(12px * var(--fs, 1));
  color: var(--side-text, #E9ECF3);
  display: flex; align-items: flex-start; gap: 8px;
  line-height: 1.4;
}
.contact-list .ico { flex-shrink: 0; opacity: 0.9; }

/* Compétences — étiquettes (mode clair sur fond foncé) */
.cv-sidebar .skills-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-sidebar .skill-tag {
  font-size: calc(11px * var(--fs, 1));
  padding: 4px 10px;
  border: 1px solid var(--accent, #C6A15B);
  border-radius: 20px;
  color: var(--side-text, #E9ECF3);
}

/* Compétences — barres */
.skill-bar-item { margin-bottom: 11px; }
.skill-bar-item:last-child { margin-bottom: 0; }
.skill-bar-name { font-size: calc(11.5px * var(--fs, 1)); margin-bottom: 5px; color: var(--side-text, #E9ECF3); }
.skill-bar-track { height: 5px; background: rgba(255,255,255,0.18); border-radius: 4px; overflow: hidden; }
.skill-bar-fill { height: 100%; background: var(--accent, #C6A15B); border-radius: 4px; }

/* Langues */
.lang-row { display: flex; justify-content: space-between; font-size: calc(12.5px * var(--fs, 1)); margin-bottom: 8px; }
.lang-row:last-child { margin-bottom: 0; }
.lang-row .lvl { color: var(--side-muted, #A9B0C0); font-style: italic; }

/* Points forts */
.highlight-item { margin-bottom: 14px; display: flex; gap: 9px; }
.highlight-item:last-child { margin-bottom: 0; }
.highlight-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent, #C6A15B);
  margin-top: 6px; flex-shrink: 0;
}
.highlight-title { font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; color: #fff; margin: 0 0 3px; }
.highlight-desc { font-size: calc(11.5px * var(--fs, 1)); line-height: 1.5; color: var(--side-muted, #A9B0C0); margin: 0; }

/* Certifications */
.cert-item { margin-bottom: 12px; }
.cert-item:last-child { margin-bottom: 0; }
.cert-name { font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; color: #fff; }
.cert-meta { font-size: calc(11px * var(--fs, 1)); color: var(--side-muted, #A9B0C0); margin-top: 2px; }

/* Loisirs */
.hobbies-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.hobbies-list li {
  font-size: calc(12px * var(--fs, 1)); color: var(--side-text, #E9ECF3);
  padding-left: 14px; position: relative;
}
.hobbies-list li::before {
  content: '';
  position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent, #C6A15B);
}

/* ===== MAIN (contenu principal) ===== */
.cv-main { padding: 48px 44px; }
@media (max-width: 900px) { .cv-main { padding: 30px 24px; } }

.cv-main .cv-section { margin-top: 26px; }
.cv-main .cv-section:first-child { margin-top: 0; }

.cv-main .cv-section h2 {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent, #C6A15B);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.cv-main .cv-section:empty,
.cv-main .cv-section.is-empty { display: none; }

.cv-main .cv-section p {
  font-family: var(--font-serif);
  font-size: calc(14px * var(--fs, 1));
  line-height: 1.6;
  color: var(--body-text, var(--text-dark));
  margin: 0;
}

.exp-item, .edu-item { margin-bottom: 16px; }
.exp-item:last-child, .edu-item:last-child { margin-bottom: 0; }

.exp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.exp-role { font-family: var(--font-serif); font-weight: 600; font-size: calc(14.5px * var(--fs, 1)); color: var(--body-text, var(--text-dark)); }
.exp-company { font-family: var(--font-serif); font-style: italic; font-size: calc(13px * var(--fs, 1)); color: var(--text-muted); }
.exp-dates { font-family: var(--font-ui); font-size: calc(10.5px * var(--fs, 1)); letter-spacing: 0.05em; color: var(--text-muted); white-space: nowrap; }
.exp-desc { font-family: var(--font-serif); font-size: calc(13px * var(--fs, 1)); line-height: 1.55; color: var(--body-text, var(--text-dark)); margin-top: 4px; }

/* FOOTER */
.site-footer { padding: 30px 40px 50px; text-align: center; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-bottom: 12px; }
.legal-nav a { color: #A9B0C0; font-size: 12px; text-decoration: none; letter-spacing: 0.02em; }
.legal-nav a:hover { color: var(--gold-light); }
.footer-copy { color: #6C7488; font-size: 11.5px; margin: 0; }
