/* NCT Discussion — version minimaliste. Couleur du profil : vert guides #2E9E5B (défaut), rouge tests #C62B1F (.nctd--test),
   bleu actus #2C7BE5 (.nctd--actu), jaune immersions #E8B31A (.nctd--immersion). */
.nctd {
	--nctd-c: #2e9e5b;
	--nctd-c-fonce: #237a46;
	--nctd-c-clair: #eef7f1;
	--nctd-c-pale: #f6fbf8;
	--nctd-c-trait: #d5ebdd;
	--nctd-ink: var(--nctd-c);
	--nctd-sur: #fff;
	--nctd-texte: #1d1d1b;
	--nctd-gris: #7a7a7a;
	--nctd-hauteur: min(740px, calc(100vh - 48px));

	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: var(--nctd-hauteur);
	overflow: hidden;
	background: #fff;
	border: 2px solid var(--nctd-c);
	border-radius: 14px;
	color: var(--nctd-texte);
	font-size: 14.5px;
	line-height: 1.5;
	box-sizing: border-box;
}
.nctd--test {
	--nctd-c: #c62b1f;
	--nctd-c-fonce: #9e2218;
	--nctd-c-clair: #fbeeed;
	--nctd-c-pale: #fdf7f6;
	--nctd-c-trait: #f1d5d2;
}
.nctd--actu {
	--nctd-c: #2c7be5;
	--nctd-c-fonce: #1f5fb8;
	--nctd-c-clair: #eaf2fd;
	--nctd-c-pale: #f5f9fe;
	--nctd-c-trait: #d0e1f8;
}
.nctd--immersion {
	--nctd-c: #e8b31a;
	--nctd-c-fonce: #a87700;
	--nctd-c-clair: #fcf3d9;
	--nctd-c-pale: #fefaee;
	--nctd-c-trait: #f2dea0;
	--nctd-ink: #a87700; /* or lisible sur fond blanc */
	--nctd-sur: #1d1d1b; /* texte foncé sur le jaune */
}
.nctd--test, .nctd--actu, .nctd--guide { --nctd-ink: var(--nctd-c); }
.nctd *, .nctd *::before, .nctd *::after { box-sizing: inherit; }

/* ---------------------------------------------------------------- Largeur
   Le panneau prend toute la largeur de son emplacement (Elementor réduit sinon le widget à son contenu).
   - Dans une colonne étroite (à droite de l'article) : hauteur fixe, comme une messagerie.
   - En pleine largeur (sous l'article) : la hauteur suit les messages, jusqu'à la hauteur maximale. */
.nctd-cadre { container-type: inline-size; width: 100%; }
.elementor-widget:has(.nctd-cadre) { width: 100%; max-width: 100%; }
@container (min-width: 700px) {
	.nctd { position: relative; top: 0; height: auto; max-height: var(--nctd-hauteur); }
	.nctd-fil { min-height: 160px; }
	.nctd-corps { max-width: min(85%, 680px); }
	.nctd-vide { margin: auto; }
}
.nctd [hidden] { display: none !important; }
.nctd button { font: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- En-tête */
.nctd-entete { padding: 18px 20px 14px; border-bottom: 1px solid var(--nctd-c-trait); }
.nctd .nctd-titre {
	margin: 0;
	padding: 0;
	color: var(--nctd-ink);
	font-size: 21px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -.01em;
	text-transform: none;
}
.nctd-accroche { margin: 4px 0 0; font-size: 14.5px; line-height: 1.4; color: var(--nctd-texte); }
.nctd-compteur { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin: 6px 0 0; font-size: 13px; color: var(--nctd-gris); }
.nctd-stats strong { color: var(--nctd-ink); font-weight: 800; }

/* ---------------------------------------------------------------- Fil */
.nctd-fil {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 18px 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--nctd-c-trait) transparent;
}
.nctd-fil:focus { outline: none; }

.nctd-msg { display: flex; align-items: flex-start; gap: 10px; }
.nctd-msg.is-nct { flex-direction: row-reverse; }
.nctd-corps { display: flex; flex-direction: column; min-width: 0; max-width: 85%; }
.nctd-msg.is-nct .nctd-corps { align-items: flex-end; }
.nctd-msg.is-nouveau { animation: nctd-arrivee .25s ease-out; }

.nctd-avatar {
	flex-shrink: 0;
	display: inline-grid;
	place-items: center;
	width: 30px;
	height: 30px;
	margin-top: 20px;
	border-radius: 50%;
	background: var(--c, var(--nctd-c));
	color: #fff;
	font-size: 11.5px;
	font-weight: 700;
	user-select: none;
}
.nctd-avatar--nct { background: var(--nctd-c-fonce); font-size: 9.5px; font-weight: 900; font-style: italic; }

.nctd-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 0 2px 4px; font-size: 12px; color: var(--nctd-gris); }
.nctd-meta strong { color: var(--nctd-texte); font-size: 13px; font-weight: 700; }
.nctd-badge { color: var(--nctd-ink); font-size: 11px; font-weight: 800; }
.nctd-possede { padding: 1px 7px; border-radius: 10px; background: var(--nctd-c-clair); color: var(--nctd-ink); font-size: 11px; font-weight: 700; }
.nctd-note { color: var(--nctd-ink); font-size: 12px; font-weight: 800; }
.nctd-question { padding: 0 6px; border: 1px solid var(--nctd-c); border-radius: 10px; color: var(--nctd-ink); font-size: 11px; font-weight: 700; }
.nctd-msg.is-temoignage:not(.is-nct) .nctd-bulle { box-shadow: inset 3px 0 0 var(--nctd-c); }

.nctd-bulle {
	padding: 9px 13px;
	background: var(--nctd-c-clair);
	border-radius: 4px 14px 14px 14px;
	overflow-wrap: anywhere;
}
.nctd-msg.is-nct .nctd-bulle { background: var(--nctd-c); color: var(--nctd-sur); border-radius: 14px 4px 14px 14px; }
.nctd-texte p { margin: 0 0 .6em; }
.nctd-texte p:last-child { margin-bottom: 0; }

.nctd-citation {
	display: block;
	margin: 0 0 6px;
	padding: 2px 0 2px 9px;
	border-left: 2px solid var(--nctd-c);
	color: inherit !important;
	font-size: 12.5px;
	line-height: 1.35;
	text-decoration: none !important;
	opacity: .8;
}
.nctd-citation strong { display: block; font-size: 12px; }
.nctd-msg.is-nct .nctd-citation { border-left-color: currentColor; }
.nctd-msg.is-flash .nctd-bulle { outline: 2px solid var(--nctd-c); outline-offset: 2px; }

.nctd-actions { display: flex; gap: 14px; margin: 4px 2px 0; }
.nctd-actions button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--nctd-gris);
	font-size: 12px;
	font-weight: 600;
}
.nctd-actions button:hover { color: var(--nctd-ink); }
.nctd-utile[aria-pressed="true"] { color: var(--nctd-ink) !important; }
.nctd-attente { font-size: 12px; color: var(--nctd-gris); }
.nctd-msg.is-attente .nctd-bulle { background: var(--nctd-c-pale); border: 1px dashed var(--nctd-c-trait); }

.nctd-vide { margin: auto 0; text-align: center; color: var(--nctd-gris); font-size: 13.5px; }

/* ---------------------------------------------------------------- Saisie */
.nctd-saisie { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--nctd-c-trait); }

.nctd-reponse {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 2px 0 2px 9px;
	border-left: 2px solid var(--nctd-c);
	font-size: 12.5px;
	color: var(--nctd-gris);
}
.nctd-reponse strong { color: var(--nctd-texte); }
.nctd-reponse__annuler { padding: 0 4px; border: 0; background: none; color: var(--nctd-gris); font-size: 18px; line-height: 1; }

/* Test produit : « J'ai ce produit » (+ note sur 10) ou « J'ai une question » */
.nctd-avis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.nctd-avis[hidden] { display: none !important; }
.nctd-choix, .nctd-notes label { position: relative; margin: 0; cursor: pointer; }
.nctd-choix input, .nctd-notes input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.nctd-choix span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 13px;
	border: 2px solid var(--nctd-c);
	border-radius: 25px;
	color: var(--nctd-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	transition: background .15s, color .15s;
}
.nctd-choix span::before { content: "+"; font-weight: 800; }
.nctd-choix--question span::before { content: "?"; }
.nctd-choix input:checked + span { background: var(--nctd-c); border-color: var(--nctd-c); color: var(--nctd-sur); }
.nctd-choix input:checked + span::before { content: "✓"; }
.nctd-choix input:focus-visible + span, .nctd-notes input:focus-visible + span { outline: 2px solid var(--nctd-c); outline-offset: 2px; }
.nctd-notes { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; gap: 4px; }
.nctd-notes__lib { margin-right: 4px; font-size: 12px; color: var(--nctd-gris); }
.nctd-notes label span {
	display: inline-grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border: 1px solid var(--nctd-c-trait);
	border-radius: 50%;
	background: var(--nctd-c-pale);
	color: var(--nctd-texte);
	font-size: 12px;
	font-weight: 700;
	transition: background .15s, color .15s, border-color .15s;
}
.nctd-notes label:hover span { border-color: var(--nctd-c); }
.nctd-notes input:checked + span { background: var(--nctd-c); border-color: var(--nctd-c); color: var(--nctd-sur); }

/* Actu : « Un test NCT ça t'intéresse ? » + vote */
.nctd-demande {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 10px;
	padding: 8px 10px 8px 12px;
	border-radius: 10px;
	background: var(--nctd-c-clair);
}
.nctd-demande__q { font-size: 13.5px; font-weight: 700; line-height: 1.3; color: var(--nctd-texte); }
.nctd.nctd .nctd-demande__btn {
	flex-shrink: 0;
	padding: 5px 13px;
	border: 2px solid var(--nctd-c);
	border-radius: 25px;
	background: #fff;
	color: var(--nctd-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	transition: background .15s, color .15s;
}
.nctd.nctd .nctd-demande__btn:hover { background: var(--nctd-c); color: var(--nctd-sur); }
.nctd.nctd .nctd-demande__btn[aria-pressed="true"] { background: var(--nctd-c); color: var(--nctd-sur); cursor: default; }
.nctd.nctd .nctd-demande__btn[aria-pressed="true"]::before { content: "✓ "; }

/* Photo souvenir (cols de légende, parcours) */
.nctd-choix--photo span svg { flex-shrink: 0; }
.nctd-choix--photo span::before { content: none; }
.nctd-choix--photo input { top: 0; left: 0; }
.nctd-apercu { display: flex; flex-basis: 100%; align-items: center; gap: 10px; font-size: 12px; color: var(--nctd-gris); line-height: 1.3; }
.nctd-apercu img { width: 52px; height: 52px; flex-shrink: 0; border-radius: 8px; object-fit: cover; }
.nctd-apercu span { flex: 1; }
.nctd.nctd .nctd-apercu__retirer { flex-shrink: 0; padding: 0 4px; border: 0; border-radius: 0; background: none; color: var(--nctd-gris); font-size: 20px; line-height: 1; }
.nctd-saisie.is-envoi .nctd-envoyer { animation: nctd-pulse 1s ease-in-out infinite; }
@keyframes nctd-pulse { 50% { opacity: .5; } }

.nctd-photo { display: block; margin-top: 8px; border-radius: 10px; overflow: hidden; line-height: 0; }
.nctd .nctd-photo img { display: block; width: 100% !important; max-width: 320px; height: auto !important; max-height: 360px; object-fit: cover; border-radius: 10px !important; }
.nctd-msg.is-nct .nctd-photo { margin-left: auto; }

.nctd-identite { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.nctd .nctd-identite input,
.nctd .nctd-zone textarea {
	width: 100%;
	margin: 0;
	border: 1px solid var(--nctd-c-trait);
	background: var(--nctd-c-pale);
	font: inherit;
	color: var(--nctd-texte);
	outline: none;
	box-shadow: none;
	transition: border-color .15s, background .15s;
}
.nctd .nctd-identite input { padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.nctd .nctd-identite input:focus,
.nctd .nctd-zone textarea:focus { border-color: var(--nctd-c); background: #fff; }
.nctd-moi { margin: 0; font-size: 12px; color: var(--nctd-gris); }
.nctd-moi__modifier { padding: 0; border: 0; background: none; color: var(--nctd-ink); font-size: 12px; text-decoration: underline; }

.nctd-zone { display: flex; align-items: flex-end; gap: 8px; }
.nctd .nctd-zone textarea {
	flex: 1;
	min-height: 42px;
	max-height: 140px;
	padding: 10px 15px;
	border-radius: 21px;
	font-size: 15px;
	line-height: 1.4;
	resize: none;
}
.nctd-envoyer {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nctd-c);
	color: var(--nctd-sur);
	transition: background .15s, opacity .15s;
}
.nctd-envoyer:hover:not(:disabled) { background: var(--nctd-c-fonce); }
.nctd-envoyer:disabled { opacity: .3; cursor: default; }

.nctd-erreur { margin: 0; font-size: 13px; color: #b3261e; }
.nctd-ferme { margin: 0; padding: 14px 20px; border-top: 1px solid var(--nctd-c-trait); color: var(--nctd-gris); font-size: 13px; text-align: center; }
.nctd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

@keyframes nctd-arrivee { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- Protection contre les styles globaux du thème / kit Elementor
   (le kit impose aux boutons et champs : majuscules, espacement des lettres, fond, padding…). */
.nctd.nctd :is(button, input, textarea) {
	text-transform: none !important;
	letter-spacing: normal !important;
	font-family: inherit;
	box-shadow: none;
}
.nctd.nctd :is(input, textarea)::placeholder { text-transform: none !important; color: #9a9a9a; opacity: 1; }
.nctd.nctd .nctd-actions button,
.nctd.nctd .nctd-reponse__annuler,
.nctd.nctd .nctd-moi__modifier {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	line-height: 1.4;
}
.nctd.nctd .nctd-actions button { color: var(--nctd-gris); font-size: 12px; font-weight: 600; }
.nctd.nctd .nctd-actions button:hover,
.nctd.nctd .nctd-actions button:focus { background: none; color: var(--nctd-ink); }
.nctd.nctd .nctd-utile[aria-pressed="true"] { color: var(--nctd-ink); }
.nctd.nctd .nctd-reponse__annuler { padding: 0 4px; color: var(--nctd-gris); font-size: 18px; line-height: 1; }
.nctd.nctd .nctd-moi__modifier { color: var(--nctd-ink); font-size: 12px; text-decoration: underline; }
.nctd.nctd .nctd-envoyer {
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50% !important;
	background: var(--nctd-c) !important;
	color: var(--nctd-sur) !important;
	line-height: 1;
}
.nctd.nctd .nctd-envoyer:hover:not(:disabled),
.nctd.nctd .nctd-envoyer:focus:not(:disabled) { background: var(--nctd-c-fonce) !important; }
.nctd.nctd .nctd-envoyer:disabled { background: var(--nctd-c); color: var(--nctd-sur); opacity: .3; }
.nctd.nctd .nctd-zone textarea {
	padding: 10px 15px;
	border: 1px solid var(--nctd-c-trait);
	border-radius: 21px;
	background: var(--nctd-c-pale);
	color: var(--nctd-texte);
	font-size: 15px;
	line-height: 1.4;
}
.nctd.nctd .nctd-identite input {
	padding: 8px 12px;
	border: 1px solid var(--nctd-c-trait);
	border-radius: 8px;
	background: var(--nctd-c-pale);
	color: var(--nctd-texte);
	font-size: 14px;
}
.nctd.nctd .nctd-zone textarea:focus,
.nctd.nctd .nctd-identite input:focus { border-color: var(--nctd-c); background: #fff; outline: none; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1024px) {
	.nctd { position: relative; top: 0; --nctd-hauteur: 620px; }
}
@media (max-width: 480px) {
	.nctd-notes label span { width: 23px; height: 23px; font-size: 11px; }
	.nctd-notes { gap: 3px; flex-wrap: nowrap; }
	.nctd-notes__lib { margin-right: 2px; font-size: 11.5px; white-space: nowrap; }
	.nctd { --nctd-hauteur: 580px; }
	.nctd-entete { padding: 16px 16px 12px; }
	.nctd-fil { padding: 16px 12px; }
	.nctd-corps { max-width: 88%; }
	.nctd-identite { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.nctd * { animation: none !important; transition: none !important; }
}
