/* Messagerie dédiée, mandat, pages légales et consentement */

/* ---------- consentement (inscription, activation) ---------- */
.consent { border: 1px solid var(--line); border-radius: 12px; background: #f9fbfe; padding: 14px 16px; margin: 6px 0 16px; font-size: .86rem; line-height: 1.5; color: var(--ink); }
.consent h3 { font-size: .95rem; margin-bottom: 8px; }
.consent p { margin-bottom: 8px; color: var(--ink-soft); }
.consent-check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; font-weight: 600; cursor: pointer; }
.consent-check input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--blue-600); }
.consent-check a { color: var(--blue-700); }
.auth-consent-btn { letter-spacing: .02em; }

/* ---------- conditions mises à jour (bandeau non bloquant : accueil et page Compte) ---------- */
.cs-maj p { margin: 0 0 6px; overflow-wrap: anywhere; }
.cs-maj a { color: var(--blue-700); font-weight: 600; }
.cs-maj .name-row { margin-top: 6px; }
.cs-maj .field { margin-bottom: 10px; }
.cs-maj .field input[type=text] { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.cs-maj .name-preview { margin: -6px 0 8px; }
.cs-maj-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.cs-maj-err { color: var(--red-600); font-weight: 600; }
.cs-maj-err:empty { display: none; }

/* ---------- prénom et nom (adresse prenom.nom@) ---------- */
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.name-row .field input { width: 100%; }
.name-preview { font-size: .82rem; color: var(--ink-soft); margin: -8px 0 14px; overflow-wrap: anywhere; }
.name-preview strong { color: var(--blue-700); }
.ml-activate .field input[type=text] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 480px) { .name-row { grid-template-columns: 1fr; } }

/* ---------- pages légales ---------- */
.legal { max-width: 820px; margin: 0 auto 16px; line-height: 1.6; }
.legal h2 { font-size: 1.05rem; margin: 22px 0 8px; }
.legal h3 { font-size: .95rem; margin: 14px 0 6px; }
.legal p, .legal li { font-size: .92rem; margin-bottom: 8px; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--blue-700); }

/* ---------- navigation : pastille des messages non lus ---------- */
.nav-badge { display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px; border-radius: 9px; background: var(--red-600); color: #fff; font-size: .72rem; font-weight: 800; text-align: center; line-height: 16px; }
.nav-badge[hidden] { display: none; }

/* ---------- liste ---------- */
.ml-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.ml-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ml-tab { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 13px; font-weight: 700; font-size: .86rem; color: var(--ink-soft); cursor: pointer; }
.ml-tab.on { border-color: var(--blue-600); background: var(--blue-050); color: var(--blue-700); }
.ml-list { padding: 6px; }
.ml-row { display: grid; grid-template-columns: minmax(120px, 210px) 1fr auto; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.ml-row:last-child { border-bottom: 0; }
.ml-row:hover { background: var(--blue-050); }
.ml-row.unread .ml-who, .ml-row.unread .ml-subj { font-weight: 800; }
.ml-row.unread .ml-who::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); margin-right: 7px; vertical-align: 1px; }
.ml-who { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-subj { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ml-ex { color: var(--ink-soft); font-weight: 400; }
.ml-meta { display: flex; gap: 6px; align-items: center; justify-content: flex-end; font-size: .78rem; color: var(--ink-soft); white-space: nowrap; }
.ml-meta .badge { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.ml-mini { border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.ml-mini .ml-row { grid-template-columns: minmax(100px, 170px) 1fr auto; padding: 9px 10px; }
.ml-dossier-addr { font-size: .92rem; }
.ml-dossier-addr code, .ml-addr code, .ml-compose code, .sub code { background: var(--blue-050); border-radius: 6px; padding: 2px 6px; font-size: .86rem; word-break: break-all; }

/* ---------- message ---------- */
.ml-msg h2 { font-size: 1.2rem; }
.ml-head { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; font-size: .9rem; margin: 6px 0 12px; }
.ml-head dt { color: var(--ink-soft); font-weight: 700; }
.ml-head dd { min-width: 0; overflow-wrap: anywhere; }
.ml-head select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }
.ml-auth { font-size: .8rem; color: var(--ink-soft); background: #f6f8fb; border-radius: 8px; padding: 7px 10px; margin-bottom: 12px; }
.ml-auth.ok { color: var(--green-600); background: var(--green-050); }
.ml-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; line-height: 1.55; border-top: 1px solid var(--line); padding-top: 14px; }
.ml-atts { list-style: none; display: grid; gap: 8px; }
.ml-atts li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .9rem; }
.ml-att-act { display: flex; gap: 8px; flex-wrap: wrap; }
.ml-delivery { list-style: none; font-size: .85rem; margin-bottom: 12px; display: grid; gap: 4px; }
.ml-err { color: var(--red-600); font-size: .86rem; font-weight: 600; min-height: 1px; margin-top: 8px; }
.ml-err:empty { display: none; }

/* ---------- rédaction ---------- */
.ml-compose input[type=text], .ml-compose input[type=email], .ml-compose select, .ml-compose textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ml-compose textarea { resize: vertical; line-height: 1.5; }
.ml-files { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ml-files legend { font-weight: 700; font-size: .88rem; padding: 0 4px; }
.ml-files .sv-check { display: flex; }
.ml-file { font-size: .88rem; margin: 4px 0; }
.ml-add { margin-top: 6px; }

/* ---------- compte : adresses ---------- */
.ml-addr { width: 100%; border-collapse: collapse; font-size: .88rem; margin-bottom: 12px; }
.ml-addr th { text-align: left; color: var(--ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ml-addr td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ml-addr td:first-child { width: 48%; }

/* ---------- mandat ---------- */
.mdt-form input[type=text], .mdt-form input[type=date] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.mdt-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mdt-form fieldset .sv-check { display: flex; }
.mdt-form legend { font-weight: 700; font-size: .88rem; padding: 0 4px; }
.mdt-form h2 { margin-top: 8px; }
.mdt-text { border: 1px solid var(--line); border-radius: 10px; background: #fffef9; padding: 16px 18px; font-size: .9rem; line-height: 1.6; margin-bottom: 16px; }
.mdt-text p { margin-bottom: 8px; }
.mdt-text ul { padding-left: 20px; margin-bottom: 8px; }
.mdt-text mark { background: #fff3c4; border-radius: 3px; padding: 0 2px; }
.mdt-title { font-weight: 800; text-align: center; letter-spacing: .03em; }
.mdt-pre { white-space: pre-wrap; }
.mdt-hash { font-size: .72rem; word-break: break-all; }

@media (max-width: 640px) {
  .ml-row, .ml-mini .ml-row { grid-template-columns: 1fr; gap: 3px; }
  .ml-meta { justify-content: flex-start; flex-wrap: wrap; }
  .ml-head { grid-template-columns: 70px 1fr; }
  .ml-addr td:first-child { width: auto; }
  .ml-addr, .ml-addr tbody, .ml-addr tr, .ml-addr td { display: block; }
  .ml-addr thead { display: none; }
  .ml-addr td { border-bottom: 0; padding: 4px 0; }
  .ml-addr tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
}
