/* =========================================================
   The Experientist — design system
   Épuré, scientifique, place pour l'émotion.
   ========================================================= */

:root {
  /* V2 — Beige + Marron foncé + Blanc */
  --bg:        #dfdbce;     /* Fond beige clair */
  --bg-tint:   #ede9dd;     /* Beige un peu plus clair */
  --bg-card:   #FFFFFF;     /* Blanc pur */
  --ink:       #2d2c29;     /* Marron très foncé */
  --ink-soft:  #3f3e3a;     /* Marron un peu plus clair */
  --ink-mute:  #8a8985;     /* Gris moyen */
  --line:      #e8e4d7;     /* Gris très clair */

  /* Anthracite (comme le texte) */
  --sage:        #3f3e3a;   /* Anthracite clair */
  --sage-deep:   #2d2c29;   /* Anthracite foncé */
  --sage-ghost:  rgba(45, 44, 41, 0.15);

  /* Type — Plus Jakarta Sans : ronde, géométrique, scientifique */
  --font-sans:  'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Rythme */
  --radius:    16px;
  --radius-s:  10px;
  --radius-xs: 8px;

  /* Easing */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #3d3c38;     /* Fond gris foncé */
    --bg-tint:  #4a4945;     /* Un peu plus clair */
    --bg-card:  #FFFFFF;     /* Blanc pur */
    --ink:      #dfdbce;     /* Beige clair (inverse du jour) */
    --ink-soft: #ede9dd;     /* Un peu plus clair */
    --ink-mute: #8a8985;     /* Gris moyen */
    --line:     #555349;     /* Gris foncé */
    --sage:     #dfdbce;     /* Beige clair */
    --sage-deep:#ede9dd;     /* Beige plus clair */
    --sage-ghost: rgba(223, 219, 206, 0.20);
  }
}

* { box-sizing: border-box; }

/* L'attribut [hidden] doit toujours masquer, même quand l'élément a
   un display:flex/grid déclaré par ailleurs. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--sage-ghost), transparent 60%);
}

button, input, textarea, select { font-family: inherit; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  padding: 28px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand__mark {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--sage);
  display: inline-block;
  box-shadow: 0 0 0 5px var(--sage-ghost);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}

.brand:hover .brand__mark {
  transform: scale(1.1);
  box-shadow: 0 0 0 7px var(--sage-ghost);
}

/* Toggle langue */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.lang-btn {
  background: none;
  border: none;
  padding: 4px 2px;
  font: inherit;
  font-weight: 600;
  color: var(--ink-mute);
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: color .25s var(--ease);
}

.lang-btn:hover { color: var(--ink-soft); }

.lang-btn.is-active {
  color: var(--ink);
  font-weight: 800;
}

.lang-sep { color: var(--line); }

/* =========================================================
   Stage
   ========================================================= */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 24px 80px;
  text-align: center;
}

/* Hero */
.hero { max-width: 860px; }

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  margin: 0 0 28px;
  opacity: 0;
  transform: translateY(8px);
  animation: rise .9s var(--ease) .1s forwards;
}

.manifesto {
  font-weight: 800;
  font-size: clamp(30px, 5.2vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 0 0 36px;
  color: var(--ink);
}

.manifesto__line {
  display: block;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(14px);
  animation: rise 1s var(--ease) forwards;
}

/* Sur mobile : on autorise le retour à la ligne pour éviter l'overflow */
@media (max-width: 560px) {
  .manifesto__line { white-space: normal; }
}
.manifesto__line:nth-child(1) { animation-delay: .25s; }
.manifesto__line:nth-child(2) { animation-delay: .55s; }

.manifesto__line--accent {
  color: var(--sage-deep);
}

.lede {
  font-size: 17.5px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 1s var(--ease) .9s forwards;
}

.lede__line { display: block; }

/* =========================================================
   Capture — étape 1 (formulaire)
   ========================================================= */
.capture {
  margin-top: 64px;
  width: 100%;
  max-width: 560px;
  text-align: left;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 1s var(--ease) 1.15s forwards;
}

.capture__form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.field__label--large {
  font-size: 20px;
  font-weight: 800;
}

.field__badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--ink-mute);
  border: 1px solid var(--line);
}

.field__hint {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* --- Base commune (placeholders, focus halo) --- */
.field textarea,
.field input[type="email"],
.field input[type="text"] {
  width: 100%;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  border-radius: var(--radius-s);
  line-height: 1.55;
  font-family: inherit;
  transition:
    box-shadow .25s var(--ease),
    background  .25s var(--ease),
    transform   .25s var(--ease);
}

.field textarea::placeholder,
.field input[type="email"]::placeholder,
.field input[type="text"]::placeholder {
  color: var(--ink-mute);
  font-weight: 500;
}

/* --- Champ MESSAGE — primaire, carte blanche --- */
.field textarea {
  background: var(--bg-card);
  padding: 18px 20px;
  min-height: 148px;
  resize: none;
  font-size: 16.5px;
  border-radius: 20px;
}

.field textarea:focus {
  background: var(--bg-card);
  box-shadow: 0 0 0 7px var(--sage-ghost);
}

/* --- Champ EMAIL — blanc comme le message --- */
.field input[type="email"] {
  background: var(--bg-card);
  padding: 13px 16px;
  font-size: 15px;
}

.field input[type="email"]:hover {
  background: var(--bg-card);
}

.field input[type="email"]:focus {
  background: var(--bg-card);
  box-shadow: 0 0 0 7px var(--sage-ghost);
}

/* --- Champ COULEUR — plus spacieux --- */
.field input[type="text"] {
  background: var(--bg-card);
  padding: 18px 20px;
  margin: 16px 0;
  font-size: 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
}

.field input[type="text"]:hover {
  background: var(--bg-card);
}

.field input[type="text"]:focus {
  background: var(--bg-card);
  box-shadow: 0 0 0 7px var(--sage-ghost);
}

/* --- Toggle Switch --- */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.toggle-input {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  background: var(--line);
  border-radius: 999px;
  flex-shrink: 0;
  transition: background .3s var(--ease);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: var(--bg-card);
  border-radius: 999px;
  transition: transform .3s var(--ease);
}

.toggle-input:checked + .toggle-switch {
  background: var(--ink);
}

.toggle-input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

.toggle-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

/* --- Message field animation --- */
#message-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  opacity: 1;
  overflow: hidden;
  /* 8px de marge interieure pour loger le halo de focus (7px) sans
     qu'il soit coupe par overflow:hidden. Compense par des marges
     negatives pour que le textarea reste aligne avec le champ email. */
  padding: 8px;
  margin: -8px -8px 0;
  /* opacity en phase avec le collapse : la case reste visible pendant qu'elle se replie */
  transition:
    max-height 0.6s cubic-bezier(0.42, 0, 0.58, 1),
    opacity 0.6s cubic-bezier(0.42, 0, 0.58, 1),
    padding 0.6s cubic-bezier(0.42, 0, 0.58, 1),
    margin 0.6s cubic-bezier(0.42, 0, 0.58, 1);
}

#message-field.is-hidden {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: -28px;
  pointer-events: none;
}

.capture__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.capture__status {
  min-height: 1.2em;
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #c0392b;
  text-align: right;
}

/* =========================================================
   Boutons
   ========================================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background .25s var(--ease), transform .25s var(--ease);
}

.btn-primary:hover {
  background: var(--sage-deep);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn-primary__arrow {
  transition: transform .3s var(--ease);
  display: inline-block;
}
.btn-primary:hover .btn-primary__arrow { transform: translateX(3px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  color: var(--ink);
  border: 1.5px solid var(--line);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .25s var(--ease), color .25s var(--ease), background .25s var(--ease);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--bg-tint);
}

/* =========================================================
   Modal — friction positive
   ========================================================= */
.modal {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: min(560px, calc(100vw - 32px));
  width: 100%;
  margin: auto;
}

.modal::backdrop {
  background: rgba(20, 20, 15, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal[open].is-revealing {
  z-index: 1000 !important;
}

.modal[open].is-revealing::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal[open] { animation: modal-in .35s var(--ease); }
.modal[open]::backdrop { animation: fade-in .35s var(--ease); }

.is-disabled {
  opacity: 0.25;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}

.question-form-behind {
  position: relative;
}

.modal__panel {
  background: var(--bg);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 24px 64px -16px rgba(20, 20, 15, 0.25);
  text-align: left;
}

.modal__head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.modal__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  background: var(--sage-ghost);
  color: var(--sage-deep);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.modal__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--sage-deep);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.3); opacity: .55; }
}

.modal__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
}

#question-title {
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 32px 0;
  letter-spacing: -0.025em;
  line-height: 1.2;
  width: 100%;
}

.modal__block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--bg-card);
  border-radius: var(--radius-s);
}

.modal__label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
}

.modal__message {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal__email {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}

.modal__check {
  margin: 0;
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--bg-tint);
  border-radius: var(--radius-s);
}

.modal__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.modal__status {
  min-height: 1.2em;
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #c0392b;
}

/* Invitation "pourquoi cette pause" — card désirable */
.why {
  background: var(--sage-ghost);
  border-radius: var(--radius-s);
  transition: background .3s var(--ease);
}

.why:hover { background: rgba(212, 230, 207, 0.65); }

.why__summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.why__summary::-webkit-details-marker { display: none; }

.why__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--sage-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  transition: transform .4s var(--ease);
}

.why:hover .why__icon { transform: rotate(20deg) scale(1.05); }

.why__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.why__line1 {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.why__line2 {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.4;
}

.why__chev {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 20px;
  width: 22px;
  text-align: center;
  color: var(--sage-deep);
  transition: transform .35s var(--ease);
}

.why[open] .why__chev { transform: rotate(45deg); }

.why {
  margin-bottom: 24px;
}

.why__body {
  margin: 0;
  padding: 4px 18px 18px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.65;
  color: var(--ink-soft);
  animation: rise .35s var(--ease);
}

.why__body strong {
  color: var(--ink);
  font-weight: 800;
}

/* =========================================================
   Insight — explication du mécanisme
   ========================================================= */
.question-insight-wrapper {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 520px;
  z-index: 1003;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px 24px;
}

.question-insight-wrapper:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
  animation: insight-appear .6s var(--ease) .4s both;
}

/* Overlay noir qui couvre tout l'écran */
#question.is-revealing::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1001;
  pointer-events: none;
  animation: fade-in .4s var(--ease) .2s both;
}

@keyframes insight-appear {
  from {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}


.insight {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 32px 24px;
}

.insight__card {
  max-width: 520px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
}

.insight__title {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--ink);
}

.insight__body {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.65;
  color: var(--ink-soft);
}

.insight__body strong {
  color: var(--ink);
  font-weight: 700;
}

/* =========================================================
   Thanks — confirmation reçue
   ========================================================= */
.thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 24px;
  background: transparent;
  text-align: center;
  animation: thanks-in .7s var(--ease);
}

.thanks__mark {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: pop-in .55s var(--ease);
}

.thanks__text {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  max-width: 380px;
}

.thanks__sub {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-mute);
  max-width: 360px;
}

/* État "envoi en cours" sur le bouton de confirm */
.btn-primary.is-sending {
  background: var(--sage-deep);
  cursor: progress;
}
.btn-primary.is-sending .btn-primary__arrow {
  animation: nudge 1s var(--ease) infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(4px); }
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  padding: 24px 40px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  border-top: 1px solid var(--line);
}

.site-footer p { margin: 0; }

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1.5px solid var(--line);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}

.site-footer a:hover {
  color: var(--sage-deep);
  border-color: var(--sage-deep);
}

/* =========================================================
   Animations
   ========================================================= */
@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes pop-in {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes thanks-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .eyebrow, .manifesto__line, .lede, .capture { opacity: 1; transform: none; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 640px) {
  .site-header { padding: 20px 22px; }
  .site-footer {
    padding: 20px 22px 28px;
    flex-direction: column;
    text-align: center;
  }
  .stage { padding: 36px 20px 60px; }
  .capture { margin-top: 44px; }
  .modal__panel { padding: 24px; gap: 18px; }
  .modal__title { font-size: 21px; }
  .modal__actions { flex-direction: column-reverse; }
  .modal__actions .btn-primary,
  .modal__actions .btn-ghost { width: 100%; justify-content: center; }
  .capture__actions .btn-primary { width: 100%; justify-content: center; }
}
