/* Formulaire helpdesk [alya_support] — responsive 4 breakpoints. Pas un chatbot. */

.alya-hd-off {
  color: #475259;
  font-size: 14px;
  margin: 12px 0;
}

/* Conteneur page : centre le formulaire sur toutes tailles */
.alya-hd-desk-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(12px, 2.5vw, 28px);
}

.alya-hd-desk,
.alya-hd-desk * {
  box-sizing: border-box;
}

.alya-hd-desk {
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  color: #000E19;
  background: linear-gradient(180deg, #F8FAFC 0%, #ECF2F8 100%);
  border: 1px solid #E4E5E7;
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 14, 25, 0.08);
}

.alya-hd-desk-head {
  display: flex;
  justify-content: space-between;
  gap: 12px 16px;
  align-items: flex-start;
  padding: clamp(14px, 2.2vw, 22px) clamp(14px, 2.5vw, 24px);
  background: #fff;
  border-bottom: 1px solid #E4E5E7;
}

.alya-hd-desk-head > div {
  min-width: 0;
  flex: 1;
}

.alya-hd-desk-head strong {
  display: block;
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.25;
  color: #1B4845;
}

.alya-hd-desk-head p {
  margin: 6px 0 0;
  font-size: clamp(12px, 1.5vw, 14px);
  line-height: 1.4;
  color: #475259;
}

.alya-hd-step {
  flex-shrink: 0;
  font-size: clamp(11px, 1.3vw, 12.5px);
  font-weight: 650;
  color: #1B4845;
  background: #E8F3F2;
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
  align-self: flex-start;
}

.alya-hd-desk-alert {
  margin: clamp(10px, 1.8vw, 16px) clamp(14px, 2.5vw, 24px) 0;
  padding: clamp(10px, 1.6vw, 14px) clamp(12px, 1.8vw, 16px);
  border-radius: 12px;
  background: #fff;
  border: 1px solid #E4E5E7;
  font-size: clamp(13px, 1.5vw, 14.5px);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.alya-hd-desk-alert.is-err {
  border-color: #f1b4c0;
  background: #fff5f7;
  color: #9f1239;
}

.alya-hd-desk-card {
  margin: clamp(10px, 1.6vw, 14px) clamp(14px, 2.5vw, 24px) 0;
  padding: clamp(10px, 1.6vw, 14px) clamp(12px, 1.8vw, 16px);
  border-radius: 12px;
  background: #fff;
  border: 1px solid #E4E5E7;
}

.alya-hd-desk-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(64px, 88px) minmax(0, 1fr);
  gap: 8px 12px;
  font-size: clamp(12.5px, 1.45vw, 14px);
  align-items: start;
}

.alya-hd-desk-card dt {
  color: #475259;
  font-weight: 500;
}

.alya-hd-desk-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  color: #000E19;
}

.alya-hd-desk-form {
  padding: clamp(14px, 2vw, 22px) clamp(14px, 2.5vw, 24px) clamp(16px, 2.4vw, 26px);
}

.alya-hd-panel[hidden] {
  display: none !important;
}

.alya-hd-lead {
  margin: 0 0 clamp(12px, 1.8vw, 16px);
  font-size: clamp(13.5px, 1.6vw, 15px);
  line-height: 1.45;
  color: #000E19;
}

.alya-hd-label {
  display: block;
  font-size: clamp(12.5px, 1.45vw, 14px);
  font-weight: 650;
  margin-bottom: 8px;
  color: #1B4845;
}

.alya-hd-input,
.alya-hd-textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #E4E5E7;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* évite zoom iOS */
  background: #fff;
  min-height: 48px;
  color: #000E19;
}

.alya-hd-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.45;
}

.alya-hd-input:focus,
.alya-hd-textarea:focus {
  outline: none;
  border-color: #1B4845;
  box-shadow: 0 0 0 3px rgba(27, 72, 69, 0.14);
}

.alya-hd-help {
  margin: 8px 0 0;
  font-size: clamp(11.5px, 1.35vw, 13px);
  line-height: 1.4;
  color: #475259;
}

.alya-hd-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.alya-hd-choice {
  width: 100%;
  min-height: 48px;
  border: 1px solid #E4E5E7;
  border-radius: 12px;
  background: #fff;
  color: #1B4845;
  font: inherit;
  font-size: clamp(14px, 1.6vw, 15.5px);
  font-weight: 650;
  padding: 12px 14px;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.alya-hd-choice:hover,
.alya-hd-choice:focus-visible {
  border-color: #1B4845;
  background: #E8F3F2;
  outline: none;
}

.alya-hd-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(14px, 2vw, 18px);
  align-items: stretch;
}

.alya-hd-btn {
  border: 0;
  border-radius: 12px;
  min-height: 48px;
  padding: 0 18px;
  font: inherit;
  font-size: clamp(13.5px, 1.5vw, 15px);
  font-weight: 650;
  cursor: pointer;
  background: #1B4845;
  color: #fff;
  flex: 1 1 auto;
  -webkit-tap-highlight-color: transparent;
}

.alya-hd-btn--ghost {
  background: #fff;
  color: #1B4845;
  border: 1px solid #E4E5E7;
}

.alya-hd-btn--ghost:hover,
.alya-hd-btn--ghost:focus-visible {
  border-color: #1B4845;
  outline: none;
}

.alya-hd-btn:focus-visible {
  outline: 2px solid #43ABFF;
  outline-offset: 2px;
}

.alya-hd-ticket {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #E8F3F2;
  font-weight: 700;
  color: #1B4845;
  font-size: clamp(14px, 1.7vw, 16px);
  overflow-wrap: anywhere;
}

.alya-hd-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.alya-hd-fab {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 99990;
  border: 0;
  border-radius: 999px;
  background: #1B4845;
  color: #fff;
  font-weight: 600;
  padding: 12px 18px;
  box-shadow: 0 12px 28px rgba(0, 14, 25, 0.18);
  text-decoration: none;
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}

/* ========== 1) Téléphone (≤ 480px) ========== */
@media (max-width: 480px) {
  .alya-hd-desk-wrap {
    padding: 10px 12px 20px;
  }

  .alya-hd-desk {
    border-radius: 14px;
    max-width: 100%;
  }

  .alya-hd-desk-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .alya-hd-step {
    align-self: flex-start;
    white-space: normal;
  }

  .alya-hd-desk-card dl {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .alya-hd-desk-card dt {
    margin-top: 6px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .alya-hd-desk-card dt:first-child {
    margin-top: 0;
  }

  .alya-hd-actions-row {
    flex-direction: column;
  }

  .alya-hd-btn,
  .alya-hd-choice {
    width: 100%;
    flex: 1 1 100%;
  }

  .alya-hd-textarea {
    min-height: 140px;
  }

  .alya-hd-fab {
    right: 12px;
    bottom: 12px;
    padding: 11px 14px;
    font-size: 13px;
  }
}

/* ========== 2) Tablette (481px – 900px) ========== */
@media (min-width: 481px) and (max-width: 900px) {
  .alya-hd-desk-wrap {
    padding: 16px 20px 28px;
    max-width: 720px;
  }

  .alya-hd-desk {
    max-width: 640px;
  }

  .alya-hd-choices {
    grid-template-columns: 1fr 1fr;
  }

  .alya-hd-choices .alya-hd-choice:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .alya-hd-actions-row {
    flex-wrap: wrap;
  }

  .alya-hd-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 140px;
  }

  .alya-hd-btn[type="submit"],
  .alya-hd-btn:not(.alya-hd-btn--ghost) {
    flex: 1 1 100%;
  }
}

/* ========== 3) PC (901px – 1279px) ========== */
@media (min-width: 901px) and (max-width: 1279px) {
  .alya-hd-desk-wrap {
    padding: 24px 28px 36px;
    max-width: 860px;
  }

  .alya-hd-desk {
    max-width: 720px;
  }

  .alya-hd-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .alya-hd-actions-row {
    justify-content: flex-start;
  }

  .alya-hd-btn {
    flex: 0 1 auto;
    min-width: 120px;
  }

  .alya-hd-btn[type="submit"],
  .alya-hd-btn:not(.alya-hd-btn--ghost) {
    margin-left: auto;
  }
}

/* ========== 4) Grand écran (≥ 1280px) ========== */
@media (min-width: 1280px) {
  .alya-hd-desk-wrap {
    padding: 32px 40px 48px;
    max-width: 980px;
  }

  .alya-hd-desk {
    max-width: 780px;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 14, 25, 0.1);
  }

  .alya-hd-desk-head {
    padding: 24px 28px;
  }

  .alya-hd-desk-form {
    padding: 24px 28px 28px;
  }

  .alya-hd-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .alya-hd-choice {
    min-height: 52px;
  }

  .alya-hd-actions-row {
    gap: 12px;
  }

  .alya-hd-btn {
    flex: 0 1 auto;
    min-width: 132px;
    min-height: 48px;
  }

  .alya-hd-btn[type="submit"],
  .alya-hd-btn:not(.alya-hd-btn--ghost) {
    margin-left: auto;
  }

  .alya-hd-textarea {
    min-height: 140px;
  }
}

/* Orientation paysage téléphone */
@media (max-width: 900px) and (orientation: landscape) {
  .alya-hd-desk-wrap {
    padding: 10px 16px 16px;
  }

  .alya-hd-textarea {
    min-height: 88px;
  }
}

/* Réduction de motion */
@media (prefers-reduced-motion: reduce) {
  .alya-hd-choice,
  .alya-hd-btn {
    transition: none;
  }
}
