*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #ffffff;
  --text: #2d2d2d;
  --text-secondary: #5a5a5a;
  --text-muted: #757575;
  --accent: #171717;
  --accent-dark: #000000;
  --input-underline: rgba(0,0,0,0.12);
  --input-focus: #171717;
  --choice-hover: rgba(0,0,0,0.06);
  --choice-selected: rgba(0,0,0,0.12);
  --separator: rgba(0,0,0,0.08);
  --banner-bg: #f0f0f0;
  --pill-bg: #171717;
  --header-border: #e0e0e0;
}
html { font-size: 13px; }
body {
  margin: 0;
  font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #fafafa;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 1rem;
  -webkit-tap-highlight-color: transparent;
}
/* En embed (iframe Webflow) : supprimer tout scroll interne pour éviter double défilement */
html.embedded {
  overflow: hidden !important;
  height: auto;
  min-height: 100%;
}
html.embedded body {
  overflow: hidden !important;
  height: auto !important;
  min-height: 100%;
}
html.embedded .layout-with-sidebar,
html.embedded .layout-main {
  overflow: visible !important;
  min-height: auto !important;
}
html.embedded .form-wrapper {
  min-height: 100%;
}
/* Header type "Identité et revenus" */
.form-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--header-border);
}
.form-header-back {
  position: absolute;
  left: 12px;
  color: #171717;
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
  margin: -2px -6px;
}
.form-header-back:hover { color: #000000; }
.form-header-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #171717;
  font-family: inherit;
}
/* Bannière participant (fond gris + pill) */
.participant-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: var(--banner-bg);
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
}
.participant-banner-pill {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--pill-bg);
  border-radius: 999px;
}
.participant-tabs-bar {
  margin-bottom: 16px;
}
body.form-vertical .participant-tabs-bar {
  max-width: 640px;
  width: 100%;
}
.home-link {
  position: fixed;
  top: 24px;
  left: 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  z-index: 50;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.home-link:hover {
  color: var(--accent);
  background: var(--choice-hover);
}
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: var(--separator);
  z-index: 100;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-wrapper {
  min-height: 100vh;
  padding: 16px 14px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.step {
  display: none;
  max-width: 520px;
  width: 100%;
  animation: fadeIn 0.5s ease;
}
.step.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.step-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}
.step-number {
  flex-shrink: 0;
  padding: 0;
  background: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Exo 2', sans-serif;
  line-height: 1.3;
  margin: 0;
}
.step-number::after {
  content: ' — ';
  font-weight: 400;
  color: var(--text-muted);
}
.step-title-wrap { flex: 1; min-width: 0; }
.step-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-label::before, .step-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--separator);
}
.step-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  color: var(--accent);
  font-family: 'Exo 2', sans-serif;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.step-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 6px 0 0 0;
}

/* ——— Rendu strict maquette "Informations déclarant" ——— */
/* Palette: fond blanc, titres/sections #171717, labels #333, bordures #DDDDDD, placeholder #AAAAAA */
body.form-vertical.form-started .participant-block .step-header {
  margin-bottom: 0;
}
body.form-vertical.form-started .participant-block .step-number {
  display: none;
}
body.form-vertical.form-started .participant-block .step-number::after {
  display: none;
}
body.form-vertical.form-started .participant-block .step-title {
  font-size: 0.9rem;
  font-weight: 400;
  color: #333333;
  line-height: 1.35;
  margin: 0 0 10px 0;
}
body.form-vertical.form-started .participant-block .input-wrap {
  margin-top: 0;
  margin-bottom: 0;
}
body.form-vertical.form-started .participant-block .step {
  margin-bottom: 16px;
}
body.form-vertical.form-started .participant-block .step:last-child {
  margin-bottom: 0;
}
body.form-vertical.form-started .participant-block input[type="number"],
body.form-vertical.form-started .participant-block input[type="text"],
body.form-vertical.form-started .participant-block input[type="date"],
body.form-vertical.form-started .participant-block select,
body.form-vertical.form-started .participant-block textarea {
  width: 100%;
  max-width: 360px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 400;
  background: #FFFFFF;
  border: 1px solid #DDDDDD;
  border-radius: 4px;
  color: #333333;
  box-shadow: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
body.form-vertical.form-started .participant-block input:focus,
body.form-vertical.form-started .participant-block select:focus,
body.form-vertical.form-started .participant-block textarea:focus {
  outline: none;
  border-color: #171717;
  box-shadow: none;
}
body.form-vertical.form-started .participant-block select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 12 12'%3E%3Cpath fill='%23666666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  appearance: none;
}
body.form-vertical.form-started .participant-block input::placeholder,
body.form-vertical.form-started .participant-block textarea::placeholder {
  color: #AAAAAA;
  font-size: 0.9rem;
}
body.form-vertical.form-started .participant-block .input-suffix {
  margin-left: 6px;
  font-size: 0.85rem;
  color: #555555;
}
.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.choice {
  display: block;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--input-underline);
  border-radius: 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  transition: all 0.2s ease;
  color: var(--text);
}
.choice:hover {
  background: var(--choice-hover);
  border-bottom-color: var(--accent);
}
.choice.selected {
  background: var(--choice-selected);
  border-bottom-color: var(--accent);
}
.choice {
  position: relative;
}
.choice input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.input-wrap {
  margin-top: 12px;
}
input[type="number"],
input[type="text"],
input[type="date"],
select {
  width: 100%;
  max-width: 400px;
  padding: 8px 0;
  font-size: 0.9rem;
  font-family: inherit;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--input-underline);
  border-radius: 0;
  color: var(--text);
  transition: border-color 0.2s;
}
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23171717' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 22px;
}
input:focus, select:focus {
  outline: none;
  border-bottom-color: var(--input-focus);
}
input::placeholder { color: var(--text-muted); }
select option { background: #fff; color: var(--text); }
.input-suffix { margin-left: 4px; color: var(--text-muted); font-size: 0.8rem; }
.report-branding-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}
.agency-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
}
.agency-name-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.agency-name-input {
  padding: 8px 12px;
  border: 1px solid var(--separator);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
}
.agency-name-input::placeholder {
  color: var(--text-muted);
}
.nav-buttons-with-logo {
  align-items: center;
  gap: 1rem;
}
.logo-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 12px;
  border: 1px dashed var(--separator);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.logo-upload-label:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.logo-upload-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}
.logo-upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.logo-upload-label.has-logo .logo-upload-hint {
  color: var(--accent);
  font-weight: 500;
}
/* Personalisation du rapport : même format que le questionnaire */
.step-ajout-participant-block .form-section-title {
  margin-top: 32px;
  margin-bottom: 28px;
}
.step-ajout-participant-block .report-personalisation-field {
  margin-bottom: 28px;
}
.step-ajout-participant-block .report-personalisation-field .step-header {
  margin-bottom: 12px;
}
.step-ajout-participant-block .report-personalisation-field .step-title {
  font-size: 0.9rem;
  font-weight: 400;
  color: #333333;
  line-height: 1.35;
  margin: 0;
}
.step-ajout-participant-block .report-personalisation-field .input-wrap {
  margin-top: 0;
  margin-bottom: 0;
}
.step-ajout-participant-block .report-personalisation-field input[type="text"] {
  width: 100%;
  max-width: 360px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 400;
  background: #FFFFFF;
  border: 1px solid #DDDDDD;
  border-radius: 4px;
  color: #333333;
  font-family: inherit;
}
.step-ajout-participant-block .report-personalisation-field input[type="text"]:focus {
  outline: none;
  border-color: #171717;
}
.step-ajout-participant-block .report-personalisation-field input[type="text"]::placeholder {
  color: #AAAAAA;
}
.step-ajout-participant-block .report-personalisation-field .logo-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 10px;
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  border: 1px solid #DDDDDD;
  border-radius: 4px;
  background: #FFFFFF;
  font-size: 0.9rem;
  color: #333333;
  cursor: pointer;
}
.step-ajout-participant-block .report-personalisation-field .logo-upload-label:hover {
  border-color: #171717;
}
.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-cta {
  background: var(--accent);
  color: #fff;
  border-radius: 9999px;
}
.btn-cta:hover { background: var(--accent-dark); }
.btn-cta::after {
  content: '';
  width: 22px;
  height: 22px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23171717' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7'/%3E%3Cpath d='M17 7v6M17 7h-6'/%3E%3C/svg%3E") center/10px no-repeat;
  border-radius: 50%;
  flex-shrink: 0;
}
.btn-next {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn-next:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
#btn-rapport-newgen {
  background: #000 !important;
  border-color: #000 !important;
}
#btn-rapport-newgen:hover {
  background: #1a1a1a !important;
  border-color: #1a1a1a !important;
}
.btn-next:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-back {
  background: transparent;
  color: #171717;
  border: 1px solid #171717;
}
.btn-back:hover { background: #171717; color: #fff; }
.required { color: #ef4444; }
.step-skip { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.step-skip a:hover { color: var(--accent); text-decoration: underline; }
.step[data-step="0"] { text-align: center; }
.step[data-step="0"] .step-label::before, .step[data-step="0"] .step-label::after { flex: 1; max-width: 80px; margin: 0 auto; }
.step[data-step="0"] .nav-buttons { justify-content: center; }
.btn-add-participant {
  background: transparent !important;
  color: #171717 !important;
  border: 1px solid #171717 !important;
}
.btn-add-participant:hover { background: #171717 !important; color: #fff !important; border-color: #171717 !important; }
.btn-voir-rapport { background: #000 !important; color: #fff !important; border: 1px solid #000 !important; }
.btn-voir-rapport:hover { background: #2d2d2d !important; border-color: #2d2d2d !important; }
.btn-outline {
  background: transparent;
  color: var(--accent, #171717);
  border: 1px solid var(--accent, #171717);
}
.btn-outline:hover { background: rgba(0,0,0,0.06); }
.popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.popup-content { background: var(--bg); border: 1px solid var(--separator); border-radius: 8px; padding: 20px; max-width: 340px; width: 90%; box-shadow: 0 8px 28px rgba(0,0,0,0.1); }
.popup-content-chatgpt { max-width: 560px; width: 95%; max-height: 85vh; display: flex; flex-direction: column; }
.popup-header-chatgpt { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.popup-title-chatgpt { margin: 0; font-size: 1.1rem; font-weight: 600; }
.popup-chatgpt-close { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 6px; color: var(--text-muted, #666); }
.popup-chatgpt-close:hover { color: var(--text, #171717); }
.popup-chatgpt-body { overflow: auto; flex: 1; min-height: 120px; font-size: 13px; }
.popup-chatgpt-pre { margin: 0; padding: 12px; background: #f5f5f5; border-radius: 6px; white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 60vh; overflow: auto; }
.popup-chatgpt-formatted { font-size: 14px; line-height: 1.45; color: #171717; }
.popup-chatgpt-formatted .popup-chatgpt-titre { margin: 0 0 12px; font-size: 1.15rem; font-weight: 700; }
.popup-chatgpt-formatted .popup-chatgpt-section { margin-bottom: 12px; }
.popup-chatgpt-formatted .popup-chatgpt-section h4 { margin: 0 0 6px; font-size: 0.95rem; font-weight: 600; }
.popup-chatgpt-formatted .popup-chatgpt-text { margin: 0; }
.popup-chatgpt-markdown .popup-chatgpt-h2 { margin: 0.5em 0 0.2em; font-size: 1.2rem; font-weight: 700; }
.popup-chatgpt-markdown .popup-chatgpt-h2:first-child { margin-top: 0; }
.popup-chatgpt-markdown .popup-chatgpt-h3 { margin: 0.4em 0 0.15em; font-size: 1rem; font-weight: 600; }
.nav-buttons-with-logo { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.test-scenario-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #f0f4f8;
  border-radius: 8px;
  font-size: 14px;
}
.test-scenario-bar label { font-weight: 500; color: #475569; }
.test-scenario-bar select {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  min-width: 220px;
}
.test-scenario-bar .btn-test-debug {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
}
.test-scenario-bar .btn-test-debug:first-of-type {
  margin-left: auto;
}
.test-scenario-bar .btn-test-debug:hover {
  background: #e2e8f0;
  border-color: #64748b;
  color: #334155;
}
.popup-nom-label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.popup-nom-input { width: 100%; padding: 10px 12px; font-size: 0.9rem; border: 1px solid var(--input-underline); border-radius: 6px; background: #fff; color: var(--text); font-family: inherit; }
.popup-nom-input:focus { outline: none; border-color: var(--accent); }
.popup-nom-input.invalid { border-color: #ef4444; }
.popup-nom-error { margin: 8px 0 0; font-size: 14px; color: #ef4444; display: none; }
.popup-conjoint-buttons { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.popup-conjoint-buttons button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; font-size: 14px; font-weight: 400; font-family: inherit;
  border: 1px solid #171717; border-radius: 8px; cursor: pointer;
  background: transparent; color: #171717; transition: background 0.2s, color 0.2s;
}
.popup-conjoint-buttons button:hover { background: #171717; color: #fff; }
.participant-tabs-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.go-to-question-wrap { margin-bottom: 32px; display: flex; align-items: center; max-width: 640px; width: 100%; }
.go-to-question-select { padding: 10px 16px; font-size: 13px; font-family: inherit; border: 1px solid var(--input-underline); border-radius: 6px; background: rgba(255,255,255,0.8); color: var(--text-muted); width: 100%; max-width: 320px; cursor: pointer; font-weight: 400; }
.go-to-question-select:hover { border-color: var(--accent); color: var(--text-secondary); }
.go-to-question-select:focus { border-color: var(--accent); color: var(--text); outline: none; }
.add-participant-wrap { margin: 48px 0 12px 0; }
.add-participant-wrap .btn-add-participant,
body.form-vertical .step-ajout-participant-block .nav-buttons .btn-next {
  padding: 10px 20px;
  font-size: 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.participant-tab-btn { padding: 8px 16px; font-size: 0.85rem; font-weight: 500; background: rgba(0,0,0,0.08); border: 1px solid rgba(0,0,0,0.35); border-radius: 8px; color: var(--text); cursor: pointer; font-family: inherit; }
.participant-tab-btn:hover { background: rgba(0,0,0,0.14); }
.participant-tab-btn.active { background: rgba(0,0,0,0.18); border-color: var(--accent); color: var(--accent); }

/* ——— Responsive mobile (formulaire + contenu) ——— */
@media (max-width: 1024px) {
  html { -webkit-text-size-adjust: 100%; font-size: 14px; }
  body { overflow-x: hidden; }
  .form-header { min-height: 48px; padding: 10px 12px; }
  .form-header-title { font-size: 1rem; }
  .form-header-back { left: 12px; font-size: 1.2rem; }
  .home-link { top: 12px; left: 12px; font-size: 0.75rem; padding: 6px 10px; }
  .form-wrapper {
    padding: 12px 12px 48px;
    padding-top: 12px;
  }
  .participant-banner { padding: 10px 14px; margin-bottom: 14px; border-radius: 10px; }
  .participant-banner-pill { font-size: 0.7rem; padding: 3px 8px; }
  .step {
    max-width: 100%;
    width: 100%;
  }
  .step-header { flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .step-number { font-size: 0.8rem; }
  .step-title { font-size: 0.95rem; }
  .step-desc { font-size: 0.8rem; margin-top: 8px; }
  .input-wrap { margin-top: 14px; }
  input[type="number"],
  input[type="text"],
  input[type="date"],
  select {
    max-width: 100%;
    width: 100%;
    padding: 8px 0;
    font-size: 0.9rem;
  }
  .input-suffix {
    display: block;
    margin-left: 0;
    margin-top: 4px;
    font-size: 0.8rem;
  }
  .nav-buttons {
    margin-top: 20px;
    flex-direction: column;
    gap: 10px;
  }
  .nav-buttons .btn {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    font-size: 0.85rem;
  }
  .go-to-question-wrap { max-width: 100%; margin-bottom: 14px; }
  .go-to-question-select { max-width: 100%; font-size: 0.8rem; }
  .participant-tabs-bar { flex-direction: column; }
  .participant-tab-btn { width: 100%; min-height: 40px; font-size: 0.8rem; }
  .popup-content { width: 95%; padding: 18px; }
  .popup-conjoint-buttons { flex-direction: column; }
  .popup-conjoint-buttons button { width: 100%; min-height: 42px; font-size: 0.85rem; }
  /* Test scenario bar */
  .test-scenario-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    margin-bottom: 12px;
    gap: 10px;
  }
  .test-scenario-bar label { width: 100%; }
  .test-scenario-bar select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .test-scenario-bar .btn-test-debug { margin-left: 0; width: 100%; }
  /* Add participant buttons */
  .add-participant-wrap {
    margin: 24px 0 12px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .add-participant-wrap .btn-add-participant {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  /* Report branding row */
  .report-branding-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
  }
  .agency-name-wrap { min-width: 0; width: 100%; }
  .agency-name-input { width: 100%; }
  /* Participant block titles */
  .participant-block-title {
    font-size: 1.15rem;
    padding: 12px 14px;
    margin-bottom: 14px;
  }
  /* Form vertical inputs */
  body.form-vertical.form-started .participant-block input[type="number"],
  body.form-vertical.form-started .participant-block input[type="text"],
  body.form-vertical.form-started .participant-block input[type="date"],
  body.form-vertical.form-started .participant-block select,
  body.form-vertical.form-started .participant-block textarea {
    max-width: 100%;
  }
  /* Choices */
  .choice { padding: 12px 0; font-size: 0.9rem; }
  /* Nav buttons with logo */
  .nav-buttons-with-logo { flex-direction: column; }
  .nav-buttons-with-logo .btn { width: 100%; min-height: 44px; }
  /* Participant block appended */
  .participant-block-appended { margin-top: 24px; padding-top: 20px; }
}
/* ——— Très petits écrans (mobile) ——— */
@media (max-width: 480px) {
  html { font-size: 13px; }
  .layout-main { padding: 10px 10px 1.5rem; }
  body.form-vertical .form-wrapper { padding: 0 10px 40px; }
  .participant-block-title { font-size: 1.05rem; padding: 10px 12px; }
  .form-section-title { font-size: 0.95rem; }
  body.form-vertical.form-started .participant-block .step-title { font-size: 0.85rem; }
}


/* ——— Layout type référence : barre bleue en haut + panneau courbé + zone blanche ——— */
.layout-top-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px 12px 440px;
  background: #171717;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
}
.layout-top-bar-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.layout-top-bar-icon:hover {
  opacity: 0.85;
}
.layout-top-bar-title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  font-family: inherit;
  text-align: center;
  max-width: 420px;
}
.layout-top-bar-title a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}
.layout-top-bar-title a:hover {
  opacity: 0.9;
}
.layout-with-sidebar {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 52px);
  background: #FFFFFF;
  position: relative;
}
/* Panneau gauche fixe : courbe concave continue (style zelok) via clip-path */
.layout-sidebar {
  position: fixed;
  left: 0;
  top: 52px;
  width: 440px;
  height: calc(100vh - 52px);
  background: #171717;
  flex-shrink: 0;
  clip-path: url(#sidebar-concave-clip);
  -webkit-clip-path: url(#sidebar-concave-clip);
  overflow: hidden;
  z-index: 10;
}
.layout-sidebar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
}
.layout-sidebar-title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  line-height: 1.3;
  font-family: inherit;
}
.layout-sidebar-title a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}
.layout-sidebar-title a:hover {
  opacity: 0.9;
}
/* Zone centrale : une seule barre de défilement (la page entière défile) */
.layout-main {
  flex: 1;
  min-width: 0;
  margin-left: 440px;
  background: #FFFFFF;
  padding: 0 1.5rem 3rem;
  overflow-x: hidden;
  overflow-y: visible;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.layout-main .form-wrapper {
  width: 100%;
  max-width: 420px;
}
.form-top-encart {
  background: transparent;
  padding: 1.5rem 0 1.25rem;
  margin: 0;
  border: none;
  border-radius: 0;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}
.form-top-encart-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #171717;
  font-family: inherit;
  text-align: center;
}
.form-top-encart-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: #555555;
  line-height: 1.4;
  text-align: center;
}
@media (max-width: 1024px) {
  .layout-top-bar {
    min-height: 48px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .layout-top-bar-title { font-size: 1.1rem; }
  .layout-top-bar-icon { right: 12px; }
  .layout-with-sidebar { min-height: calc(100vh - 48px); flex-direction: column; }
  .layout-sidebar {
    display: none !important;
  }
  .layout-main {
    margin-left: 0;
    max-height: none;
    padding: 12px 12px 2rem;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  .layout-main .form-wrapper {
    margin-left: 0 !important;
    width: 100%;
    max-width: 100%;
  }
  body.form-vertical .form-wrapper {
    padding: 0 12px 48px !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .form-top-encart { padding: 1rem 0 1rem; }
  .form-top-encart-title { font-size: 1.05rem; }
  .form-top-encart-subtitle { font-size: 0.8rem; }
}

/* ——— Formulaire vertical : questionnaire direct ——— */
body.form-vertical .progress-bar { display: none; }
body.form-vertical .form-header { display: none; }
body.form-vertical .form-wrapper {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0 0 60px;
  max-width: 100%;
}
body.form-vertical.form-started {
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.form-vertical.form-started .layout-top-bar {
  flex-shrink: 0;
}
body.form-vertical.form-started .form-wrapper {
  justify-content: flex-start;
  padding: 0 0 60px;
  min-height: auto;
  background: transparent;
}
body.form-vertical.form-started .participant-banner {
  margin-top: 12px;
}
body.form-vertical .form-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
body.form-vertical .form-wrapper form {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  align-items: stretch;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
body.form-vertical .form-wrapper form > .step,
body.form-vertical .form-wrapper form > .participant-block {
  width: 100%;
  max-width: 100%;
}
/* Questionnaire affiché directement (plus de page bienvenue) */
body.form-vertical .step {
  display: block !important;
  margin-bottom: 14px;
  padding-bottom: 0;
  border-bottom: none;
}
body.form-vertical .step.step-hidden-vertical {
  display: none !important;
}
body.form-vertical .step:last-child { margin-bottom: 0; padding-bottom: 0; }
body.form-vertical #step-lien { display: none !important; }
body.form-vertical .step .nav-buttons { display: none; }
body.form-vertical .step-ajout-participant-block .nav-buttons { display: flex !important; }
.participant-tab-btn { padding: 4px 10px; font-size: 0.75rem; }
.participant-block-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  background: #171717;
  margin: 0 0 18px 0;
  padding: 14px 18px 14px 18px;
  border-radius: 6px;
  text-align: left;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.form-section-title {
  margin: 0 0 12px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  font-weight: 700;
  color: #171717;
  font-family: inherit;
  text-align: left;
}
.form-section-title:first-child {
  border-top: none;
  padding-top: 0;
}
/* Espace entre le titre principal (sidebar) et la première section */
body.form-vertical .form-wrapper form > .participant-block:first-child .participant-block-title:first-child {
  margin-top: 1.75rem;
}
.participant-block-appended {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid rgba(0,0,0,0.12);
}

/* ——— Encart rapport (simulation page web) + Télécharger PDF ——— */
#report-encart.report-preview-encart {
  display: none !important;
  visibility: hidden !important;
}
.report-preview-encart {
  width: 100%;
  max-width: 100%;
  margin-top: 2rem;
  margin-bottom: 2rem;
  margin-left: 0;
  margin-right: 0;
  background: #f4f5f7;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  align-self: stretch;
  flex-shrink: 0;
}
.report-preview-frame-wrap {
  background: #fff;
  margin: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: visible;
}
.report-preview-encart iframe {
  display: block;
  width: 100%;
  min-height: 600px;
  border: none;
  border-radius: 8px;
  vertical-align: top;
}
.report-preview-actions {
  padding: 1rem 12px 1.25rem;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.report-preview-encart .btn-download-pdf {
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.report-preview-encart .btn-download-pdf:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.report-preview-encart.report-preview-encart-visible {
  display: block !important;
  visibility: visible !important;
}
.report-preview-encart.report-preview-encart-visible .report-preview-frame-wrap {
  display: none !important;
}
.report-preview-encart .report-preview-actions {
  padding: 1.25rem 12px 1.5rem;
}

/* ——— Mobile : overrides finaux (après form-vertical) ——— */
@media (max-width: 1024px) {
  body.form-vertical .form-wrapper {
    padding: 0 12px 48px !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  body.form-vertical .form-wrapper form,
  body.form-vertical .form-wrapper form > * {
    max-width: 100% !important;
    min-width: 0 !important;
  }
  body.form-vertical .form-wrapper {
    overflow-x: hidden;
  }
  #tf-form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  body.form-vertical.form-started .participant-block input[type="number"],
  body.form-vertical.form-started .participant-block input[type="text"],
  body.form-vertical.form-started .participant-block input[type="date"],
  body.form-vertical.form-started .participant-block select,
  body.form-vertical.form-started .participant-block textarea {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  .layout-main {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
  }
  .layout-main .form-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .layout-with-sidebar {
    width: 100%;
    min-width: 0;
  }
  body.form-vertical.form-started {
    overflow-x: hidden;
  }
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1b1f;
  color: #fff;
  padding: 20px 40px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-family: 'Exo 2', sans-serif;
  font-size: 14px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
html.embedded .cookie-banner { display: none !important; }
.cookie-banner.hidden { display: none; }
.cookie-banner-text { flex: 1; min-width: 280px; }
.cookie-banner-text a { color: #1a1b1f; text-decoration: none; }
.cookie-banner-text a:hover { text-decoration: underline; }
.cookie-banner-btns { display: flex; gap: 12px; flex-shrink: 0; }
.cookie-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Exo 2', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.cookie-btn-accept { background: #1a1b1f; color: #fff; }
.cookie-btn-accept:hover { background: #32343a; }
.cookie-btn-refuse {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.4);
}
.cookie-btn-refuse:hover { background: rgba(255,255,255,0.1); }
