/* YID Newsletter — Popup styles */

#yidnl-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.55);
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
}

#yidnl-overlay.yidnl-visible {
  display: flex;
}

@keyframes yidnl-slide-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#yidnl-overlay.yidnl-visible #yidnl-popup {
  animation: yidnl-slide-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#yidnl-popup {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px 24px;
  max-width: 440px;
  width: calc(100% - 32px);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

#yidnl-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #777;
  padding: 6px 9px;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}

#yidnl-close:hover {
  color: #111;
  background: rgba(0, 0, 0, 0.07);
}

#yidnl-popup h2 {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 700;
  color: #111;
}

#yidnl-popup > p:not(#yidnl-legal) {
  margin: 0 0 28px;
  font-size: 17px;
  color: #555;
  line-height: 1.55;
}

/* Conteneur relatif pour le bouton Google + overlay iframe */
#yidnl-btn-container {
  position: relative;
  margin-bottom: 12px;
}

/* Iframe Google invisible positionnée sur le bouton custom pour capturer les clics */
#yidnl-google-btn-wrapper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.01;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Boutons communs */
.yidnl-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.yidnl-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.yidnl-btn:active {
  transform: translateY(0);
}

/* Bouton Google (bleu) */
.yidnl-btn-google {
  background: #4285f4;
  color: #fff;
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.4);
  pointer-events: none; /* les clics vont à l'iframe au-dessus */
}

/* Bouton e-mail (gris discret) */
.yidnl-btn-email {
  background: #f0f0f0;
  color: #555;
}

/* Séparateur "ou" */
.yidnl-or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  color: #ccc;
  font-size: 12px;
}

.yidnl-or-divider::before,
.yidnl-or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e8e8e8;
}

#yidnl-dismiss {
  display: block;
  background: none;
  border: none;
  font-size: 13px;
  color: #999;
  cursor: pointer;
  margin: 0 auto;
  text-decoration: underline;
}

#yidnl-dismiss:hover {
  color: #555;
}

#yidnl-popup .yidnl-success {
  color: #2e7d32;
  font-size: 15px;
  font-weight: 600;
  margin-top: 12px;
}

#yidnl-popup .yidnl-error {
  color: #c62828;
  font-size: 13px;
  margin-top: 8px;
}

#yidnl-legal {
  margin: 16px 0 0;
  font-size: 12px;
  color: #aaa;
  line-height: 1.5;
  text-align: left;
}

#yidnl-legal a {
  color: #aaa;
  text-decoration: underline;
}

#yidnl-legal a:hover {
  color: #666;
}

#yidnl-branding {
  margin: -10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 10px;
  font-size: 10px;
  color: #bbb;
}

#yidnl-branding a {
  display: flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.15s;
}

#yidnl-branding a:hover {
  opacity: 0.7;
}

#yidnl-branding img {
  width: 60px;
  height: auto;
  display: block;
}

/*
 * iOS Safari uniquement : étend le fond blanc sous la popup pour couvrir
 * la zone visible entre la carte et la barre URL du navigateur.
 */
@media (max-width: 480px) {
  #yidnl-overlay {
    padding-bottom: 0;
    align-items: flex-end;
  }

  #yidnl-popup {
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 100%;
    padding: 32px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  #yidnl-popup::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 200px;
    background: #fff;
    pointer-events: none;
  }
}
