/* ============================================================
   lettre.css — CVFrontalier.ch · Lettre de motivation
   Format A4 · Police Source Sans Pro · Couleur d'accent variable
   Phase 5 — Premium
   ============================================================ */

/* ── Page lettre (A4) ─────────────────────────────────────── */
.lettre-page {
  width: 794px;
  min-height: 1123px;
  background: #ffffff;
  font-family: 'Source Sans Pro', 'Arial', sans-serif;
  font-size: 10.5pt;
  color: #2C2C2C;
  padding: 20mm 22mm 18mm 22mm;
  box-sizing: border-box;
  position: relative;
  line-height: 1.6;
}

/* ── Expéditeur (en-tête haut à droite) ─────────────────── */
.lettre-sender {
  text-align: right;
  font-size: 9.5pt;
  color: #555;
  line-height: 1.55;
  margin-bottom: 7mm;
}

.lettre-sender strong {
  font-size: 12pt;
  font-weight: 700;
  color: var(--cv-accent, #2C2C2C);
  display: block;
  margin-bottom: 2px;
  letter-spacing: 0.01em;
}

/* ── Date ────────────────────────────────────────────────── */
.lettre-date {
  text-align: right;
  font-size: 9.5pt;
  color: #555;
  margin-bottom: 9mm;
}

/* ── Destinataire ────────────────────────────────────────── */
.lettre-recipient {
  font-size: 10pt;
  color: #2C2C2C;
  line-height: 1.55;
  margin-bottom: 7mm;
}

/* ── Objet ───────────────────────────────────────────────── */
.lettre-object {
  font-weight: 700;
  font-size: 10pt;
  color: #2C2C2C;
  margin-bottom: 7mm;
  text-decoration: underline;
}

/* ── Corps ───────────────────────────────────────────────── */
.lettre-body {
  font-size: 10.5pt;
  line-height: 1.7;
  color: #2C2C2C;
  white-space: pre-wrap;
  margin-bottom: 12mm;
}

.lettre-body p {
  margin: 0 0 6mm;
}

/* ── Signature ───────────────────────────────────────────── */
.lettre-signature {
  margin-top: 8mm;
  font-weight: 600;
  font-size: 10.5pt;
  color: #2C2C2C;
}

/* ── Ombre aperçu wizard ─────────────────────────────────── */
#lettrePageWrap {
  box-shadow: 0 2px 16px rgba(0,0,0,.15);
  border-radius: 2px;
}

/* ── UI Étape 8 dans le wizard ───────────────────────────── */
.step-premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff8e1;
  border: 1px solid #f9a825;
  color: #7a5b00;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}

.lettre-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e2db;
}

.form-textarea--lettre {
  min-height: 280px;
  font-family: 'Source Sans Pro', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
}

/* ── Preview title when on lettre step ──────────────────── */
.preview-panel__title--lettre {
  color: #b8960c;
  font-style: italic;
}

/* ══════════════════════════════════════════════════════
   PHASE 6 — UX Premium : barre, sections, checklist
   ══════════════════════════════════════════════════════ */

/* ── Barre de progression ────────────────────────────── */
.lettre-progress {
  margin-bottom: 18px;
}
.lettre-progress__track {
  height: 8px;
  background: #e5e2db;
  border-radius: 4px;
  overflow: hidden;
}
.lettre-progress__fill {
  height: 100%;
  border-radius: 4px;
  background: #cc3333;
  transition: width .4s ease, background .4s ease;
}
.lettre-progress__fill[data-level="mid"]  { background: #d97706; }
.lettre-progress__fill[data-level="high"] { background: #16a34a; }
.lettre-progress__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 12px;
  color: #666;
}
.lettre-progress__pct {
  font-weight: 700;
  color: #333;
}

/* ── Sections éditeur ────────────────────────────────── */
.lettre-section {
  border: 1px solid #e0ddd8;
  border-radius: 8px;
  padding: 14px 16px 10px;
  margin-bottom: 14px;
  background: #fafaf8;
  transition: border-color .2s;
}
.lettre-section:focus-within {
  border-color: var(--cv-accent, #555);
  background: #fff;
}
.lettre-section--permis {
  border-color: #f9a825;
  background: #fffdf0;
}
.lettre-section--permis:focus-within {
  border-color: #e6930a;
}

.lettre-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.lettre-section__name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #555;
  flex: 1;
}
.lettre-section--permis .lettre-section__name {
  color: #92610a;
}

.lettre-section__words {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}
.words--empty  { background: #f0ece6; color: #999; }
.words--low    { background: #fef3c7; color: #92400e; }
.words--ok     { background: #d1fae5; color: #065f46; }

.lettre-section__help {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #fff;
  color: #888;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.lettre-section__help:hover {
  background: var(--cv-accent, #555);
  color: #fff;
  border-color: var(--cv-accent, #555);
}

.lettre-section__tooltip-box {
  display: none;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.5;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.lettre-section__tooltip-box.is-open { display: block; }
.lettre-section__tooltip-box em {
  display: block;
  margin-top: 4px;
  color: #3b5ea6;
  font-style: italic;
}
.lettre-section--permis .lettre-section__tooltip-box {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #78350f;
}
.lettre-section--permis .lettre-section__tooltip-box em {
  color: #92400e;
}

.lettre-section__ta {
  min-height: unset;
  resize: vertical;
  font-size: 13px;
  line-height: 1.6;
}

.lettre-section__btns {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-sec-example {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid #d1cfc8;
  border-radius: 14px;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-sec-example:hover {
  background: var(--cv-accent, #555);
  color: #fff;
  border-color: var(--cv-accent, #555);
}

/* ── Compteur total ──────────────────────────────────── */
.lettre-total-count {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  text-align: right;
}
.lettre-total-count__num {
  font-weight: 700;
  font-size: 15px;
}
.lettre-total-count__target { color: #999; margin-left: 4px; }
.count--empty { color: #bbb; }
.count--low   { color: #d97706; }
.count--ok    { color: #16a34a; }
.count--high  { color: #0369a1; }

/* ── Checklist ───────────────────────────────────────── */
.lettre-checklist {
  background: #f8f7f5;
  border: 1px solid #e5e2db;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.lettre-checklist__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #666;
  margin: 0 0 10px;
}
.lettre-checklist__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lettre-checklist__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #777;
  transition: color .2s;
}
.lettre-checklist__item.is-checked {
  color: #065f46;
}
.chk-icon {
  font-size: 14px;
  line-height: 1.2;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  color: #bbb;
  transition: color .2s;
}
.lettre-checklist__item.is-checked .chk-icon {
  color: #16a34a;
}
