/* Ener Systems — "Are you looking for Managed IT?" scroll-triggered popup
 *
 * Fires after 7 seconds + any scroll activity. Yes → /discoverycall/.
 * No → dismiss for 24h.
 *
 * Brand colors:
 *   #003a6b  primary dark blue
 *   #0066b3  primary light blue
 *   #c8102e  brand red
 */

.es-mit-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 12, 28, 0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  animation: es-mit-fade-in 0.25s ease forwards;
  backdrop-filter: blur(2px);
}

@keyframes es-mit-fade-in {
  to { opacity: 1; }
}

.es-mit-popup-overlay--closing {
  animation: es-mit-fade-out 0.2s ease forwards;
}

@keyframes es-mit-fade-out {
  to { opacity: 0; }
}

.es-mit-popup {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0, 12, 28, 0.4),
              0 4px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: inherit;
  transform: translateY(20px) scale(0.97);
  animation: es-mit-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
  position: relative;
}

@keyframes es-mit-slide-up {
  to { transform: translateY(0) scale(1); }
}

.es-mit-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  padding: 0;
  z-index: 2;
}
.es-mit-popup__close:hover {
  background: rgba(255, 255, 255, 0.32);
}
.es-mit-popup__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.es-mit-popup__header {
  background: linear-gradient(135deg, #003a6b 0%, #0066b3 100%);
  color: #fff;
  padding: 32px 24px 28px;
  text-align: center;
}

.es-mit-popup__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  opacity: 0.85;
  margin: 0 0 10px;
}

.es-mit-popup__title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.3px;
}

.es-mit-popup__body {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.es-mit-popup__btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  letter-spacing: 0.2px;
}

.es-mit-popup__btn--yes {
  background: linear-gradient(135deg, #c8102e 0%, #a30d24 100%);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25);
}
.es-mit-popup__btn--yes:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(200, 16, 46, 0.4);
}
.es-mit-popup__btn--yes:focus-visible {
  outline: 3px solid #003a6b;
  outline-offset: 2px;
}

.es-mit-popup__btn--no {
  background: #f0f4f8;
  color: #344054 !important;
  border: 1px solid #d0d7de;
}
.es-mit-popup__btn--no:hover {
  background: #e6ebef;
}
.es-mit-popup__btn--no:focus-visible {
  outline: 2px solid #003a6b;
  outline-offset: 2px;
}

.es-mit-popup__footnote {
  font-size: 12px;
  color: #667085;
  text-align: center;
  margin: 8px 0 0;
  line-height: 1.45;
}

/* Mobile: full-width-ish modal, slightly smaller padding */
@media (max-width: 480px) {
  .es-mit-popup__header {
    padding: 24px 20px 20px;
  }
  .es-mit-popup__title {
    font-size: 20px;
  }
  .es-mit-popup__body {
    padding: 20px;
  }
}

/* Honor opt-out attribute on body */
body[data-es-no-popup] .es-mit-popup-overlay {
  display: none !important;
}
