/* ── Variables ── */
:root {
  --c1: #4F46E5;
  --c2: #7C3AED;
  --bg: #f0f2ff;
  --card: #ffffff;
  --text: #1e1e2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(79,70,229,.12);
  --font: 'Outfit', 'Segoe UI', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

body.pub-body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
}

/* ── Background Orbs ── */
.pub-bg {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.bg-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35;
}
.orb1 {
  width: 600px; height: 600px; top: -200px; right: -150px;
  background: radial-gradient(circle, var(--c1), transparent 70%);
}
.orb2 {
  width: 500px; height: 500px; bottom: -150px; left: -100px;
  background: radial-gradient(circle, var(--c2), transparent 70%);
}

/* ── Wrap ── */
.pub-wrap {
  position: relative; z-index: 1;
  width: 100%; max-width: 720px;
  margin: 0 auto; padding: 2rem 1rem 4rem;
}
.pub-wrap-q { max-width: 760px; }

/* ── Header ── */
.pub-header { text-align: center; padding: 3rem 0 2rem; }
.pub-logo { max-height: 64px; margin-bottom: 1.5rem; border-radius: 12px; }
.pub-logo-sm { max-height: 48px; }
.pub-titre {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: .5rem; line-height: 1.2;
}
.pub-sous-titre { color: var(--muted); font-size: 1.1rem; }

/* ── Cards ── */
.card { background: var(--card); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.card-empty { text-align: center; padding: 4rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

/* ── Form ── */
.pub-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-section {
  background: var(--card); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow);
}
.section-title {
  font-size: 1.1rem; font-weight: 600; margin-bottom: 1.5rem;
  color: var(--c1); letter-spacing: -.01em;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.full-width { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-weight: 500; font-size: .9rem; color: var(--text); }
.field input, .field textarea, .field select {
  width: 100%; padding: .75rem 1rem;
  border: 2px solid var(--border); border-radius: 10px;
  font-family: var(--font); font-size: 1rem; color: var(--text);
  background: #fafbff; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--c1); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.field.has-error input, .field.has-error textarea { border-color: #ef4444; }
.field-error { color: #ef4444; font-size: .83rem; }
.req { color: #ef4444; }

/* ── Questionnaire select cards ── */
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.q-card { cursor: pointer; }
.q-card input[type=radio] { display: none; }
.q-card-inner {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.5rem; border: 2px solid var(--border); border-radius: 12px;
  text-align: center; transition: all .2s; background: #fafbff;
}
.q-card input:checked + .q-card-inner {
  border-color: var(--c1); background: rgba(79,70,229,.08);
  box-shadow: 0 0 0 3px rgba(79,70,229,.2);
}
.q-card-icon { font-size: 2rem; }
.q-card-title { font-weight: 600; }
.q-card-desc { color: var(--muted); font-size: .85rem; }

/* ── Start Button ── */
.form-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; padding-top: .5rem; }
.btn-start {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 1rem 2.5rem; border-radius: 50px; border: none; cursor: pointer;
  font-family: var(--font); font-size: 1.05rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 4px 20px rgba(79,70,229,.4); transition: all .2s;
  text-decoration: none;
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(79,70,229,.5); }
.btn-arrow { transition: transform .2s; }
.btn-start:hover .btn-arrow { transform: translateX(4px); }
.btn-back {
  padding: .9rem 2rem; border-radius: 50px; border: 2px solid var(--border);
  font-family: var(--font); font-size: 1rem; font-weight: 500; color: var(--muted);
  text-decoration: none; transition: all .2s; background: #fff;
}
.btn-back:hover { border-color: var(--c1); color: var(--c1); }

/* ── Progress ── */
.q-header { background: var(--card); border-radius: var(--radius); padding: 1.5rem 2rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.q-titre { font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem; }
.progress-wrap { display: flex; align-items: center; gap: 1rem; }
.progress-bar { flex: 1; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--c1), var(--c2)); border-radius: 99px; transition: width .4s ease; }
.progress-label { font-size: .85rem; color: var(--muted); white-space: nowrap; font-weight: 500; }

/* ── Question Intro ── */
.q-intro-box {
  background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(124,58,237,.08));
  border: 1px solid rgba(79,70,229,.2); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1.5rem; line-height: 1.7; color: var(--text);
}

/* ── Question Block ── */
.q-form { display: flex; flex-direction: column; gap: 1.5rem; }
.q-block {
  display: flex; gap: 1.5rem;
  background: var(--card); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow);
}
.q-block-error { border: 2px solid #ef4444; }
.q-block-single { }
.q-number {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
}
.q-content { flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.q-question { font-size: 1.15rem; font-weight: 600; line-height: 1.4; }
.q-desc { color: var(--muted); font-size: .9rem; }

/* ── Inputs ── */
.q-input {
  width: 100%; padding: .75rem 1rem; border: 2px solid var(--border); border-radius: 10px;
  font-family: var(--font); font-size: 1rem; background: #fafbff; color: var(--text);
  outline: none; transition: border-color .2s;
}
.q-input:focus { border-color: var(--c1); }
.q-textarea { resize: vertical; min-height: 120px; }
.q-input-sm { max-width: 220px; }

/* ── Radio / Checkbox ── */
.q-options { display: flex; flex-direction: column; gap: .6rem; }
.q-option {
  display: flex; align-items: center; gap: .75rem; cursor: pointer;
  padding: .75rem 1rem; border: 2px solid var(--border); border-radius: 10px;
  transition: all .15s; background: #fafbff;
}
.q-option:hover { border-color: var(--c1); background: rgba(79,70,229,.05); }
.q-option input { display: none; }
.q-opt-mark {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
  flex-shrink: 0; transition: all .15s;
}
.q-opt-check { border-radius: 4px; }
.q-option:has(input:checked) { border-color: var(--c1); background: rgba(79,70,229,.08); }
.q-option:has(input:checked) .q-opt-mark {
  background: var(--c1); border-color: var(--c1);
}
.q-option:has(input:checked) .q-opt-mark::after {
  content: '✓'; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .7rem; width: 100%; height: 100%;
}
.q-opt-label { font-weight: 500; }

/* ── Oui/Non ── */
.q-oui-non-wrap { display: flex; gap: 1rem; }
.q-oui-non {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 1rem; border: 2px solid var(--border); border-radius: 12px;
  font-weight: 600; font-size: 1.1rem; cursor: pointer; transition: all .15s;
}
.q-oui-non:has(input:checked) { border-color: var(--c1); background: rgba(79,70,229,.08); color: var(--c1); }
.q-oui-non input { display: none; }

/* ── Couleurs ── */
.q-colors { display: flex; flex-wrap: wrap; gap: 1rem; }
.q-color-swatch { cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.q-color-swatch input { display: none; }
.color-dot {
  width: 48px; height: 48px; border-radius: 50%; border: 3px solid transparent;
  transition: all .15s; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.q-color-swatch:has(input:checked) .color-dot { border-color: var(--text); transform: scale(1.15); }
.color-label { font-size: .78rem; color: var(--muted); }
.q-color-native { width: 80px; height: 48px; border: none; border-radius: 10px; cursor: pointer; }

/* ── Images ── */
.q-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.q-image-opt { cursor: pointer; }
.q-image-opt input { display: none; }
.q-img-wrap {
  border: 3px solid var(--border); border-radius: 12px; overflow: hidden;
  transition: all .15s; background: #fafbff;
}
.q-img-wrap img { width: 100%; height: 120px; object-fit: cover; display: block; }
.q-img-label { display: block; text-align: center; padding: .4rem; font-size: .82rem; font-weight: 500; }
.q-image-opt:has(input:checked) .q-img-wrap {
  border-color: var(--c1); box-shadow: 0 0 0 3px rgba(79,70,229,.3);
}

/* ── Étoiles ── */
.q-stars { display: flex; gap: .25rem; flex-direction: row-reverse; justify-content: flex-end; }
.q-star { cursor: pointer; font-size: 2rem; }
.q-star input { display: none; }
.q-star span { color: #d1d5db; transition: color .1s; }
.q-star:hover span,
.q-star:hover ~ .q-star span,
.q-star:has(input:checked) span,
.q-star:has(input:checked) ~ .q-star span { color: #f59e0b; }

/* ── Slider ── */
.q-echelle { display: flex; flex-direction: column; gap: .75rem; }
.q-slider {
  width: 100%; accent-color: var(--c1); height: 6px; cursor: pointer;
}
.q-slider-val {
  text-align: center; font-size: 1.8rem; font-weight: 700; color: var(--c1);
}
.q-slider-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.q-actions { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; flex-wrap: wrap; gap: 1rem; }

/* ── Merci ── */
.merci-card {
  background: var(--card); border-radius: var(--radius); padding: 4rem 2rem;
  box-shadow: var(--shadow); text-align: center; margin-top: 4rem;
}
.merci-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: #fff; margin: 0 auto 1.5rem; font-weight: 700;
}
.merci-titre { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
.merci-message { font-size: 1.1rem; line-height: 1.8; color: var(--muted); max-width: 480px; margin: 0 auto 2rem; }
.merci-contact { margin-bottom: 2rem; color: var(--muted); }
.merci-contact a { color: var(--c1); }

/* ── Flash ── */
.flash { border-radius: 10px; padding: .9rem 1.25rem; margin-bottom: 1rem; font-weight: 500; }
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Footer ── */
.pub-footer { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 3rem; }
.pub-footer a { color: var(--c1); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .q-block { flex-direction: column; gap: 1rem; }
  .q-grid { grid-template-columns: 1fr; }
  .pub-header { padding: 2rem 0 1.5rem; }
  .q-oui-non-wrap { flex-direction: column; }
}
