/* ===================================================================
   Lead Magnet & YouTube Lazy Load Styles
   =================================================================== */

/* --- YouTube Lazy Facade --- */
.youtube-lazy {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 24px auto;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background: #1a1a1a;
  transition: box-shadow .3s ease;
}

.youtube-lazy:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.youtube-lazy-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.youtube-lazy-playbtn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  z-index: 2;
  opacity: 0.9;
  transition: opacity .2s ease, transform .2s ease;
}

.youtube-lazy:hover .youtube-lazy-playbtn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.youtube-lazy-playbtn svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Loader shown while iframe is initializing */
.youtube-lazy-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.youtube-lazy-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: youtube-lazy-spin 0.8s linear infinite;
}

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

/* Focus-visible for keyboard users */
.youtube-lazy:focus-visible {
  outline: 3px solid #008B8B;
  outline-offset: 4px;
}

/* When iframe is loaded, remove pointer cursor from container */
.youtube-lazy.loaded {
  cursor: default;
}

.youtube-lazy.loaded .youtube-lazy-playbtn,
.youtube-lazy.loaded .youtube-lazy-thumbnail {
  display: none;
}

/* --- In-Content CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, #006666 0%, #008B8B 100%);
  border-radius: 14px;
  padding: 40px 36px;
  text-align: center;
  margin: 32px 0 24px;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.cta-banner::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.cta-banner h3 {
  color: #fff !important;
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 10px;
  position: relative;
  z-index: 1;
}

.cta-banner p {
  color: rgba(255,255,255,0.92);
  font-size: 16px;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 24px;
  position: relative;
  z-index: 1;
}

.cta-banner .btn-cta-banner {
  display: inline-block;
  background: #fff;
  color: #008B8B !important;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 14px 36px;
  text-transform: uppercase;
  border-radius: 6px;
  transition: all .3s ease;
  text-decoration: none;
  cursor: pointer;
  border: none;
  position: relative;
  z-index: 1;
}

.cta-banner .btn-cta-banner:hover {
  background: #e8f4f4;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  text-decoration: none;
}

@media (max-width: 576px) {
  .cta-banner {
    padding: 32px 20px;
  }
  .cta-banner h3 {
    font-size: 22px;
  }
}

/* --- Exit-Intent Popup --- */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.65);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: popup-fade-in .3s ease;
}

.popup-overlay.active {
  display: flex;
}

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

.popup-modal {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px 40px;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  animation: popup-slide-up .35s ease;
}

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

.popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  transition: color .2s ease;
}

.popup-close:hover {
  color: #333;
}

.popup-modal h2 {
  font-size: 26px;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0 0 10px;
  text-align: center;
}

.popup-modal .popup-subtitle {
  font-size: 15px;
  color: #666;
  text-align: center;
  margin: 0 0 8px;
  line-height: 1.6;
}

.popup-modal .popup-benefits {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
  text-align: left;
}

.popup-modal .popup-benefits li {
  position: relative;
  padding: 6px 0 6px 28px;
  font-size: 14px;
  color: #444;
  line-height: 1.5;
}

.popup-modal .popup-benefits li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #008B8B;
  font-weight: 700;
  font-size: 16px;
}

.popup-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup-form input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color .2s ease;
  box-sizing: border-box;
}

.popup-form input[type="email"]:focus {
  outline: none;
  border-color: #008B8B;
  box-shadow: 0 0 0 3px rgba(0,139,139,0.1);
}

.popup-form .btn-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #006666 0%, #008B8B 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all .3s ease;
}

.popup-form .btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,139,139,0.3);
}

.popup-form .btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.popup-form .popup-notice {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin: 4px 0 0;
}

.popup-form .popup-success {
  display: none;
  text-align: center;
  padding: 16px;
  color: #008B8B;
  font-weight: 600;
  font-size: 16px;
}

.popup-form .popup-success.active {
  display: block;
}

.popup-form .popup-error {
  display: none;
  color: #d32f2f;
  font-size: 13px;
  text-align: center;
  margin: 0;
}

.popup-form .popup-error.active {
  display: block;
}

.popup-form .popup-error-dsgvo {
  display: none;
  color: #d32f2f;
  font-size: 13px;
  text-align: center;
  margin: 0;
}

.popup-form .popup-error-dsgvo.active {
  display: block;
}

.popup-form .popup-dsgvo {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  margin: 4px 0;
  text-align: left;
}

.popup-form .popup-dsgvo input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.popup-form .popup-dsgvo a {
  color: #008B8B;
  text-decoration: underline;
}

@media (max-width: 576px) {
  .popup-modal {
    padding: 36px 24px 32px;
  }
  .popup-modal h2 {
    font-size: 22px;
  }
}
