/*--------------------------------------------------------------
# Page contact (contact.php) : formulaire et assistant virtuel
# Réutilise les tokens de main.css (--thm-base, --thm-black, --thm-color)
---------------------------------------------------------------*/

.contact-page {
  background-color: #eff2f6;
  padding: 150px 0 100px;
}

@media (max-width: 991px) {
  .contact-page {
    padding: 130px 0 70px;
  }
}

@media (max-width: 575px) {
  .contact-page {
    padding: 120px 0 60px;
  }
}

.contact-page__container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 15px;
}

.contact-page__head {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.contact-page__head h1 {
  margin: 0 0 10px;
  color: var(--thm-black);
  font-size: 38px;
  font-weight: 700;
}

.contact-page__head p {
  margin: 0;
  color: var(--thm-color);
  font-size: 16.5px;
  line-height: 1.6;
}

/* ---------- Les deux options ---------- */

.contact-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 767px) {
  .contact-options {
    grid-template-columns: minmax(0, 1fr);
  }
}

.contact-option {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 18px 20px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(12, 33, 57, 0.06), 0 6px 18px rgba(12, 33, 57, 0.06);
  color: var(--thm-color);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-option:hover {
  border-color: rgba(0, 143, 213, 0.35);
}

.contact-option:focus-visible {
  outline: 3px solid rgba(0, 143, 213, 0.35);
  outline-offset: 2px;
}

.contact-option.is-active {
  border-color: var(--thm-base);
}

.contact-option__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 143, 213, 0.1);
  color: var(--thm-base);
  font-size: 20px;
}

.contact-option.is-active .contact-option__icon {
  background: var(--thm-base);
  color: #fff;
}

.contact-option__text strong {
  display: block;
  color: var(--thm-black);
  font-size: 17px;
}

.contact-option__text span {
  font-size: 14px;
}

/* ---------- Formulaire ---------- */

.contact-panel__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 991px) {
  .contact-panel__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.contact-form-card,
.contact-details,
.assistant {
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(12, 33, 57, 0.06), 0 8px 24px rgba(12, 33, 57, 0.06);
}

.contact-form-card {
  padding: 28px;
}

@media (max-width: 575px) {
  .contact-form-card {
    padding: 20px 16px;
  }
}

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

@media (max-width: 575px) {
  .contact-form-card__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.contact-field--full {
  grid-column: 1 / -1;
}

.contact-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--thm-black);
  font-size: 14px;
  font-weight: 600;
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #d5dbe3;
  border-radius: 8px;
  background: #fff;
  color: var(--thm-black);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-field textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  border-color: var(--thm-base);
  box-shadow: 0 0 0 3px rgba(0, 143, 213, 0.15);
}

.contact-field.is-invalid input,
.contact-field.is-invalid select,
.contact-field.is-invalid textarea {
  border-color: #c62828;
}

.contact-field__error {
  display: block;
  min-height: 0;
  margin-top: 4px;
  color: #c62828;
  font-size: 13px;
}

/* Pot de miel anti-robots : hors écran, invisible pour les visiteurs */
.contact-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin-top: 20px;
}

.contact-form-card__actions .thm-btn {
  border: 0;
}

.contact-form-card__actions .thm-btn[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.contact-form-card__hint {
  color: #5f6b7a;
  font-size: 13px;
}

.contact-form-card__notice {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 15px;
}

.contact-form-card__notice.is-success {
  margin-top: 0;
  background: #e7f5ec;
  color: #14532d;
}

.contact-form-card__notice.is-error {
  background: #fdecea;
  color: #8e1c1c;
}

/* ---------- Coordonnées ---------- */

.contact-details {
  padding: 24px;
}

.contact-details h2 {
  margin: 0 0 14px;
  color: var(--thm-black);
  font-size: 19px;
  font-weight: 700;
}

.contact-details ul {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.contact-details li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef1f5;
  color: var(--thm-color);
  font-size: 14.5px;
}

.contact-details li:last-child {
  border-bottom: 0;
}

.contact-details li > i {
  flex: none;
  width: 20px;
  margin-top: 3px;
  color: var(--thm-base);
  text-align: center;
}

.contact-details li strong {
  display: block;
  color: var(--thm-black);
  font-size: 13px;
}

.contact-details a {
  color: var(--thm-color);
  overflow-wrap: anywhere;
}

.contact-details a:hover {
  color: var(--thm-base);
}

.contact-details__assistant {
  width: 100%;
  padding: 11px 14px;
  border: 1px dashed var(--thm-base);
  border-radius: 8px;
  background: rgba(0, 143, 213, 0.06);
  color: var(--thm-base);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.contact-details__assistant:hover {
  background: rgba(0, 143, 213, 0.12);
}

/* ---------- Assistant virtuel ---------- */

.assistant {
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
}

.assistant__header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  background: var(--thm-black);
  color: #fff;
}

.assistant__header strong {
  display: block;
  font-size: 16px;
}

.assistant__header span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.assistant__avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--thm-base);
  font-size: 18px;
}

.assistant__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 380px;
  padding: 20px;
  overflow-y: auto;
  background: #f7f9fc;
}

@media (max-width: 575px) {
  .assistant__messages {
    height: 340px;
    padding: 14px;
  }
}

.assistant__bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
}

.assistant__bubble--bot {
  align-self: flex-start;
  border: 1px solid #e2e7ee;
  border-bottom-left-radius: 4px;
  background: #fff;
  color: var(--thm-color);
}

.assistant__bubble--bot a {
  color: var(--thm-base);
  font-weight: 600;
}

.assistant__bubble--user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--thm-base);
  color: #fff;
}

.assistant__handoff {
  display: block;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--thm-base);
  border-radius: 8px;
  background: #fff;
  color: var(--thm-base);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.assistant__handoff:hover {
  background: rgba(0, 143, 213, 0.08);
}

.assistant__typing {
  display: inline-flex;
  gap: 4px;
}

.assistant__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa5b4;
  animation: assistant-typing 1s infinite ease-in-out;
}

.assistant__typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.assistant__typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes assistant-typing {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.assistant__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 0;
  background: #fff;
}

.assistant__chip {
  padding: 6px 12px;
  border: 1px solid #d5dbe3;
  border-radius: 999px;
  background: #fff;
  color: var(--thm-black);
  font-size: 13.5px;
  cursor: pointer;
}

.assistant__chip:hover {
  border-color: var(--thm-base);
  color: var(--thm-base);
}

.assistant__form {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  background: #fff;
}

.assistant__form input {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid #d5dbe3;
  border-radius: 999px;
  font-size: 15px;
  outline: none;
}

.assistant__form input:focus {
  border-color: var(--thm-base);
  box-shadow: 0 0 0 3px rgba(0, 143, 213, 0.15);
}

.assistant__form button {
  flex: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--thm-base);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.assistant__note {
  margin: 0;
  padding: 0 20px 16px;
  background: #fff;
  color: #5f6b7a;
  font-size: 13px;
}

.assistant__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--thm-base);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
