/* ===================================================================
   Horizon Peinture — page Contact / assistant devis (hérite de style.css)
   =================================================================== */

/* --- Bande d'intro : présentation de l'assistant Horizon --- */
.assistant-intro {
  position: relative;
  background: var(--ink);
  padding-top: calc(var(--header-h) + 56px);
  padding-bottom: 56px;
}
.assistant-intro-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 40px;
}

.assistant-avatar-large {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, rgba(225, 154, 92, 0.35), rgba(43, 76, 111, 0.55) 70%);
  border: 1px solid rgba(246, 243, 236, 0.18);
  box-shadow: 0 24px 50px rgba(16, 24, 32, 0.45);
}
.assistant-avatar-large video,
.assistant-avatar-large img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.assistant-avatar-large img.is-hidden {
  display: none;
}

.assistant-intro-copy {
  min-width: 0;
}
.assistant-intro-copy .eyebrow {
  color: var(--horizon-glow);
}
.assistant-intro-copy h1 {
  color: var(--horizon-day);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  max-width: 18ch;
}
.assistant-intro-lede {
  color: rgba(246, 243, 236, 0.88);
  font-size: 1.05rem;
  max-width: 58ch;
  margin: 0;
}

/* --- Section conversation --- */
.chat-section {
  background: var(--horizon-day);
  padding-top: 56px;
}
.chat-wrap {
  display: flex;
  justify-content: center;
}

.chat-card {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(16, 24, 32, 0.1);
  overflow: hidden;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 26px 8px;
  max-height: 58vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-input-zone {
  padding: 18px 26px 28px;
  border-top: 1px solid rgba(201, 194, 180, 0.5);
}

/* --- Bulles de conversation --- */
.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 100%;
}
.chat-msg-bot {
  justify-content: flex-start;
}
.chat-msg-user {
  justify-content: flex-end;
}

.chat-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--stone);
}

.chat-bubble {
  max-width: 78%;
  padding: 13px 18px;
  border-radius: var(--radius);
  font-size: 0.96rem;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}
.chat-msg-bot .chat-bubble {
  background: var(--horizon-day);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.chat-msg-user .chat-bubble {
  background: var(--horizon-glow);
  color: var(--ink);
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.chat-bubble strong {
  color: var(--horizon-dusk);
}
.chat-msg-user .chat-bubble strong {
  color: var(--ink);
}

/* --- Indicateur "Horizon écrit..." --- */
.chat-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 15px 18px;
}
.chat-typing-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--horizon-dusk);
  opacity: 0.5;
  animation: chat-typing-bounce 1.1s ease-in-out infinite;
}
.chat-typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing-bubble span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-typing-bubble span {
    animation: none;
    opacity: 0.8;
  }
}

/* --- Réponses rapides --- */
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chat-chip {
  font: inherit;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--horizon-day);
  border: 1px solid var(--stone);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--horizon-dusk);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.chat-chip:hover {
  border-color: var(--horizon-dusk);
  transform: translateY(-1px);
}
.chat-chip:focus-visible {
  outline: 2px solid var(--horizon-glow);
  outline-offset: 2px;
}
.chat-chip:active {
  background: var(--horizon-dusk);
  border-color: var(--horizon-dusk);
  color: var(--horizon-day);
}

/* --- Formulaire texte / nombre / tel / email en ligne --- */
.chat-text-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}
.chat-field-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--stone);
  background: var(--horizon-day);
  color: var(--ink);
  font: inherit;
  font-size: 0.96rem;
}
.chat-field-input:focus-visible {
  outline: 2px solid var(--horizon-glow);
  outline-offset: 1px;
  border-color: var(--horizon-dusk);
}
.chat-field-suffix {
  display: inline-flex;
  align-items: center;
  color: var(--horizon-dusk);
  font-weight: 600;
  font-size: 0.9rem;
  padding-inline: 2px;
}
.chat-text-form .btn {
  flex-shrink: 0;
}
.chat-field-hint {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: #6b7078;
}
.chat-skip-row {
  margin-top: 10px;
}
.chat-skip-btn {
  font: inherit;
  cursor: pointer;
  background: none;
  border: 1px dashed var(--stone);
  border-radius: var(--radius);
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--horizon-dusk);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.chat-skip-btn:hover {
  border-color: var(--horizon-dusk);
  background: rgba(43, 76, 111, 0.06);
}
.chat-skip-btn:focus-visible {
  outline: 2px solid var(--horizon-glow);
  outline-offset: 2px;
}

/* --- Étape RGPD --- */
.chat-rgpd-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: #3a4048;
  cursor: pointer;
}
.chat-checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--horizon-dusk);
}
.chat-checkbox-label a {
  color: var(--horizon-dusk);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chat-rgpd-row .btn {
  align-self: flex-start;
}
.chat-rgpd-row .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* --- Récapitulatif --- */
.recap-card {
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--horizon-day);
  border: 1px solid var(--stone);
  margin-bottom: 16px;
}
.recap-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 0;
}
.recap-list dt {
  font-weight: 600;
  color: var(--horizon-dusk);
  font-size: 0.86rem;
  white-space: nowrap;
}
.recap-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
}
.recap-actions {
  display: flex;
  justify-content: flex-end;
}

/* --- Confirmation --- */
.confirmation-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.confirmation-success-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--horizon-glow);
  color: var(--ink);
  animation: success-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes success-pop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .confirmation-success-badge {
    animation: none;
  }
}
.confirmation-note {
  margin: 0;
  font-size: 0.9rem;
  color: #4a5058;
}
.recap-text-block {
  margin: 0;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--horizon-day);
  border: 1px solid var(--stone);
  font-family: var(--font-body);
  font-size: 0.86rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  max-height: 260px;
  overflow-y: auto;
}
.confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn-ghost-alt {
  background: #fff;
  color: var(--horizon-dusk);
  border: 1px solid var(--stone);
}
.btn-ghost-alt:hover {
  border-color: var(--horizon-dusk);
  background: rgba(43, 76, 111, 0.06);
}
.confirmation-alt {
  font-size: 0.86rem;
  color: #4a5058;
  margin: 4px 0 0;
}
.confirmation-alt a {
  color: var(--horizon-dusk);
  font-weight: 600;
}

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 720px) {
  .assistant-intro {
    padding-top: calc(var(--header-h) + 32px);
    padding-bottom: 40px;
  }
  .assistant-intro-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 20px;
  }
  .assistant-avatar-large {
    width: 136px;
    height: 136px;
  }
  .assistant-intro-copy h1 {
    max-width: none;
  }
  .assistant-intro-lede {
    max-width: none;
  }
  .chat-section {
    padding-top: 36px;
  }
  .chat-thread {
    padding: 22px 16px 8px;
    max-height: 52vh;
  }
  .chat-input-zone {
    padding: 14px 16px 22px;
  }
  .chat-bubble {
    max-width: 88%;
  }
}

@media (max-width: 480px) {
  .chat-text-form {
    flex-direction: column;
  }
  .chat-text-form .btn {
    width: 100%;
  }
  .recap-list {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  .recap-list dd {
    margin-bottom: 6px;
  }
}
