:root {
  /* Palette tirée de la photo : lin, sable, terre */
  --bg: #f8f5f0;          /* crème très clair */
  --ink: #1f1a16;         /* texte */
  --muted: #5e544b;
  --brown: #4a3a2c;       /* bloc formulaire */
  --brown-deep: #3a2d22;
  --sand: #e6d6bd;        /* bouton */
  --sand-hover: #eee1cb;
  --linen: #d9c6ae;       /* accent beige du mur */
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 32px;
}

/* ---------- Haut de page ---------- */
.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 64px;
  align-items: center;
  padding: 0 40px;
  margin-bottom: 40px;
}

/* Tablette avec la photo en couverture */
.tablet {
  position: relative;
  width: 300px;
  aspect-ratio: 3 / 4.25;
  padding: 10px;
  border-radius: 18px;
  background: #3b3531;
  box-shadow:
    0 2px 0 #2a2522 inset,
    0 24px 40px -18px rgba(58, 45, 34, .55),
    0 6px 14px rgba(58, 45, 34, .18);
}
.tablet::before,
.tablet::after {           /* boutons latéraux */
  content: "";
  position: absolute;
  right: -4px;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: #2e2926;
}
.tablet::before { top: 34px; height: 18px; }
.tablet::after  { top: 58px; height: 18px; }

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--linen);
}
.screen { container-type: inline-size; }
/* Les deux images (photo + détourage) sont superposées exactement */
.screen .layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
}
.screen .cutout { z-index: 2; }

/* Mot sur le mur : entre la photo (fond) et la personne détourée */
.wall-word {
  position: absolute;
  z-index: 1;
  top: 4%;
  left: 0; right: 0;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 25cqw;
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
  /* Lettres en relief fixées au mur : ton sur ton + ombre douce portée sur le mur */
  color: #b8977a;
  text-shadow:
    -0.2cqw -0.2cqw 0 rgba(255, 244, 228, .6),   /* arête éclairée */
     0.3cqw  0.3cqw 0 rgba(120, 88, 62, .6),     /* épaisseur de la lettre */
     0.6cqw   0.6cqw  0 rgba(120, 88, 62, .3),
     1.4cqw   2cqw    2.2cqw rgba(76, 52, 34, .38);    /* ombre portée sur le mur */
  pointer-events: none;
  user-select: none;
}
.home-bar {
  z-index: 3;
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  width: 34%; height: 3px;
  border-radius: 3px;
  background: rgba(31, 26, 22, .75);
}

.intro h1 {
  font-family: "Montserrat", "Poppins", sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 4.2vw, 50px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
}
.intro p {
  font-size: 18px;
  margin: 0 0 18px;
  max-width: 560px;
}

/* ---------- Bloc formulaire ---------- */
.form-block {
  background: var(--brown);
  border-radius: var(--radius);
  padding: 40px 24px;
  box-shadow: 0 10px 30px -12px rgba(58, 45, 34, .45);
}
.form-block h2 {
  text-align: center;
  color: var(--sand);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 26px;
}

form {
  max-width: 820px;
  margin: 0 auto;
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }

/* labels lisibles par les lecteurs d'écran, masqués visuellement (placeholders affichés) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

input[type="text"], input[type="email"] {
  width: 100%;
  font: inherit;
  font-family: "Montserrat", "Poppins", sans-serif;
  font-size: 17px;
  padding: 16px 16px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #8a8178; }
input:focus {
  outline: none;
  border-color: var(--sand);
  box-shadow: 0 0 0 4px rgba(230, 214, 189, .35);
}
input[aria-invalid="true"] { border-color: #e08a7a; }

.consent {
  display: flex; gap: 10px; align-items: flex-start;
  color: #d9ccb9; font-size: 13px;
  margin: 4px 0 24px; cursor: pointer;
}
.consent input { margin-top: 3px; accent-color: var(--sand); width: 16px; height: 16px; flex-shrink: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; max-width: 460px;
  margin: 28px auto 0;
  font-family: "Montserrat", "Poppins", sans-serif;
  font-size: 20px; font-weight: 500;
  padding: 18px 24px;
  border: 0; border-radius: 4px;
  background: var(--sand); color: var(--ink);
  cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--sand-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .75; cursor: wait; }
.btn .arrow { font-size: 22px; line-height: 1; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(31, 26, 22, .25); border-top-color: var(--ink);
  animation: spin .7s linear infinite; display: none;
}
.btn[disabled] .spinner { display: inline-block; }
.btn[disabled] .arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.error { color: #f3b4a6; text-align: center; font-size: 14px; margin: 14px 0 0; min-height: 1.2em; }
.error:empty { display: none; }

.reassure { text-align: center; font-size: 16px; margin: 14px 0 0; }
.reassure small { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }

/* ---------- Page questionnaire ---------- */
.quiz { max-width: 760px; }
.screen-step[hidden] { display: none; }

.kicker {
  display: inline-block;
  font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brown); background: var(--sand);
  padding: 6px 14px; border-radius: 999px; margin: 0 0 18px;
}
.quiz h1 {
  font-family: "Montserrat", "Poppins", sans-serif;
  font-weight: 700; font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2; margin: 0 0 12px; outline: none;
}
.intro-sub { color: var(--muted); font-size: 17px; margin: 0 0 28px; }

.panel {
  background: #fff; border: 1px solid #ece4d8; border-radius: 14px;
  padding: 24px 26px; margin-bottom: 28px;
}
.panel h2 { font-size: 18px; margin: 0 0 12px; font-family: "Montserrat", sans-serif; }
.steps-list { margin: 0; padding-left: 20px; }
.steps-list li { margin-bottom: 8px; }
.steps-list li::marker { color: var(--brown); }

/* progression */
.progress-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: var(--muted); margin-bottom: 10px;
}
.back {
  font: inherit; font-size: 14px; color: var(--brown); background: none; border: 0;
  padding: 6px 0; cursor: pointer; font-weight: 600;
}
.back:hover { text-decoration: underline; }
.progress { height: 6px; background: #ebe3d6; border-radius: 99px; overflow: hidden; margin-bottom: 36px; }
.progress i { display: block; height: 100%; background: var(--brown); border-radius: 99px; transition: width .3s ease; }

.question {
  font-family: "Montserrat", "Poppins", sans-serif;
  font-size: clamp(22px, 3vw, 28px); font-weight: 700; line-height: 1.3;
  margin: 0 0 26px; outline: none;
}
.answers { display: grid; gap: 14px; }
.answer {
  display: flex; align-items: center; gap: 16px; width: 100%;
  font: inherit; font-size: 17px; text-align: left; color: var(--ink);
  background: #fff; border: 1.5px solid #e6ddd0; border-radius: 12px;
  padding: 18px 20px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.answer:hover { border-color: var(--linen); background: #fdfaf5; }
.answer:active { transform: translateY(1px); }
.answer:focus-visible { outline: 3px solid var(--linen); outline-offset: 2px; }
.answer .letter {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "Montserrat", sans-serif; font-weight: 700;
  background: var(--bg); color: var(--brown); border: 1.5px solid var(--linen);
}
.answer.selected { border-color: var(--brown); background: #f7f0e6; }
.answer.selected .letter { background: var(--brown); color: var(--sand); border-color: var(--brown); }

/* résultat */
.totals {
  background: #fff; border: 1px solid #ece4d8; border-radius: 14px;
  padding: 20px 24px; margin: 18px 0 28px; display: grid; gap: 12px;
}
.total-row { display: grid; grid-template-columns: 170px 1fr 46px; gap: 14px; align-items: center; color: var(--muted); }
.total-row b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: var(--brown); font-size: 13px; margin-right: 6px; }
.total-row em { font-style: normal; }
.t-bar { height: 10px; background: #efe8dd; border-radius: 99px; overflow: hidden; }
.t-bar i { display: block; height: 100%; background: var(--linen); border-radius: 99px; }
.t-num { text-align: right; font-weight: 600; }
.total-row.win { color: var(--ink); font-weight: 600; }
.total-row.win b { background: var(--brown); color: var(--sand); }
.total-row.win .t-bar i { background: var(--brown); }

.profile {
  background: #fff; border-radius: 16px; overflow: hidden;
  border: 1px solid #ece4d8; padding: 0 28px 28px; scroll-margin-top: 20px;
}
.profile-head {
  display: flex; align-items: center; gap: 16px;
  background: var(--brown); color: var(--sand);
  margin: 0 -28px 8px; padding: 22px 28px;
}
.profile-letter {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--sand); color: var(--brown);
  font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 24px;
}
.profile-head small { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.profile-head h2 { margin: 0; font-family: "Montserrat", sans-serif; font-size: 26px; color: #fff; }
.profile h3 { font-family: "Montserrat", sans-serif; font-size: 17px; margin: 24px 0 10px; color: var(--brown); }
.profile ul, .profile ol { margin: 0; padding-left: 22px; }
.profile li { margin-bottom: 10px; }
.profile ol.actions li::marker { font-weight: 700; color: var(--brown); }
.profile ul.sub { margin-top: 8px; }
.profile ul.sub li { margin-bottom: 4px; font-style: italic; }
.ask {
  background: var(--bg); border-left: 4px solid var(--linen);
  border-radius: 0 10px 10px 0; padding: 4px 20px 16px; margin-top: 24px;
}
.ask p { margin: 0; font-size: 17px; font-weight: 600; }
.examples { background: #f7f0e6; border-radius: 10px; padding: 14px 18px; margin: 16px 0 0; }

.profiles { display: grid; gap: 24px; }
.profile.extra { border-style: dashed; }
.tie-note {
  background: #f7f0e6; border: 1px solid #eadfcd; border-radius: 14px;
  padding: 18px 22px; margin: 0 0 24px;
}
.tie-note p { margin: 0; }
.tie-note .tie-advice { margin-top: 10px; font-weight: 600; color: var(--brown); }
.others { text-align: center; margin: 28px 0 8px; }
.others p { margin: 0 0 10px; color: var(--muted); }
.others-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip-btn {
  font: inherit; font-size: 14px; cursor: pointer;
  background: #fff; color: var(--brown);
  border: 1.5px solid var(--linen); border-radius: 999px; padding: 8px 16px;
}
.chip-btn:hover { background: #f7f0e6; }

.result-actions { margin: 24px 0 0; }
.btn-outline { background: transparent; border: 1.5px solid var(--brown); color: var(--brown); font-size: 16px; max-width: 280px; margin-top: 0; }
.btn-outline:hover { background: #f7f0e6; }
#start-btn { margin: 0; max-width: 340px; }

.mentions { font-size: 12px; color: var(--muted); margin: 36px 0 0; line-height: 1.6; text-align: center; }

@media (max-width: 600px) {
  .panel { padding: 20px; }
  .answer { font-size: 16px; padding: 15px 16px; }
  .total-row { grid-template-columns: 1fr 40px; }
  .total-row .t-bar { grid-column: 1 / -1; grid-row: 2; }
  .profile { padding: 0 20px 22px; }
  .profile-head { margin: 0 -20px 8px; padding: 18px 20px; }
  #start-btn, .btn-outline { max-width: none; }
}

footer { text-align: center; font-size: 13px; color: var(--muted); padding: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  main { padding: 28px 16px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 0; justify-items: center; text-align: center; }
  .tablet { width: 240px; }
  .intro p { margin-left: auto; margin-right: auto; font-size: 16px; }
  .form-block { padding: 26px 18px 30px; }
}
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; gap: 0; }
  .btn { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
