/*
 * Newsletter Brevo du pied de page (template :
 * modules/ps_emailsubscription/views/templates/hook/ps_emailsubscription.tpl).
 * La pilule elle-meme reutilise les styles existants (.newsletter-input-group,
 * pere-blaize-footer.css / pere-blaize-recette-v3.css) ; ici : ce que le script
 * Brevo ajoute (messages, erreurs, chargement, champ piege).
 */
.pb-brevo-newsletter .sib-form-container,
.pb-brevo-newsletter .sib-container,
.pb-brevo-newsletter #sib-form,
.pb-brevo-newsletter .form__entry,
.pb-brevo-newsletter .sib-input {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Champ anti-robot de Brevo : jamais visible. */
.pb-brevo-newsletter .input--hidden {
  display: none !important;
}

/* Messages de retour (masques tant que Brevo ne les active pas). */
.pb-brevo-newsletter .sib-form-message-panel {
  display: none;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 22px;
  font-family: var(--pb-font-body, "Mabry Pro"), sans-serif;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.pb-brevo-newsletter .sib-form-message-panel--active {
  display: block;
}

.pb-brevo-newsletter .pb-nl-message--success {
  background: #f4f1ec;
  color: #2b3824;
}

.pb-brevo-newsletter .pb-nl-message--success .sib-form-message-panel__inner-text::before {
  content: "\f00c"; /* fa-check */
  margin-right: 8px;
  color: #a57140;
  font-family: "FontAwesome";
}

.pb-brevo-newsletter .pb-nl-message--error {
  background: #f6e3dc;
  color: #7a2e1d;
}

/* Erreur de saisie (adresse invalide / vide). */
.pb-brevo-newsletter .entry__error {
  display: block;
  margin: 8px 0 0;
  color: #f6e3dc;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
}

.pb-brevo-newsletter .entry__error:empty {
  display: none;
}

.pb-brevo-newsletter .entry_errored .newsletter-input-group {
  box-shadow: 0 0 0 2px #f6e3dc;
}

/* Bouton : enveloppe au repos, roue de chargement pendant l'envoi. */
.pb-brevo-newsletter .btn-subscribe svg {
  display: none;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.pb-brevo-newsletter .btn-subscribe svg:not(.sib-hide-loader-icon) {
  display: inline-block;
  animation: pb-nl-spin 0.9s linear infinite;
}

.pb-brevo-newsletter .btn-subscribe svg:not(.sib-hide-loader-icon) + .fa {
  display: none;
}

.pb-brevo-newsletter .btn-subscribe.sib-form-block__button-disabled {
  cursor: progress;
  opacity: 0.7;
}

@keyframes pb-nl-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Le pied de page force le texte du champ en blanc (ancien fond transparent)
   et masque les <label> : on retablit la saisie lisible et le message d'erreur. */
#footer-container-main .pb-brevo-newsletter .newsletter-input-group .input-subscription {
  color: #2b3824 !important;
  -webkit-text-fill-color: #2b3824;
  caret-color: #2b3824;
}

#footer-container-main .pb-brevo-newsletter .entry__error:not(:empty) {
  display: block !important;
}

#footer-container-main .pb-brevo-newsletter .newsletter-input-group .btn-subscribe {
  color: #2b3824;
}

/* --- Popup d'inscription (accueil, bouton "Inscrivez-vous a notre newsletter") ---
   Le formulaire du pied de page y est deplace : styles propres a la fenetre. */
.pb-nl-dialog {
  width: calc(100% - 32px);
  max-width: 500px;
  padding: 40px 36px 30px;
  border: 0;
  border-radius: 18px;
  background: #f4f1ec;
  box-shadow: 0 20px 60px rgb(43 56 36 / 30%);
  color: #3f3a33;
  text-align: center;
}

.pb-nl-dialog::backdrop {
  background: rgb(43 56 36 / 55%);
}

.pb-nl-dialog[open] {
  animation: pb-nl-in 220ms ease-out;
}

@keyframes pb-nl-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.pb-nl-dialog__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2b3824;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.pb-nl-dialog__kicker {
  margin: 0 0 4px;
  color: #a57140;
  font-family: var(--pb-font-script, "PB Snell Roundhand"), cursive;
  font-size: 26px;
  line-height: 1.2;
}

.pb-nl-dialog__title {
  margin: 0 0 12px;
  color: #2b3824;
  font-family: "PB Copperplate", sans-serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-wrap: balance;
}

.pb-nl-dialog__text {
  margin: 0 0 22px;
  font-family: var(--pb-font-body, "Mabry Pro"), sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.pb-nl-dialog__legal {
  margin: 14px 0 0;
  color: #6b6358;
  font-size: 12.5px;
  line-height: 1.45;
}

/* Champ + bouton */
.pb-nl-dialog .newsletter-input-group {
  position: relative;
  display: flex;
  width: 100%;
  height: 54px;
}

.pb-nl-dialog .newsletter-input-group::before,
.pb-nl-dialog .newsletter-input-group::after {
  content: none !important;
}

.pb-nl-dialog .newsletter-input-group .input-subscription {
  flex: 1 1 auto;
  width: 100%;
  height: 54px;
  padding: 0 64px 0 22px;
  border: 1px solid #cfc7ba;
  border-radius: 27px !important;
  background: #fff;
  color: #2b3824;
  -webkit-text-fill-color: #2b3824;
  font-size: 16px;
  box-shadow: none;
}

.pb-nl-dialog .newsletter-input-group .input-subscription:focus {
  border-color: #2b3824;
  outline: 2px solid #2b3824;
  outline-offset: 2px;
}

.pb-nl-dialog .newsletter-input-group .input-group-append {
  position: absolute;
  top: 5px;
  right: 5px;
  bottom: 5px;
  margin: 0;
}

.pb-nl-dialog .newsletter-input-group .btn-subscribe {
  display: inline-flex;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50% !important;
  background: #a57140 !important;
  color: #fff;
  font-size: 17px;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.pb-nl-dialog .newsletter-input-group .btn-subscribe:is(:hover, :focus-visible) {
  background: #2b3824 !important;
}

/* Messages et erreurs sur fond clair */
.pb-nl-dialog .entry__error {
  color: #9b3a22;
  text-align: left;
  padding-left: 22px;
}

.pb-nl-dialog .entry__error:not(:empty) {
  display: block !important;
}

.pb-nl-dialog .entry_errored .input-subscription {
  border-color: #9b3a22;
}

.pb-nl-dialog .entry_errored .newsletter-input-group {
  box-shadow: none;
}

.pb-nl-dialog .pb-nl-message--success {
  border: 1px solid #d9d1c4;
  background: #fff;
}

@media (max-width: 575px) {
  .pb-nl-dialog {
    padding: 36px 20px 24px;
  }

  .pb-nl-dialog__title {
    font-size: 19px;
  }
}

/* Bouton du pied de page qui ouvre la popup : reprend la pilule existante
   (.newsletter-input-group) ; on neutralise seulement les styles de <button>. */
#footer-container-main .pb-nl-open {
  appearance: none;
  cursor: pointer;
  text-align: center;
}

#footer-container-main .pb-nl-open:focus-visible {
  outline: 2px solid var(--pb-ink, #2b3824);
  outline-offset: 3px;
}

#footer-container-main .pb-nl-open:hover {
  background: #fff !important;
}

.pb-brevo-newsletter .pb-nl-store[hidden] {
  display: none !important;
}
