/* ============================== */
/* Formulaire réclamation (Web-to-Case Salesforce) */
/* ============================== */

.npy-form {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem;
  box-sizing: border-box;
  background: var(--neu-0);
  border-radius: 12px;
  box-shadow: 0px 0px 16px #5122981c;
  font-family: var(--main-font);
  color: var(--neu-70);
}

.npy-form *,
.npy-form *::before,
.npy-form *::after {
  box-sizing: border-box;
}

/* Sections */
.npy-form-section {
  border: none;
  margin: 0 0 2rem 0;
  padding: 0;
  min-width: 0;
}

.npy-form-legend {
  font-family: var(--title-font);
  font-size: 1.777rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--pri);
  padding: 0;
  margin-bottom: 1.25rem;
}

.npy-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}

.npy-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

/* Labels */
.npy-form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neu-70);
  line-height: 1.3;
}

.npy-form-required {
  color: var(--sec);
}

/* Champs */
.npy-form .npy-form-input {
  width: 100%;
  margin: 0;
  padding: 0.875rem 1rem;
  font-family: var(--main-font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--neu-80);
  background-color: var(--neu-0);
  border: 1px solid var(--neu-30);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.npy-form .npy-form-input::placeholder {
  color: var(--neu-40);
}

.npy-form .npy-form-input:hover {
  border-color: var(--neu-40);
}

.npy-form .npy-form-input:focus {
  outline: none;
  border-color: var(--pri);
  box-shadow: 0 0 0 3px var(--pri-5);
}

/* Erreur affichée uniquement après interaction (classe ajoutée en JS) */
.npy-form.is-submitted .npy-form-input:invalid,
.npy-form .npy-form-input.is-touched:invalid {
  border-color: var(--sec);
  box-shadow: 0 0 0 3px var(--sec-5);
}

.npy-form .npy-form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.75rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23512298' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 8px;
}

.npy-form .npy-form-select:invalid {
  color: var(--neu-40);
}

.npy-form .npy-form-select option {
  color: var(--neu-80);
}

.npy-form .npy-form-textarea {
  min-height: 160px;
  resize: vertical;
}

/* Choix multiples (même style que .tabs-item) */
.npy-form-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.npy-form-chip {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.npy-form-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.npy-form-chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--pri);
  padding: 0.625rem 1.25rem;
  border-radius: 24px;
  border: 2px solid var(--neu-20);
  background-color: var(--neu-0);
  transition: all 0.2s ease;
}

.npy-form-chip:hover span {
  background-color: var(--neu-10);
}

.npy-form-chip input:checked + span {
  border-color: var(--pri);
  background-color: var(--pri-5);
  font-weight: 600;
}

.npy-form-chip input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--pri-10);
}

/* Opt-in */
.npy-form-optin {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--pri-5);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--pri-90);
  cursor: pointer;
}

.npy-form-optin input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 2px 0 0 0;
  accent-color: var(--pri);
  cursor: pointer;
}

/* Messages de retour après envoi */
.npy-form-notice {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem !important;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

.npy-form-notice[hidden] {
  display: none;
}

.npy-form-notice-success {
  background: var(--vert-5);
  color: var(--vert-80);
}

.npy-form-notice-error {
  background: var(--sec-5);
  color: var(--sec-60);
}

/* reCAPTCHA */
.npy-form-captcha {
  margin-top: 1.5rem;
}

.npy-form-error {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sec-60);
  padding: 0 !important;
}

.npy-form-error[hidden] {
  display: none;
}

/* Pied de formulaire */
.npy-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.npy-form-mention {
  font-size: 0.875rem;
  color: var(--neu-50);
  padding: 0 !important;
}

.npy-form .npy-form-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--main-font);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.3s ease;
}

.npy-form .npy-form-submit i {
  height: 1rem;
  display: flex;
  align-items: center;
}

.npy-form .npy-form-submit:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Responsive */
@media screen and (max-width: 600px) {
  .npy-form {
    padding: 1.5rem 1.25rem;
  }

  .npy-form-grid {
    grid-template-columns: 1fr;
  }

  .npy-form-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .npy-form .npy-form-submit {
    justify-content: center;
  }
}

/* Le widget reCAPTCHA fait 304px de large : réduction sur les très petits écrans */
@media screen and (max-width: 360px) {
  .npy-form-captcha .g-recaptcha {
    transform: scale(0.85);
    transform-origin: 0 0;
  }
}
