/* ============ POPUP ETORO STYLES (Blue, snello) ============ */

/* Overlay */
.promo-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99998;
  display: none;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Popup */
.promo-popup {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  z-index: 99999;
  width: 90%;
  max-width: 450px;
  max-height: 90vh;
  display: none;
  animation: slideUp 0.4s ease forwards;
  overflow: hidden;
  overflow-y: auto;
}

/* Show states */
.promo-popup.show,
.promo-overlay.show { display: block; }

/* Evita overflow orizzontale dentro il popup */
.promo-popup,
.popup-contents,
.broker-showcase {
  max-width: 100%;
  overflow-x: hidden;
  word-break: break-word;
}
.popup-contents img {
  max-width: 100%;
  height: auto;
}

/* (Ridondante ma utile se usato standalone) */
html, body { overflow-x: hidden; }

/* Animations */
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }
@keyframes slideUp {
  from { opacity:0; transform: translate(-50%, -50%) scale(0.9); }
  to   { opacity:1; transform: translate(-50%, -50%) scale(1); }
}

/* Header */
.popup-header {
  /* Blue gradient */
  background: linear-gradient(135deg, #1a73e8, #4c99ff);
  padding: 14px 18px;
  position: relative;
}

/* Close button */
.popup-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%; border: 0;
  cursor: pointer;
  display:flex; align-items:center; justify-content:center;
  font-size: 18px; color:#2d2d2d; line-height:1;
  transition: transform .25s ease, background .25s ease;
}
.popup-close:hover { background:#fff; transform: rotate(90deg); }

/* Badge (più sobrio) */
.popup-badge {
  display:inline-block;
  background: rgba(255,255,255,0.9);
  color:#1a73e8;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

/* Titolo */
.popup-title {
  color:#fff;
  font-size: 20px; font-weight: 800;
  margin:0; line-height:1.2;
}

/* Contenuto */
.popup-contents { /* <-- importante: la tua HTML usa .popup-contents */
  padding: 18px;
  text-align:center;
}
.broker-showcase {
  display:flex; flex-direction:column; align-items:center;
  gap: 14px;
}

/* Logo */
.broker-logo-large {
  height: 40px;
  max-width: 200px;
  object-fit: contain;
}

/* Evidenza Offerta (in blu, più leggera) */
.offer-highlight {
  background: linear-gradient(135deg, #e7f0ff, #dfeaff);
  border: 1px solid #c7dafc;
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
  width: 100%;
  box-shadow: 0 3px 10px rgba(26,115,232,.12);
}
.offer-percentage {
  font-size: 34px; font-weight: 900;
  color:#1557b0; margin:0; line-height:1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.offer-text   { font-size: 16px; color:#1759b2; font-weight: 700; margin: 8px 0 4px; }
.offer-subtitle { font-size: 13px; color:#3a73c9; }

/* Body copy */
.challenge-text {
  font-size: 15px; font-weight: 600;
  color:#2f2f2f; margin: 10px 0 6px;
  line-height: 1.45;
}
.challenge-text .highlight {
  color:#0b57d0; text-decoration: underline; text-underline-offset:2px;
}

/* Feature chips */
.popup-features {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap: 8px;
  margin: 8px 0 6px;
  align-content: flex-start;
}
.popup-feature {
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size: 12px;
  color:#1f2937;
  background:#f3f6fb;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e3eaf6;
  line-height:1;
  justify-content: flex-start;
}

/* FIX icona check (prima era corrotto) */
.popup-feature::before {
  content: "✔";
  display:inline-block;
  font-weight: 800;
  line-height: 1;
  color: #1a73e8; /* blu coerente */
  transform: translateY(-1px);
}

/* CTA primaria */
.popup-cta {
  display:inline-block;
  background:#1a73e8; color:#fff;
  padding: 12px 26px;
  border-radius: 10px;
  font-weight: 700; font-size: 15px;
  text-decoration:none; transition: all .25s ease;
  box-shadow: 0 4px 12px rgba(26,115,232,0.24);
  margin-top: 4px; position:relative; overflow:hidden;
}
.popup-cta:hover {
  background:#1557b0;
  box-shadow: 0 6px 16px rgba(26,115,232,0.32);
  transform: translateY(-1px);
}

/* (Opzionale) Link secondario */
.popup-secondary { margin-top: 4px; }
.popup-more {
  font-size: 13px; color:#1a73e8;
  text-decoration: underline;
}

/* Footer compatto */
.popup-footer {
  background: #f5f7fb;
  padding: 10px 14px;
  text-align:center;
  border-top: 1px solid #e6ecf7;
}
.popup-disclaimer { font-size:10px; color:#6b7280; margin:0; }
.popup-timer      { font-size:11px; color:#9aa3b2; margin-top:4px; }

/* Scrollbar */
.promo-popup::-webkit-scrollbar { width:6px; }
.promo-popup::-webkit-scrollbar-track { background:#eef1f6; border-radius:10px; }
.promo-popup::-webkit-scrollbar-thumb { background:#b7c4d9; border-radius:10px; }
.promo-popup::-webkit-scrollbar-thumb:hover { background:#9fb0ca; }

/* Riduzione motion */
@media (prefers-reduced-motion: reduce) {
  .promo-overlay, .promo-popup { animation:none; }
  .popup-close:hover { transform:none; }
}

/* ======== RESPONSIVE ======== */

/* Smartphone piccoli (< 380px) */
@media (max-width: 380px) {
  .promo-popup{width: 90%;max-width:none;border-radius:12px;}
  .popup-header{ padding: 12px 14px; }
  .popup-title{ font-size: 18px; }
  .popup-contents{ padding: 14px; } /* fix: usiamo .popup-contents */
  .offer-percentage{ font-size: 30px; }
  .offer-text{ font-size: 14px; }
  .challenge-text{ font-size: 14px; }
  .popup-features{flex-direction: column;align-items: stretch;gap: 6px;text-align: left;}
  .popup-feature{padding: 6px 10px;}
  .popup-cta{ width:100%; padding: 12px 18px; font-size:14px; }
}

/* Smartphone standard (380px - 480px) */
@media (min-width:380px) and (max-width:480px){
  .promo-popup{ width:90%; max-width:380px; }
  .popup-contents{ padding:16px; }
  .offer-percentage{ font-size: 32px; }
  .challenge-text{ font-size: 14.5px; }
  .popup-cta{ width:100%; padding: 12px 22px; }
}

/* Phablet / Tablet piccoli (480px - 768px) */
@media (min-width:480px) and (max-width:768px){
  .promo-popup{ width:82%; max-width:380px; }
  .offer-percentage{ font-size: 36px; }
  .popup-cta{ padding: 13px 26px; }
}

/* Tablet (768px - 1024px) */
@media (min-width:768px) and (max-width:1024px){
  .promo-popup{ max-width: 440px; }
}

/* Desktop grandi (> 1280px) */
@media (min-width:1280px){
  .promo-popup{ max-width: 460px; }
  .popup-title{ font-size: 22px; }
}

/* Landscape mobile (altezza bassa) */
@media (max-height:500px) and (orientation:landscape){
  .promo-popup{ max-height:85vh; overflow-y:auto; }
  .popup-header{ padding: 10px 14px; }
  .popup-contents{ padding: 14px; }
  .offer-highlight{ padding: 10px; margin: 10px 0; }
  .offer-percentage{ font-size: 28px; }
  .popup-features{ margin: 8px 0; }
}
