/* cv.css — générateur de CV (Studio Simple). S'appuie sur ../css/style.css. */
/* Polices libres (SIL OFL 1.1) embarquées : mêmes fichiers dans l'aperçu et dans le PDF. */
@font-face { font-family: CVSans; src: url("polices/InstrumentSans-Regular.ttf"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: CVSans; src: url("polices/InstrumentSans-Bold.ttf"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: CVSans; src: url("polices/InstrumentSans-Italic.ttf"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: CVSans; src: url("polices/InstrumentSans-BoldItalic.ttf"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: CVSerif; src: url("polices/Lora-Regular.ttf"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: CVSerif; src: url("polices/Lora-Bold.ttf"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: CVSerif; src: url("polices/Lora-Italic.ttf"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: CVSerif; src: url("polices/Lora-BoldItalic.ttf"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: CVDisp; src: url("polices/Outfit-Regular.ttf"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: CVDisp; src: url("polices/Outfit-Bold.ttf"); font-weight: 700; font-style: normal; font-display: swap; }
.cv-svg text { font-kerning: none; font-variant-ligatures: none; text-rendering: geometricPrecision; }
.gen { padding-bottom: 2rem; }
.gen-intro { max-width: 46rem; }
.gen-progres { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 1rem 0 1.2rem; counter-reset: e; }
.gen-progres li { counter-increment: e; font-size: .85rem; padding: .25rem .6rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--bordure); color: var(--texte-doux); }
.gen-progres li::before { content: counter(e) ". "; }
.gen-progres li.actif { background: var(--bleu); border-color: var(--bleu); color: #fff; font-weight: 600; }
.gen-progres li.fait { background: var(--bleu-pale); color: var(--bleu-fonce); }

#gen label { display: block; margin: .5rem 0; font-weight: 600; font-size: .95rem; }
#gen input:not([type=checkbox]):not([type=radio]), #gen select, #gen textarea {
  display: block; width: 100%; box-sizing: border-box; margin-top: .25rem; padding: .5rem .6rem;
  font: inherit; font-weight: 400; border: 1px solid var(--bordure-form); border-radius: 6px; background: #fff; color: var(--texte);
}
#gen fieldset { border: 1px solid var(--bordure); border-radius: 8px; padding: .6rem .9rem .8rem; margin: .9rem 0; background: var(--surface); }
#gen legend { font-weight: 700; padding: 0 .3rem; }
.champs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .champs2 { grid-template-columns: 1fr; } }
.aide { color: var(--texte-doux); font-size: .92rem; }
.sous { margin: .8rem 0 .3rem; font-weight: 600; }

.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .3rem .8rem; }
#gen label.case { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; margin: .2rem 0; cursor: pointer; }
#gen label.case input[type=checkbox] { width: 1.15rem; height: 1.15rem; margin-top: .15rem; flex: none; accent-color: var(--bleu); }
.badge { font-style: normal; font-size: .72rem; background: var(--jaune); color: #23211e; padding: 0 .4rem; border-radius: 4px; white-space: nowrap; align-self: center; }

.puces { display: grid; gap: .15rem; }
#gen label.puce { padding: .35rem .5rem; border-radius: 6px; border: 1px solid transparent; }
#gen label.puce.active { background: var(--bleu-pale); border-color: #c5d0e6; }
#gen label.puce input.nombre { display: inline-block; width: 4.2rem; margin: 0 .25rem; padding: .1rem .3rem; text-align: center; }
.dates { display: flex; gap: .4rem; align-items: center; margin: .5rem 0; flex-wrap: wrap; }
.dates span { font-weight: 600; min-width: 2.6rem; }
#gen .dates select { width: auto; flex: 1; margin-top: 0; }
.ligne-langue { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
#gen .ligne-langue select { margin-top: 0; }
.actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
button.lien { background: none; border: 0; padding: 0; color: var(--bleu); text-decoration: underline; cursor: pointer; font: inherit; }
button.lien.danger { color: #9b2c1f; }

.gen-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.2rem; }
.gen-nav [hidden] { display: none; }
#suiv { margin-left: auto; }
.erreur { background: var(--attention-fond); border-left: 4px solid var(--attention-bord); padding: .6rem .8rem; }

/* ---------- Choix du modèle : vignettes de VOTRE CV ---------- */
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.vignettes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; margin: .6rem 0 1rem; }
@media (max-width: 900px) { .vignettes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .vignettes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } }
#gen label.vignette { position: relative; display: flex; flex-direction: column; gap: .15rem; margin: 0; padding: .45rem; border: 2px solid var(--bordure); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 400; transition: border-color .15s, box-shadow .15s, transform .15s; }
#gen label.vignette:hover { transform: translateY(-2px); box-shadow: var(--ombre); }
#gen label.vignette.choisie { border-color: var(--bleu); box-shadow: 0 0 0 3px var(--bleu-pale); }
#gen label.vignette:focus-within { outline: 3px solid var(--bleu); outline-offset: 2px; }
.v-img { display: block; aspect-ratio: 612 / 792; overflow: hidden; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.15); pointer-events: none; }
.v-img svg { display: block; width: 100%; height: 100%; }
.v-nom { font-weight: 700; font-size: .92rem; margin-top: .3rem; }
.v-desc { font-size: .78rem; color: var(--texte-doux); line-height: 1.25; }
.choix-couleur { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1rem; }
.choix-titre { font-weight: 700; }
.palettes { display: flex; flex-wrap: wrap; gap: .4rem; }
#gen label.palette { display: flex; align-items: center; gap: .35rem; margin: 0; padding: .3rem .65rem .3rem .35rem; border: 2px solid var(--bordure); border-radius: 99px; background: #fff; font-weight: 400; font-size: .88rem; cursor: pointer; }
#gen label.palette.choisie { border-color: var(--bleu); font-weight: 600; }
#gen label.palette:focus-within { outline: 3px solid var(--bleu); outline-offset: 2px; }
.pastille { width: 1.3rem; height: 1.3rem; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
#gen fieldset.profils { background: #fff; }
#gen label.profil-choix { padding: .5rem .6rem; border: 1px solid var(--bordure); border-radius: 8px; margin: .35rem 0; line-height: 1.45; }
#gen label.profil-choix.choisi { border-color: var(--bleu); background: var(--bleu-pale); }

/* ---------- Aperçu protégé ---------- */
.apercu-cadre { position: relative; overflow: hidden; max-width: 900px; margin: 0 auto; padding: 14px; border-radius: 10px; background: #dfe3e8;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.apercu-page .cv-svg { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 4px 18px rgba(20, 30, 50, .18); }
.apercu-page .cv-svg + .cv-svg { margin-top: 14px; }
@media (max-width: 480px) { .apercu-cadre { padding: 6px; margin: 0 -8px; } }
.filigrane { position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='190'%3E%3Ctext x='150' y='105' text-anchor='middle' transform='rotate(-30 150 95)' font-family='Arial' font-size='19' font-weight='700' fill='rgba(31,58,107,0.17)'%3EAPERÇU — STUDIO SIMPLE%3C/text%3E%3C/svg%3E");
  background-size: 210px 133px; display: flex; align-items: center; justify-content: center; }
.filigrane span { transform: rotate(-30deg); font: 800 clamp(1.6rem, 7vw, 4.2rem)/1 Arial, sans-serif; color: rgba(155, 44, 31, .2); white-space: nowrap; letter-spacing: .05em; }

/* ---------- Commande ---------- */
.commande-cv [hidden], .commande-cv[hidden] { display: none !important; }
.commande-cv { margin-top: 1.5rem; padding: 1rem 1.2rem; border: 2px solid var(--bleu); border-radius: 10px; background: var(--surface); }
.consentement { display: flex; gap: .6rem; align-items: flex-start; margin: .8rem 0; font-size: .92rem; }
.consentement input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; flex: none; }
.ref { font-family: Consolas, "Courier New", monospace; background: var(--bleu-pale); padding: 0 .35rem; border-radius: 4px; }
.statut { font-weight: 600; }
.ok { font-weight: 700; color: #1d6b38; }
#bloc-telecharger .btn, #bloc-telecharger .btn-contour { margin: .3rem .4rem .3rem 0; }
.gen-bas { margin-top: 1.5rem; font-size: .9rem; }

/* Impression : jamais l'aperçu */
@media print {
  .apercu-cadre, .gen, .entete, .pied { display: none !important; }
  body::after { content: "Impression désactivée : téléchargez votre CV après le paiement."; display: block; padding: 2rem; font: 16px Arial; }
}
