/* @portee: public */
/* =========================================================================
   EIT GROUP — v4 (agent 7) : newsletter (éditeur, modèles, suivi, réglages, journal) et FAQ publique.
   Préfixes : nl- (newsletter), fq- (FAQ). Variables du thème uniquement (clair / sombre).
   ========================================================================= */

/* ---------- Modèle de campagne (puce) */
.nl-modele-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: var(--r-pill); font-size: .76rem; font-weight: 700; background: var(--bg-sunken); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.nl-modele-chip.is-sm { padding: .05rem .45rem; font-size: .7rem; margin-right: .2rem; }
.nl-modele-chip.tone-success { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.nl-modele-chip.tone-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.nl-modele-chip.tone-orange { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.nl-modele-chip.tone-violet { background: color-mix(in srgb, #8B5CF6 16%, transparent); color: #7C4DDB; border-color: transparent; }
[data-theme="dark"] .nl-modele-chip.tone-violet { color: #B79BFF; }

/* ---------- Choix du modèle */
.nl-modeles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .7rem; }
.nl-modele { display: flex; align-items: center; gap: .85rem; padding: 1rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-elev); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.nl-modele:hover { border-color: var(--brand); }
.nl-modele b { display: block; font-size: .95rem; }
.nl-modele .small { display: block; margin-top: .1rem; line-height: 1.4; }
.nl-modele-icon { width: 2.8rem; height: 2.8rem; border-radius: var(--r); display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; background: var(--bg-sunken); color: var(--text-2); }
.nl-modele-icon.is-offres { background: var(--brand-soft); color: var(--brand-ink); }
.nl-modele-icon.is-actualite { background: var(--info-soft); color: var(--info); }
.nl-modele-icon.is-sensibilisation { background: var(--warning-soft); color: var(--warning); }
.nl-modele-icon.is-invitation { background: color-mix(in srgb, #8B5CF6 16%, transparent); color: #7C4DDB; }
[data-theme="dark"] .nl-modele-icon.is-invitation { color: #B79BFF; }
.nl-modele-go { color: var(--text-3); transition: transform .15s; }
.nl-modele:hover .nl-modele-go { transform: translateX(3px); color: var(--brand-ink); }

/* ---------- Éditeur riche */
.nl-head-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .nl-head-grid { grid-template-columns: minmax(0, 1fr); } }
.nl-ed { display: flex; flex-direction: column; flex: 1; min-height: 0; border: 1px solid var(--line-strong, var(--line)); border-radius: var(--r); background: var(--bg-elev); overflow: hidden; }
.nl-ed:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.nl-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem; padding: .35rem .45rem; border-bottom: 1px solid var(--line); background: var(--bg-sunken); position: sticky; top: 0; z-index: 2; }
.nl-bar .btn.is-on { background: var(--bg-inverse); color: var(--text-inverse); }
.nl-bar-sel { width: auto; min-width: 7.5rem; height: 1.9rem; padding-block: 0; font-size: .8rem; }
.nl-bar-ins { gap: .3rem; }
.nl-sep { width: 1px; height: 1.2rem; background: var(--line); margin: 0 .25rem; }
.nl-zone { position: relative; flex: 1; min-height: 320px; overflow: auto; }
.nl-area { min-height: 320px; padding: 1.1rem 1.25rem 2rem; outline: none; font-size: .95rem; line-height: 1.65; color: var(--text); }
.nl-area:empty::before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; }
.nl-area h2 { font-size: 1.35rem; margin: 1.2rem 0 .5rem; }
.nl-area h3 { font-size: 1.12rem; margin: 1rem 0 .4rem; }
.nl-area p { margin: 0 0 .85rem; }
.nl-area blockquote { margin: .8rem 0; padding: .2rem 0 .2rem .9rem; border-left: 3px solid var(--brand); color: var(--text-2); }
.nl-area img { max-width: 100%; height: auto; border-radius: 8px; }
.nl-area img:hover { outline: 2px solid var(--brand); outline-offset: 2px; cursor: pointer; }
.nl-area hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.nl-area a { color: var(--brand-ink); font-weight: 650; }
.nl-area table { max-width: 100%; }
/* Les blocs d'email ont des couleurs claires en ligne : on les garde lisibles en mode sombre (rendu fidèle à l'email). */
.nl-area [data-nl-bloc], .nl-area table[data-nl-offre], .nl-area table[data-nl-article] { color: #0A0D09; }
[data-theme="dark"] .nl-area [data-nl-bloc="offres"], [data-theme="dark"] .nl-area [data-nl-bloc="actualites"] { background: #fff; border-radius: 12px; padding: 6px; }
.nl-area [data-nl-bloc]:hover, .nl-area table:hover { outline: 1px dashed color-mix(in srgb, var(--brand) 70%, transparent); outline-offset: 3px; }
.nl-area[data-readonly] { background: var(--bg-sunken); }
.nl-html { width: 100%; min-height: 320px; height: 100%; border: 0; border-radius: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; line-height: 1.5; resize: none; }
.nl-blocbar { position: absolute; display: flex; gap: .15rem; padding: .2rem; border-radius: var(--r-pill); background: var(--bg-inverse); box-shadow: var(--shadow-pop); z-index: 3; }
.nl-blocbar .btn { color: var(--text-inverse); background: transparent; border: 0; }
.nl-blocbar .btn:hover { background: color-mix(in srgb, var(--text-inverse) 16%, transparent); }
.nl-blocbar .btn.is-danger:hover { background: var(--danger); color: #fff; }

/* ---------- Modale d'insertion */
.nl-ins-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.nl-ins-form > .modal-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.nl-pick-list { display: flex; flex-direction: column; gap: .35rem; max-height: min(52dvh, 420px); overflow-y: auto; padding: .1rem; transition: opacity .15s; }
.nl-pick { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-elev); cursor: pointer; transition: border-color .15s, background .15s; }
.nl-pick:hover { border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); }
.nl-pick.is-on { border-color: var(--brand); background: var(--brand-soft); }
.nl-pick input { accent-color: var(--brand); width: 1rem; height: 1rem; flex-shrink: 0; }
.nl-pick img { width: 3.2rem; height: 2.2rem; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.nl-pick b, .nl-pick .xsmall { display: block; }
.nl-pick-n { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #000; font-size: .72rem; font-weight: 800; flex-shrink: 0; }
.is-loading-soft { opacity: .55; pointer-events: none; }
.nl-img-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; max-height: min(42dvh, 340px); overflow-y: auto; padding: .1rem; }
.nl-img-tile { aspect-ratio: 4 / 3; padding: 0; border-radius: var(--r); border: 2px solid transparent; overflow: hidden; background: var(--bg-sunken); cursor: pointer; transition: border-color .15s, transform .15s; }
.nl-img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nl-img-tile:hover { transform: translateY(-1px); }
.nl-img-tile.is-on { border-color: var(--brand); box-shadow: var(--ring); }
.nl-img-up { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; padding: .4rem; border-radius: var(--r); border: 2px dashed var(--line); color: var(--text-2); text-align: center; cursor: pointer; font-size: .78rem; font-weight: 650; }
.nl-img-up i { font-size: 1.3rem; color: var(--brand-ink); }
.nl-img-up small { font-size: .64rem; font-weight: 500; color: var(--text-3); }
.nl-img-up:hover { border-color: var(--brand); }
.nl-btn-demo { padding: 1rem; border-radius: var(--r); background: #F5F6F3; text-align: center; }
.nl-btn-demo span { display: inline-block; padding: .7rem 1.3rem; border-radius: 10px; font-weight: 700; font-size: .9rem; }
.nl-btn-demo .is-vert { background: #5CAC30; color: #000; }
.nl-btn-demo .is-noir { background: #0A0D09; color: #fff; }
.nl-btn-demo .is-clair { background: #EEF7E8; color: #24410F; }

/* ---------- Aperçu (ordinateur / téléphone) */
.nl-preview-body { transition: opacity .15s; }
.nl-phone { width: 100%; display: flex; justify-content: center; transition: padding .3s var(--ease); }
.nl-phone.is-on { padding: 1rem 0; }
.nl-phone.is-on .ct-nl-frame { width: 390px; max-width: 100%; border-radius: 28px; border: 10px solid #111; box-shadow: var(--shadow-pop); height: min(68dvh, 740px); }

/* ---------- Destinataires */
.nl-recip { flex-wrap: wrap; }
.nl-recip-detail { display: flex; flex-direction: column; gap: .15rem; font-size: .8rem; color: var(--text-2); text-align: right; }
.nl-recip-detail b { color: var(--text); font-variant-numeric: tabular-nums; }
.nl-recip-detail .is-muted { color: var(--text-3); }
@media (max-width: 600px) { .nl-recip-detail { text-align: left; width: 100%; flex-direction: row; flex-wrap: wrap; gap: .2rem .8rem; } }
.nl-cible-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
@media (max-width: 760px) { .nl-cible-grid { grid-template-columns: minmax(0, 1fr); } }
.nl-cible-card { padding: 1rem 1.1rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-elev); }
.nl-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.nl-chip { position: relative; display: inline-flex; align-items: center; padding: .28rem .7rem; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: .78rem; font-weight: 650; color: var(--text-2); cursor: pointer; transition: all .15s; }
.nl-chip input { position: absolute; opacity: 0; pointer-events: none; }
.nl-chip:has(input:checked) { background: var(--bg-inverse); border-color: var(--bg-inverse); color: var(--text-inverse); }
.nl-chip:has(input:focus-visible) { box-shadow: var(--ring); }

/* ---------- Bouton d'appel */
.nl-btn-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.nl-btn-choice { position: relative; display: flex; align-items: flex-start; gap: .7rem; padding: .9rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-elev); cursor: pointer; transition: border-color .15s, background .15s; }
.nl-btn-choice input { position: absolute; opacity: 0; pointer-events: none; }
.nl-btn-choice b, .nl-btn-choice .xsmall { display: block; }
.nl-btn-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.nl-btn-choice:has(input:focus-visible) { box-shadow: var(--ring); }
.nl-btn-choice-icon { width: 2.2rem; height: 2.2rem; border-radius: var(--r); display: grid; place-items: center; background: var(--bg-sunken); color: var(--brand-ink); font-size: 1.1rem; flex-shrink: 0; }

/* ---------- Statistiques */
.nl-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.nl-kpis .ct-nl-kpi small { min-height: 1em; }
@media (max-width: 1600px) { .nl-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .nl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.progress.is-paused > span { background: var(--warning); }
.progress.is-danger > span { background: var(--danger); }
.nl-liens { display: flex; flex-direction: column; gap: .35rem; }
.nl-lien { display: grid; grid-template-columns: minmax(0, 1fr) 140px 2.5rem; align-items: center; gap: .8rem; padding: .55rem .75rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-elev); }
.nl-lien-bar { height: .4rem; border-radius: 99px; background: var(--bg-sunken); overflow: hidden; }
.nl-lien-bar span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.nl-lien b { text-align: right; }
@media (max-width: 600px) { .nl-lien { grid-template-columns: minmax(0, 1fr) 2.5rem; } .nl-lien-bar { display: none; } }
.nl-seg-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.nl-seg-scroll a { white-space: nowrap; }
.table-wrap { max-width: 100%; overflow-x: auto; }

/* ---------- Réglages d'envoi */
.nl-reglages { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1100px) { .nl-reglages { grid-template-columns: minmax(0, 1fr); } }
.nl-reglages > form { margin: 0; display: flex; flex-direction: column; }
.nl-reglages > form > .panel-body { flex: 1; }
.nl-reglages-side .panel { margin: 0; }
.nl-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
@media (max-width: 600px) { .nl-presets { grid-template-columns: minmax(0, 1fr); } }
.nl-preset { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .75rem .85rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-elev); color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; font: inherit; }
.nl-preset span { font-size: .78rem; color: var(--text-2); }
.nl-preset small { font-size: .72rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nl-preset:hover { border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); }
.nl-preset.is-on { border-color: var(--brand); background: var(--brand-soft); }
.nl-rythme { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; border-radius: var(--r); background: var(--bg-sunken); border: 1px solid var(--line); font-size: .86rem; }
.nl-rythme i { font-size: 1.4rem; color: var(--brand-ink); }
.nl-cron-dot { width: .8rem; height: .8rem; border-radius: 50%; flex-shrink: 0; }
.nl-cron-dot.is-ok { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.nl-cron-dot.is-ko { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.nl-code { display: block; padding: .6rem .7rem; border-radius: var(--r); background: var(--bg-sunken); border: 1px solid var(--line); font-size: .72rem; word-break: break-all; }
.nl-garanties ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .5rem; font-size: .84rem; color: var(--text-2); }
.nl-garanties li { display: flex; gap: .5rem; }
.nl-garanties i { color: var(--brand-ink); font-size: 1.05rem; flex-shrink: 0; margin-top: .05rem; }
.nl-cron-alert a { font-weight: 700; }

/* ---------- FAQ publique : outils d'une question, « pas trouvé ? » */
.fq-tools { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.fq-tool { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .6rem; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; color: var(--text-2); font: inherit; font-size: .78rem; font-weight: 650; cursor: pointer; transition: all .15s; }
.fq-tool:hover { border-color: var(--brand); color: var(--brand-ink); }
.fq-vote-err { display: flex; align-items: center; gap: .4rem; width: 100%; font-size: .8rem; color: var(--danger); }
.fq-help { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; margin-top: .9rem; }
.fq-help-card { display: flex; align-items: center; gap: .8rem; padding: .95rem 1rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-elev); color: var(--text); text-align: left; font: inherit; cursor: pointer; text-decoration: none; transition: border-color .15s, transform .15s; }
.fq-help-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.fq-help-card b { display: block; font-size: .92rem; }
.fq-help-card span.small { display: block; color: var(--text-2); }
.fq-help-icon { width: 2.5rem; height: 2.5rem; border-radius: var(--r); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-size: 1.2rem; flex-shrink: 0; }
.ct-faq-item:target, .ct-faq-item.is-flash { animation: fq-flash 1.6s ease; }
@keyframes fq-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .ct-faq-item:target, .ct-faq-item.is-flash { animation: none; } }
