/* ===== MBS Conditional Popups - Clean Professional Design ===== */

/* Variables */
:root {
  --mbs-popup-trustpilot: #00b67a;
  --mbs-popup-trustpilot-hover: #00a169;
  --mbs-popup-bg: #ffffff;
  --mbs-popup-overlay: rgba(0, 0, 0, 0.5);
  --mbs-popup-text: #1a1a1a;
  --mbs-popup-text-light: #666666;
  --mbs-popup-border: #e0e0e0;
  --mbs-popup-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  --mbs-popup-radius: 12px;
}

/* Visibility & overlay */
#mbs-popup-backdrop[aria-hidden="true"],
#mbs-popup-modal[aria-hidden="true"] {
  display: none;
}

#mbs-popup-backdrop {
  position: fixed;
  inset: 0;
  background: var(--mbs-popup-overlay);
  z-index: 99998;
  animation: fadeIn 0.2s ease-out;
}

#mbs-popup-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Card */
.mbs-popup-card {
  width: min(500px, 100%);
  background: var(--mbs-popup-bg);
  border-radius: var(--mbs-popup-radius);
  border: 1px solid var(--mbs-popup-border);
  box-shadow: var(--mbs-popup-shadow);
  color: var(--mbs-popup-text);
  position: relative;
  overflow: hidden;
  animation: scaleIn 0.25s ease-out;
}

/* Grid */
.mbs-popup-grid {
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Cover column - Hidden */
.mbs-popup-col-cover {
  display: none;
}

/* Copy column */
.mbs-popup-col-copy {
  padding: 48px 40px 40px;
  text-align: center;
}

/* Remove stars */
.mbs-popup-col-copy::before {
  display: none;
}

/* Remove Trustpilot badge */
.mbs-popup-col-copy::after {
  display: none;
}

/* Close button */
.mbs-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 0;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  z-index: 10;
  transition: color 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mbs-popup-close:hover {
  color: #666;
}

/* Typography */
.mbs-popup-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 20px;
  color: var(--mbs-popup-text);
  letter-spacing: -0.3px;
}

.mbs-popup-lead {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  margin: 12px 0;
  color: var(--mbs-popup-text-light);
}

.mbs-popup-lead:last-of-type {
  margin-bottom: 32px;
}

.mbs-popup-lead strong,
.mbs-popup-title .mbs-hl,
.mbs-popup-lead .mbs-hl {
  color: var(--mbs-popup-trustpilot);
  font-weight: 600;
}

/* Actions */
.mbs-popup-actions {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mbs-popup-btn {
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 14px 24px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1px;
  transition: all 0.15s ease;
  position: relative;
}

.mbs-popup-btn-primary {
  background: var(--mbs-popup-trustpilot);
  color: #ffffff;
}

.mbs-popup-btn-primary:hover {
  background: var(--mbs-popup-trustpilot-hover);
}

.mbs-popup-btn-primary:active {
  transform: scale(0.98);
}

.mbs-popup-btn-secondary {
  background: #f5f5f5;
  color: #666;
}

.mbs-popup-btn-secondary:hover {
  background: #ebebeb;
  color: #555;
}

.mbs-popup-btn-secondary:active {
  transform: scale(0.98);
}

/* ====== Responsive ====== */

@media (max-width: 640px) {
  #mbs-popup-modal {
    padding: 16px;
  }

  .mbs-popup-card {
    border-radius: 10px;
  }

  .mbs-popup-col-copy {
    padding: 40px 28px 32px;
  }

  .mbs-popup-title {
    font-size: 23px;
    margin-bottom: 16px;
  }

  .mbs-popup-lead {
    font-size: 14px;
    margin: 10px 0;
  }

  .mbs-popup-lead:last-of-type {
    margin-bottom: 28px;
  }

  .mbs-popup-btn {
    padding: 13px 20px;
    font-size: 14px;
  }

  .mbs-popup-close {
    top: 12px;
    right: 12px;
    font-size: 22px;
  }
}

@media (max-width: 380px) {
  .mbs-popup-col-copy {
    padding: 36px 24px 28px;
  }

  .mbs-popup-title {
    font-size: 21px;
  }

  .mbs-popup-lead {
    font-size: 13px;
  }

  .mbs-popup-btn {
    padding: 12px 18px;
    font-size: 13px;
  }
}
