/* Pop-up de l'étude de marché (sondage.js). Jetons de tokens.css uniquement. */
:root { --surface-sondage: color-mix(in srgb, var(--fg) 4%, var(--bg)); }
html.sondage-ouvert { overflow: hidden; scrollbar-gutter: stable; }

.sondage {
  width: min(440px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--sp-3));
  padding: 0; margin: auto;
  color: var(--fg); background: var(--surface-sondage);
  border: var(--hair) solid var(--hairline); border-radius: var(--radius);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .65);
  font-family: var(--font-body);
}
.sondage::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(2px); }
.sondage[open] { animation: sondage-entree .28s ease-out; }
.sondage[data-etat="formulaire"] { width: min(720px, calc(100vw - 2 * var(--gutter))); height: min(760px, calc(100dvh - 2 * var(--sp-3))); }

.sondage__etat { position: relative; padding: var(--sp-3); }
.sondage__etat--invitation > .sondage__kicker { padding-inline-end: 40px; } /* place de la croix */
.sondage__etat--formulaire { display: flex; flex-direction: column; height: 100%; padding: 0; }
.sondage__etat[hidden] { display: none; }

.sondage__kicker {
  display: flex; gap: var(--sp-1); align-items: center; margin: 0;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--uv);
}
.sondage__point { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--snare); box-shadow: 0 0 8px var(--snare); animation: sondage-pouls 2.4s ease-in-out infinite; }
.sondage__titre { margin: var(--sp-2) 0 var(--sp-1); font-family: var(--font-display); font-size: clamp(22px, 4vw, 28px); line-height: 1.05; }
.sondage__corps { margin: 0; line-height: 1.55; color: color-mix(in srgb, var(--fg) 85%, var(--bg)); }
.sondage__meta { margin: var(--sp-2) 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.sondage__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); }
.sondage__lien { padding: 0; border: 0; background: none; color: var(--dim); font: inherit; text-decoration: underline; cursor: pointer; }
.sondage__lien:hover, .sondage__lien:focus-visible { color: var(--fg); }
.sondage__croix {
  position: absolute; inset-block-start: var(--sp-1); inset-inline-end: var(--sp-1);
  width: 40px; height: 40px; border: 0; background: none; color: var(--dim); font-size: 16px; cursor: pointer;
}
.sondage__croix:hover, .sondage__croix:focus-visible { color: var(--fg); }

.sondage__tete { position: relative; display: flex; align-items: center; justify-content: space-between; padding: var(--sp-2) var(--sp-3); border-bottom: var(--hair) solid var(--hairline); }
.sondage__tete .sondage__croix { position: static; }
.sondage__cadre { flex: 1; min-height: 0; background: var(--bg); }
.sondage__cadre iframe { display: block; width: 100%; height: 100%; border: 0; }
.sondage__secours { display: block; padding: var(--sp-1) var(--sp-3) var(--sp-2); font-size: 12px; color: var(--dim); }
.sondage__secours:hover, .sondage__secours:focus-visible { color: var(--fg); }

.sondage-pastille {
  position: fixed; z-index: 40; /* sous .site-header (50) et sa nav mobile */
  inset-inline-start: var(--sp-2); inset-block-end: calc(var(--sp-2) + env(safe-area-inset-bottom, 0px));
  display: inline-flex; gap: var(--sp-1); align-items: center; max-width: calc(100vw - 2 * var(--sp-2));
  padding: 10px 14px; border: var(--hair) solid var(--hairline); border-radius: 999px;
  background: var(--surface-sondage); color: var(--fg); font: 500 13px/1.2 var(--font-body);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); cursor: pointer;
}
.sondage-pastille[hidden], body.nav-open .sondage-pastille { display: none; }
.sondage-pastille { transition: opacity .18s ease, visibility 0s; }
/* visibility : sort aussi la pastille de l'ordre de tabulation pendant qu'elle est cachée. */
.sondage-pastille--discrete { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s ease, visibility 0s .18s; }
.sondage-pastille:hover, .sondage-pastille:focus-visible { border-color: var(--uv); }
.sondage-pastille__suite, .sondage-pastille__fleche { color: var(--dim); }
[dir="rtl"] .sondage-pastille__fleche { transform: scaleX(-1); }

:root:is(:lang(hi), :lang(bn), :lang(ar), :lang(ur)) .sondage__titre { line-height: 1.3; }

/* main.css cache le pointeur natif (cursor:none!important) quand le curseur maison est actif ;
   le <dialog> modal passe au-dessus de ce curseur (couche supérieure) : rendre le natif. */
@media (hover: hover) and (pointer: fine) {
  html.krkn-cursor-enabled:not(.krkn-cursor-native) :is(.sondage, .sondage *) { cursor: auto !important; }
  html.krkn-cursor-enabled:not(.krkn-cursor-native) .sondage :is(button, a[href]) { cursor: pointer !important; }
}
/* Le curseur maison (.krkn-cursor, ui.js) reste dessous la couche supérieure : le cacher. */
html.sondage-ouvert .krkn-cursor { display: none !important; }

@media (max-width: 860px) {
  .sondage[data-etat="formulaire"] { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
}
@media (max-width: 480px) {
  .sondage-pastille__suite { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sondage[open], .sondage__point { animation: none; }
  .sondage-pastille { transition: none; }
}
@keyframes sondage-entree { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes sondage-pouls { 50% { opacity: .45; } }
