/* Sélection de la formule, questionnaire et envoi de la demande. */

.flow-strip { padding-bottom: 20px; background: var(--foret); color: var(--white); clip-path: polygon(0 0, 100% 0, 100% 62%, 75% 100%, 50% 70%, 25% 100%, 0 62%); }
.flow-strip-inner { max-width: 860px; margin: 0 auto; padding: 10px var(--gutter); }
.offer-badge { font-weight: 700; font-size: 17px; min-height: 1.55em; }

.flow { width: 100%; max-width: 860px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) var(--gutter) 72px; }
.flow h1 { font-size: clamp(46px, 7vw, 84px); }
.flow-intro { margin-top: 14px; font-size: clamp(18px, 1.7vw, 20px); line-height: 1.5; max-width: 52ch; color: var(--grey-3); }
.client-name { margin-top: 6px; color: var(--grey-3); }

.progress-wrap { margin-top: 26px; }
.progress-meta { font-size: 16px; }
.progress-bar {
  height: 16px; margin-top: 8px; overflow: hidden; background: var(--grey-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16'%3E%3Cpath d='M0 2l8 12 8-9 8 9 8-12' fill='none' stroke='%23000' stroke-width='3.4'/%3E%3C/svg%3E") left center / 32px 16px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16'%3E%3Cpath d='M0 2l8 12 8-9 8 9 8-12' fill='none' stroke='%23000' stroke-width='3.4'/%3E%3C/svg%3E") left center / 32px 16px repeat-x;
}
#progress-fill { display: block; height: 100%; width: 0; background: var(--foret); transition: width .35s var(--snap); }

.question-body, .send-body { margin-top: 32px; }
.question-title { font-size: clamp(38px, 5vw, 60px); margin-bottom: 24px; }
.question-title:focus { outline: none; }
.optional-tag { font-size: 17px; font-weight: 400; letter-spacing: 0; color: var(--grey-3); }

.option-list > div + div { margin-top: 8px; }
.option-card {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px;
  border: 2px solid var(--grey-2); cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .18s var(--snap);
}
.option-card:hover { border-color: var(--foret); transform: translateX(4px); }
.option-card.is-checked, .option-card:has(input:checked) { background: var(--vif); border-color: var(--foret); font-weight: 700; }
.option-card input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--foret); }
.option-card:has(input:disabled) { border-color: var(--grey-2); color: var(--grey-3); cursor: not-allowed; }
.option-card:has(input:disabled):hover { border-color: var(--grey-2); transform: none; }
.other-wrap { margin-top: 8px; }

.selection-meta { display: flex; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 16px; }
.selection-count { font-weight: 600; }
.limit-reached { color: var(--green-deep); font-weight: 600; }
.selection-limit-note, .field-note { margin-top: 12px; font-size: 16px; color: var(--grey-3); }

.field { display: block; }
.field > span, .field-label { display: block; margin-bottom: 6px; font-weight: 600; }
.field input, .text-input, .textarea-input {
  display: block; width: 100%; min-height: 50px; padding: 11px 14px;
  border: 2px solid var(--foret); border-radius: 0; background: var(--white);
}
.textarea-input { min-height: 130px; resize: vertical; }
.field input[type="file"] { padding: 11px 0; border: 0; }
.field-row, .inspiration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.command-form { display: grid; gap: 20px; margin-top: 30px; }
.logo-field { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 18px; align-items: end; }
.logo-preview-wrap { height: 96px; border: 2px solid var(--grey-2); display: grid; place-items: center; overflow: hidden; }
.logo-preview { max-width: 100%; max-height: 100%; object-fit: contain; }
.trap { position: absolute; left: -9999px; }
.privacy-note { font-size: 16px; color: var(--grey-3); }

.btn[disabled] { cursor: progress; }
.secondary-link { text-underline-offset: 3px; }

.question-actions, .footer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; }
.footer-row { margin-top: 4px; }
.question-error, .form-status { margin-top: 14px; color: var(--error); font-weight: 600; }
.question-error:empty, .form-status:empty { display: none; }

.send-summary > div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--grey-2); }
.send-summary dt { color: var(--grey-3); }
.send-summary dd { overflow-wrap: anywhere; }

.confirmation-screen, .empty-state { margin-top: 32px; }
.confirmation-screen h2, .empty-state h2 { font-size: clamp(38px, 5vw, 60px); margin-bottom: 16px; }
.confirmation-screen h2:focus { outline: none; }
.confirmation-screen p, .empty-state p { margin-bottom: 12px; max-width: 54ch; overflow-wrap: anywhere; }
.confirmation-screen .btn, .empty-state .btn { margin-top: 14px; }

/* Remerciement final : le cercle se trace, se remplit, la coche se dessine, puis le message arrive. */
.thanks { display: flex; flex-direction: column; align-items: center; padding-block: clamp(4px, 2vw, 24px); text-align: center; }
.thanks-seal { width: clamp(120px, 16vw, 160px); height: auto; margin-bottom: 26px; }
.thanks-shadow { fill: var(--rose); transform: translate(6px, 6px); animation: thanks-shift .26s var(--snap) 1.2s both; }
.thanks-disc { fill: var(--vif); transform-origin: 60px 60px; animation: thanks-fill .38s var(--snap) .55s both; }
.thanks-ring, .thanks-check { fill: none; stroke: var(--foret); stroke-dasharray: 1 2; }
.thanks-ring { stroke-width: 5; transform: rotate(-90deg); transform-origin: 60px 60px; animation: thanks-draw .75s cubic-bezier(.65, 0, .35, 1) both; }
.thanks-check { stroke-width: 9; stroke-linecap: square; stroke-linejoin: miter; animation: thanks-draw .42s cubic-bezier(.3, 0, .2, 1) .88s both; }
.thanks > :not(.thanks-seal) { animation: thanks-rise .42s var(--snap) 1.3s both; }
.thanks h1 { font-size: clamp(40px, 5.6vw, 72px); }
.thanks h1:focus { outline: none; }
.thanks-message { max-width: 46ch; margin-top: 18px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; }
.thanks .btn { margin-top: 28px; }
.thanks-note { margin-top: 14px; color: var(--muted); font-size: 16px; }
@keyframes thanks-draw { from { stroke-dashoffset: 1.05; } to { stroke-dashoffset: 0; } }
@keyframes thanks-fill { from { transform: scale(0); } }
@keyframes thanks-shift { from { opacity: 0; transform: translate(0, 0); } }
@keyframes thanks-rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .thanks-seal *, .thanks > :not(.thanks-seal) { animation: none !important; }
}

@media (max-width: 620px) {
  .field-row, .inspiration-grid { grid-template-columns: minmax(0, 1fr); }
  .send-summary > div { grid-template-columns: minmax(0, 1fr); }
  .question-actions .btn { flex: 1 1 0; padding: 0 12px; }
}

/* Animation d'envoi : elle dure le temps de la requête et ne prouve rien sur son résultat */
.btn.is-sending[disabled] { opacity: 1; }
.send-progress { margin-top: 22px; }
.send-progress-line {
  display: block; height: 16px; overflow: hidden; background: var(--grey-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16'%3E%3Cpath d='M0 2l8 12 8-9 8 9 8-12' fill='none' stroke='%23000' stroke-width='3.4'/%3E%3C/svg%3E") left center / 32px 16px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16'%3E%3Cpath d='M0 2l8 12 8-9 8 9 8-12' fill='none' stroke='%23000' stroke-width='3.4'/%3E%3C/svg%3E") left center / 32px 16px repeat-x;
}
.send-progress-line::before { content: ""; display: block; width: 40%; height: 100%; background: var(--foret); animation: send-travel 1s var(--snap) infinite; }
.send-progress p { margin-top: 8px; font-weight: 600; }
@keyframes send-travel { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) {
  .send-progress-line::before { width: 100%; animation: none !important; }
}

/* Notification de réception, affichée seulement après la confirmation du serveur */
.toast {
  position: fixed; z-index: 50; left: 50%; top: max(12px, env(safe-area-inset-top));
  display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center;
  width: min(420px, calc(100vw - 24px)); padding: 6px 6px 16px 18px;
  border-radius: 22px; background: var(--menthe); color: var(--foret);
  box-shadow: 0 14px 40px rgba(6, 51, 29, .34);
  opacity: 0; transform: translate(-50%, calc(-100% - 28px));
  transition: transform .4s cubic-bezier(.5, 0, .75, 0), opacity .3s;
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); transition: transform .6s cubic-bezier(.2, 1.3, .35, 1), opacity .2s; }
.toast-sender { font-size: 15px; font-weight: 800; }
.toast-message { grid-column: 1 / -1; padding-right: 12px; font-size: 17px; line-height: 1.35; }
.toast-close { width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--foret); font-size: 24px; line-height: 1; }
.toast-close:hover { background: rgba(6, 51, 29, .12); }
.toast-close:focus-visible { outline-color: var(--foret); outline-offset: -3px; }
