/* ============================================================
   AI6 Technologies — Page « Demande de démo »
   Complète style.css sans le modifier : toutes les classes sont préfixées demo__
   ============================================================ */

.demo {
  width: 100%;
  max-width: 820px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

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

/* Blocs masqués selon le choix démo / newsletter (l'attribut hidden doit l'emporter sur les display: flex/grid) */
.demo [hidden] { display: none !important; }

.demo__reveal { animation: demo-reveal 0.25s ease both; }
@keyframes demo-reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ----- choix : démo et/ou newsletter (cartes, dans l'esprit des cartes de l'accueil) ----- */
.demo__intents {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.demo__intents legend {
  padding: 0;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.demo__intents .demo__error { margin-top: 10px; }

.demo__intents-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.demo__intent {
  position: relative;
  display: flex;
  cursor: pointer;
}
.demo__intent input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.demo__intent-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 22px 56px 24px 22px;
  border: 2px solid transparent;
  border-radius: 20px;
  background: var(--primary-light-max);
  color: var(--ink);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.demo__intent:hover .demo__intent-card { border-color: #C5CBFF; }

.demo__intent-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--white);
  color: var(--primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.demo__intent-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}
.demo__intent-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

/* pastille de sélection en haut à droite */
.demo__intent-check {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 24px;
  height: 24px;
  border: 2px solid #9AA3FF;
  border-radius: 50%;
  background: var(--white) no-repeat center / 16px;
  transition: border-color 0.2s ease;
}

/* carte choisie : bleu AI6, comme la carte mise en avant de l'accueil */
.demo__intent input:checked + .demo__intent-card {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 18px 36px -20px rgba(0, 29, 252, 0.85);
}
.demo__intent input:checked + .demo__intent-card .demo__intent-text { color: #F0F0F7; }
.demo__intent input:checked + .demo__intent-card .demo__intent-icon {
  background: rgba(255, 255, 255, 0.12);
  color: var(--primary-teal);
}
.demo__intent input:checked + .demo__intent-card .demo__intent-check {
  border-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'%3E%3Cpath d='M4.125 10.8121L7.99425 14.6813C8.13083 14.8188 8.29308 14.9288 8.47183 15.0031C8.65058 15.0782 8.84217 15.1167 9.03558 15.1167C9.22992 15.1167 9.4215 15.0782 9.60025 15.0031C9.779 14.9288 9.94033 14.8188 10.0769 14.6813L17.875 6.88324' stroke='%23001DFC' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.demo__intent input:focus-visible + .demo__intent-card {
  outline: 3px solid var(--primary-teal);
  outline-offset: 3px;
}
.demo__intents.is-invalid .demo__intent-card { border-color: #D92D20; }

/* ----- mention données personnelles ----- */
.demo__privacy {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-soft);
}
.demo__privacy a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.demo__privacy a:hover { opacity: 0.75; }

/* ----- champs ----- */
.demo__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 24px;
}

.demo__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.demo__field--full { grid-column: 1 / -1; }

.demo__field label,
.demo__choices legend {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.demo__req { color: var(--primary); }
.demo__opt { font-weight: 600; color: var(--ink-soft); }

.demo__field input,
.demo__field textarea {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 16px; /* 16px minimum : évite le zoom automatique sur iOS */
  font-weight: 600;
  color: var(--ink);
  background: var(--lavender);
  border: 1.5px solid transparent;
  border-radius: 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.demo__field textarea {
  min-height: 140px;
  line-height: 1.5;
  resize: vertical;
}
.demo__field input::placeholder,
.demo__field textarea::placeholder { color: #8A8FA8; font-weight: 500; }

.demo__field input:hover,
.demo__field textarea:hover { border-color: #D5D9FF; }

.demo__field input:focus,
.demo__field textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 29, 252, 0.12);
}

/* ----- erreurs ----- */
.demo__field.is-invalid input,
.demo__field.is-invalid textarea {
  border-color: #D92D20;
  background: #FFF6F5;
}
.demo__field.is-invalid input:focus,
.demo__field.is-invalid textarea:focus { box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.12); }

.demo__error {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #D92D20;
}

.demo__alert {
  padding: 16px 20px;
  border: 1px solid #FECDCA;
  border-radius: 14px;
  background: #FFF1F0;
  color: #B42318;
  font-size: 14px;
  font-weight: 700;
}
.demo__alert:focus { outline: none; }

/* ----- message : erreur + compteur ----- */
.demo__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.demo__counter {
  margin: 0 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ----- choix des solutions (pastilles) ----- */
.demo__choices {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.demo__choices legend { padding: 0; margin-bottom: 12px; }

.demo__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.demo__chip {
  position: relative;
  cursor: pointer;
}
.demo__chip input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.demo__chip span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: var(--primary-light-max);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.demo__chip span::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #9AA3FF;
  border-radius: 6px;
  background: var(--white) no-repeat center / 14px;
}
.demo__chip:hover span { border-color: #C5CBFF; }
.demo__chip input:checked + span {
  background: var(--primary);
  color: var(--white);
}
.demo__chip input:checked + span::before {
  border-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'%3E%3Cpath d='M4.125 10.8121L7.99425 14.6813C8.13083 14.8188 8.29308 14.9288 8.47183 15.0031C8.65058 15.0782 8.84217 15.1167 9.03558 15.1167C9.22992 15.1167 9.4215 15.0782 9.60025 15.0031C9.779 14.9288 9.94033 14.8188 10.0769 14.6813L17.875 6.88324' stroke='%23001DFC' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.demo__chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(0, 29, 252, 0.2); }

/* ----- consentement de recontact (démo) ----- */
.demo__consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px 12px;
  align-items: start;
}
.demo__consent input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.demo__consent label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}
.demo__consent a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.demo__consent a:hover { opacity: 0.75; }
.demo__consent .demo__error { grid-column: 2; }
.demo__consent.is-invalid input { outline: 2px solid #D92D20; outline-offset: 2px; }

/* ----- envoi ----- */
.demo__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.demo__legal {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.demo__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.demo__btn:hover {
  background: #0016C4;
  box-shadow: 0 12px 24px -12px rgba(0, 29, 252, 0.7);
}
.demo__btn:active { transform: translateY(1px); }
.demo__btn:focus-visible { outline: 3px solid var(--primary-teal); outline-offset: 3px; }
.demo__btn[disabled] { opacity: 0.7; cursor: progress; }
.demo__btn-icon { transition: transform 0.15s ease; }
.demo__btn:hover .demo__btn-icon { transform: translateX(3px); }

.demo__btn--ghost {
  background: transparent;
  color: var(--primary);
}
.demo__btn--ghost:hover {
  background: var(--primary);
  color: var(--white);
}

/* ----- confirmation ----- */
.demo__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
  border-radius: var(--radius);
  background: var(--primary-light-max);
  text-align: center;
}
.demo__success:focus { outline: none; }
.demo__success-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
}
.demo__success-title {
  margin: 0;
  color: var(--primary);
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
}
.demo__success p {
  margin: 0 0 8px;
  max-width: 520px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ----- pot de miel (hors écran, pas display:none que certains robots ignorent) ----- */
.demo__hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .demo__reveal { animation: none; }
  .demo__intent-card,
  .demo__intent-icon,
  .demo__intent-text { transition: none; }
}

@media (max-width: 620px) {
  .demo { gap: 32px; }
  .demo__intents-grid { grid-template-columns: 1fr; gap: 12px; }
  /* cartes compactes : icône à gauche, texte à droite */
  .demo__intent-card {
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-areas: "icon title" "icon text";
    column-gap: 14px;
    row-gap: 4px;
    align-items: start;
    padding: 16px 52px 16px 16px;
  }
  .demo__intent-icon { grid-area: icon; width: 44px; height: 44px; border-radius: 12px; }
  .demo__intent-title { grid-area: title; font-size: 16px; }
  .demo__intent-text { grid-area: text; font-size: 13px; }
  .demo__intent-check { top: 16px; right: 16px; }
  .demo__grid { grid-template-columns: 1fr; gap: 18px; }
  .demo__actions { flex-direction: column-reverse; align-items: stretch; }
  .demo__btn { width: 100%; padding: 16px 20px; font-size: 15px; letter-spacing: 0; }
  .demo__legal { text-align: center; }
  .demo__success { padding: 36px 20px; }
  .demo__success-title { font-size: 20px; }
}
