/* scrut.fr — créateur de CV et de lettre de motivation */

.builder [hidden] { display: none !important; }

.builder-head { background: var(--soft); border-bottom: 1px solid var(--line); padding-block: 22px 24px; }
.builder-head__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-top: 10px; }
.builder-head h1 { margin: 0 0 4px; }
.builder-head p { margin: 0; color: var(--muted); }
.builder-actions { display: flex; gap: 10px; }
.builder-tabs { display: none; }

.builder-grid { display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 1fr); gap: 32px; padding-block: 26px 60px; align-items: start; }

/* ---------- Formulaire ---------- */
.builder-form { display: flex; flex-direction: column; gap: 12px; }
.builder-progress { position: relative; height: 34px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.builder-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--blue-100), color-mix(in srgb, var(--brand) 22%, white)); transition: width .4s; }
.builder-progress span { position: relative; display: block; text-align: center; line-height: 32px; font-weight: 700; font-size: 13px; color: var(--navy); }

.bsec { background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.bsec__head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px 18px; background: none; border: 0; cursor: pointer; font-weight: 750; font-size: 15.5px; color: var(--navy); text-align: left; }
.bsec__head::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); transition: transform .2s; }
.bsec.is-open .bsec__head::after { transform: rotate(-135deg); }
.bsec__num { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-50); color: var(--brand); font-size: 13px; font-weight: 800; flex: none; }
.bsec.is-open .bsec__num { background: var(--brand); color: #fff; }
.bsec__body { display: none; padding: 4px 18px 18px; }
.bsec.is-open .bsec__body { display: block; }

.builder-form .f { margin: 0 0 12px; }
.builder-form label { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin-bottom: 5px; }
.builder-form input, .builder-form select, .builder-form textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-size: 15px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.builder-form textarea { resize: vertical; line-height: 1.5; }
.builder-form input:focus, .builder-form select:focus, .builder-form textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--blue-100); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
.hint { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--link); font-weight: 650; cursor: pointer; font-size: 14px; }
.btn-link:hover { color: var(--accent); }

.photo-field { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; }
.photo-drop { width: 92px; height: 92px; border-radius: 16px; border: 2px dashed var(--line); display: grid; place-items: center; cursor: pointer; overflow: hidden; background: var(--soft); margin: 0 0 12px !important; }
.photo-drop:hover { border-color: var(--brand); }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.photo-drop span { display: grid; place-items: center; gap: 2px; color: var(--faint); text-align: center; }
.photo-drop svg { width: 24px; height: 24px; }
.photo-drop small { font-size: 11px; line-height: 1.2; }

.item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--soft); }
.item__bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; color: var(--navy); }
.item__bar button, .item--inline button { background: var(--white); border: 1px solid var(--line); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; color: var(--muted); margin-left: 4px; }
.item__bar button:hover, .item--inline button:hover { color: var(--accent); border-color: var(--accent); }
.item--inline { display: grid; grid-template-columns: 1fr 150px 34px; gap: 8px; align-items: center; padding: 8px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); cursor: text; }
.tags input { flex: 1; min-width: 160px; border: 0 !important; box-shadow: none !important; padding: 5px !important; }
.tag-x { display: inline-flex; align-items: center; gap: 4px; background: var(--blue-50); color: var(--navy); border: 1px solid var(--blue-100); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: 13.5px; font-weight: 600; }
.tag-x button { border: 0; background: none; cursor: pointer; color: var(--faint); font-size: 11px; padding: 0 4px; }
.tag-x button:hover { color: var(--accent); }
.suggest-skills { margin-top: 12px; }
.suggest-skills .chip { font-size: 13px; padding: 6px 11px; cursor: pointer; }

.tpl-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-pick button { border: 2px solid var(--line); border-radius: 12px; background: var(--white); padding: 8px 8px 10px; cursor: pointer; font-weight: 650; font-size: 13.5px; color: var(--ink); display: grid; gap: 6px; }
.tpl-pick button.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--blue-100); }
.tp { display: block; height: 70px; border-radius: 6px; background: var(--soft); position: relative; overflow: hidden; }
.tp--moderne::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 34%; background: var(--brand); }
.tp--classique::before { content: ""; position: absolute; left: 10%; right: 10%; top: 12px; height: 8px; border-radius: 3px; background: var(--brand); box-shadow: 0 16px 0 -2px var(--line), 0 28px 0 -2px var(--line), 0 40px 0 -2px var(--line); }
.tp--epure::before { content: ""; position: absolute; left: 10%; width: 45%; top: 12px; height: 7px; border-radius: 3px; background: var(--ink); box-shadow: 0 16px 0 -1px var(--line), 0 28px 0 -1px var(--line), 0 40px 0 -1px var(--line); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches button.is-active { box-shadow: 0 0 0 2px var(--c); }
.builder-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.builder-note svg { width: 18px; height: 18px; color: var(--green); flex: none; }

/* ---------- Aperçu ---------- */
.builder-preview { position: sticky; top: 86px; }
.paper-wrap { position: relative; width: 100%; }
.paper { --cv: #002654; position: absolute; top: 0; left: 0; width: 794px; min-height: 1123px; background: #fff; transform-origin: 0 0; box-shadow: 0 10px 40px rgba(0, 38, 84, .14), 0 0 0 1px var(--line);
	color: #1f2937; font-size: 13.2px; line-height: 1.5; font-family: var(--font); overflow: hidden; }
.builder-preview__help { font-size: 13px; color: var(--faint); text-align: center; margin-top: 14px; }
.cv-hint { color: #9aa3b5; font-style: italic; }

/* Éléments communs du CV */
.paper h1 { font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: -.02em; color: var(--cv); }
.paper h2 { font-size: 15px; font-weight: 600; margin: 6px 0 0; color: #475569; letter-spacing: 0; }
.cv-sec { margin-top: 20px; }
.cv-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--cv); margin: 0 0 10px; font-weight: 800; }
.cv-item { margin-bottom: 12px; break-inside: avoid; }
.cv-item__top { display: flex; justify-content: space-between; gap: 10px; }
.cv-item__top b { color: #111827; font-size: 14px; }
.cv-item__top span { color: #6b7280; font-size: 12px; white-space: nowrap; }
.cv-item__org { color: #475569; font-size: 12.5px; font-weight: 600; }
.cv-item ul { margin: 5px 0 0; padding-left: 16px; }
.cv-item li { margin-bottom: 2px; }
.cv-profil { margin: 16px 0 0; color: #374151; }
.cv-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.cv-tags li { background: color-mix(in srgb, var(--cv) 9%, white); color: color-mix(in srgb, var(--cv) 85%, black); border-radius: 6px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.cv-lang { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; }
.cv-lang span { color: #6b7280; }
.cv-contact { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 12.5px; word-break: break-word; }
.cv-photo { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; }

/* Modèle Moderne : colonne latérale colorée */
.tpl-moderne { display: grid; grid-template-columns: 250px 1fr; }
.tpl-moderne .cv-side { background: var(--cv); color: #fff; padding: 36px 24px; min-height: 1123px; }
.tpl-moderne .cv-side .cv-photo { display: block; margin: 0 auto 6px; border: 4px solid rgba(255, 255, 255, .25); width: 130px; height: 130px; }
.tpl-moderne .cv-side .cv-sec h3 { color: #fff; opacity: .85; border-bottom: 1px solid rgba(255, 255, 255, .25); padding-bottom: 6px; }
.tpl-moderne .cv-side .cv-tags li { background: rgba(255, 255, 255, .14); color: #fff; }
.tpl-moderne .cv-side .cv-lang span { color: rgba(255, 255, 255, .7); }
.tpl-moderne .cv-side p { font-size: 12.5px; }
.tpl-moderne .cv-main { padding: 40px 36px; }
.tpl-moderne .cv-head h1 { font-size: 34px; }
.tpl-moderne .cv-main .cv-sec h3 { display: flex; align-items: center; gap: 10px; }
.tpl-moderne .cv-main .cv-sec h3::after { content: ""; flex: 1; height: 2px; background: color-mix(in srgb, var(--cv) 18%, white); }

/* Modèle Classique */
.tpl-classique { padding: 44px 50px; }
.tpl-classique .cv-head { display: flex; gap: 20px; align-items: center; padding-bottom: 16px; border-bottom: 3px solid var(--cv); }
.tpl-classique .cv-contact-line { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 12px 0 0; font-size: 12.5px; color: #374151; }
.tpl-classique .cv-contact-line i { display: none; }
.tpl-classique .cv-sec h3 { border-bottom: 1px solid #e5e7eb; padding-bottom: 5px; }
.tpl-classique .cv-cols, .tpl-epure .cv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }

/* Modèle Épuré */
.tpl-epure { padding: 56px 60px; }
.tpl-epure .cv-head { display: flex; gap: 22px; align-items: center; }
.tpl-epure .cv-head .cv-photo { width: 90px; height: 90px; }
.tpl-epure h1 { color: #111827; font-weight: 800; font-size: 36px; }
.tpl-epure h2 { color: var(--cv); }
.tpl-epure .cv-contact-line { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 14px 0 0; font-size: 12.5px; color: #6b7280; }
.tpl-epure .cv-contact-line i { display: none; }
.tpl-epure .cv-sec { display: grid; grid-template-columns: 150px 1fr; gap: 20px; margin-top: 26px; }
.tpl-epure .cv-sec h3 { color: #9ca3af; letter-spacing: .14em; padding-top: 2px; }
.tpl-epure .cv-cols { display: block; }

/* Lettre */
.paper--letter { padding: 70px 76px; font-size: 14px; line-height: 1.65; }
.lt-top { display: flex; justify-content: space-between; gap: 30px; margin-bottom: 36px; }
.lt-exp { color: #374151; }
.lt-exp::first-line { font-weight: 800; color: var(--cv); }
.lt-dest { text-align: right; padding-top: 70px; }
.lt-date { text-align: right; color: #4b5563; margin: 0 0 26px; }
.lt-objet { margin: 0 0 22px; border-left: 3px solid var(--cv); padding-left: 10px; }
.lt-objet b { color: var(--cv); }
.paper--letter p { margin: 0 0 14px; text-align: justify; }
.lt-sign { margin-top: 30px !important; text-align: right !important; font-weight: 700; color: #111827; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
	.builder-grid { grid-template-columns: 1fr; }
	.builder-tabs { display: flex; position: sticky; top: 68px; z-index: 30; background: var(--white); border-bottom: 1px solid var(--line); }
	.builder-tabs button { flex: 1; padding: 13px; border: 0; background: none; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
	.builder-tabs button.is-active { color: var(--brand); border-bottom-color: var(--accent); }
	.builder-preview { display: none; position: static; }
	.builder.show-preview .builder-preview { display: block; }
	.builder.show-preview .builder-form { display: none; }
	.builder-actions { width: 100%; }
	.builder-actions .btn { flex: 1; }
}
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } .item--inline { grid-template-columns: 1fr 120px 34px; } }

/* ---------- Impression / PDF ---------- */
@media print {
	@page { size: A4; margin: 0; }
	html { margin-top: 0 !important; }
	html, body { background: #fff !important; }
	.site-header, .site-footer, .builder-head, .builder-tabs, .builder-form, .builder-preview__help, .ad, #wpadminbar, .skip-link { display: none !important; }
	.wrap, .builder-grid { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
	.builder-preview, .builder.show-preview .builder-preview { display: block !important; position: static !important; }
	.paper-wrap { height: auto !important; }
	.paper { position: static !important; transform: none !important; box-shadow: none !important; width: 210mm !important; min-height: 297mm !important; }
	.tpl-moderne .cv-side { min-height: 297mm; }
	* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
