/* =================================================================
   LeadMagnet Popup – Frontend Styles
   ================================================================= */

/* ---- Overlay --------------------------------------------------- */
#wplmp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: wplmp-fade-in 0.25s ease;
  backdrop-filter: blur(3px);
}

@keyframes wplmp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- Popup-Box ------------------------------------------------- */
#wplmp-popup {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  width: 100%;
  padding: 2.25rem 2rem 2rem;
  position: relative;
  animation: wplmp-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 95vh;
  overflow-y: auto;
}

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

/* ---- Schließen-Button ------------------------------------------ */
#wplmp-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #aaa;
  padding: 0.1rem 0.3rem;
  transition: color 0.15s;
}
#wplmp-close:hover { color: #333; }

/* ---- Bild ---------------------------------------------------- */
.wplmp-img-wrap {
  text-align: center;
  margin-bottom: 1rem;
}
.wplmp-img-wrap img {
  max-height: 140px;
  width: auto;
  border-radius: 10px;
  object-fit: cover;
}

/* ---- Emoji & Überschriften ------------------------------------ */
.wplmp-emoji {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

#wplmp-popup h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #111;
  text-align: center;
  margin: 0 0 0.4rem;
  line-height: 1.25;
}

.wplmp-subtitle {
  text-align: center;
  color: #555;
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

/* ---- Lead-Magnet-Box ----------------------------------------- */
.wplmp-magnet-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 2px solid;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.wplmp-magnet-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.wplmp-magnet-box strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111;
  display: block;
  margin-bottom: 0.2rem;
}

.wplmp-magnet-box p {
  font-size: 0.82rem;
  color: #666;
  margin: 0;
  line-height: 1.45;
}

/* ---- Formular ------------------------------------------------- */
#wplmp-form { display: flex; flex-direction: column; gap: 0.65rem; }

.wplmp-field { display: flex; flex-direction: column; gap: 0.2rem; }

#wplmp-form input[type="text"],
#wplmp-form input[type="email"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.92rem;
  color: #222;
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

#wplmp-form input:focus {
  border-color: var(--wplmp-accent, #7C3AED);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
  background: #fff;
}

#wplmp-form input.wplmp-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ---- Checkbox ------------------------------------------------- */
.wplmp-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

.wplmp-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--wplmp-accent, #7C3AED);
  cursor: pointer;
}

.wplmp-checkbox span {
  font-size: 0.78rem;
  color: #666;
  line-height: 1.45;
}

.wplmp-checkbox a { color: var(--wplmp-accent, #7C3AED); }

/* ---- Fehlermeldungen ------------------------------------------ */
.wplmp-error {
  font-size: 0.75rem;
  color: #ef4444;
  display: none;
}
.wplmp-error.wplmp-visible { display: block; }

/* ---- Absende-Button ------------------------------------------- */
.wplmp-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  margin-top: 0.35rem;
  line-height: 1.2;
}

.wplmp-btn:hover  { filter: brightness(1.08); }
.wplmp-btn:active { transform: scale(0.98); }
.wplmp-btn:disabled { filter: brightness(0.75); cursor: not-allowed; }

/* ---- Erfolgsbereich ------------------------------------------- */
#wplmp-success {
  text-align: center;
  padding: 0.5rem 0;
}

.wplmp-success-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

#wplmp-success h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #111;
  margin: 0 0 0.5rem;
}

#wplmp-success p {
  color: #555;
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
  line-height: 1.55;
}

.wplmp-btn--close { margin-top: 0; }

/* ---- Loader --------------------------------------------------- */
.wplmp-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wplmp-spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

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

/* ---- Responsive ----------------------------------------------- */
@media (max-width: 520px) {
  #wplmp-popup {
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: 14px;
  }
  #wplmp-popup h2 { font-size: 1.2rem; }
}
