/* Ener Systems — Cyber Score sticky visual popup card
 * Brand colors:
 *   #003a6b  primary dark blue
 *   #0066b3  primary light blue
 *   #c8102e  brand red
 *   #fff     white
 */

/* ===== Visual popup card (always visible, dismissible) ===== */
.es-cs-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 340px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 12, 28, 0.28),
              0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  font-family: inherit;
  animation: es-cs-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(0, 58, 107, 0.08);
}
@keyframes es-cs-slide-in {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.es-cs-card--hidden {
  display: none;
}

/* Header strip */
.es-cs-card__head {
  background: linear-gradient(135deg, #003a6b 0%, #0066b3 100%);
  color: #fff;
  padding: 16px 18px 14px;
  position: relative;
}
.es-cs-card__close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  padding: 0;
}
.es-cs-card__close:hover {
  background: rgba(255, 255, 255, 0.32);
}
.es-cs-card__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.es-cs-card__eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  opacity: 0.92;
  margin: 0 0 4px;
}
.es-cs-card__eyebrow-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c8102e;
  box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.6);
  animation: es-cs-pulse 2s infinite;
}
@keyframes es-cs-pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(200, 16, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 16, 46, 0); }
}
.es-cs-card__title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  line-height: 1.25;
  padding-right: 28px;
}

/* Body */
.es-cs-card__body {
  padding: 14px 18px 16px;
}
.es-cs-card__lead {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
  color: #344054;
}
.es-cs-card__lead strong {
  color: #003a6b;
}

/* The CTA button — bold red, single click goes to cyber score */
.es-cs-card__cta {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #c8102e 0%, #a30d24 100%);
  color: #fff !important;
  text-align: center;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25);
}
.es-cs-card__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(200, 16, 46, 0.4);
}
.es-cs-card__cta:focus-visible {
  outline: 3px solid #003a6b;
  outline-offset: 2px;
}

.es-cs-card__footnote {
  font-size: 11px;
  color: #667085;
  text-align: center;
  margin: 10px 0 0;
  line-height: 1.5;
}

/* Mobile: anchor to bottom-right, leave gutter, respect iOS safe area */
@media (max-width: 540px) {
  .es-cs-card {
    width: auto;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: none;
    border-radius: 12px;
  }
  .es-cs-card__head {
    padding: 14px 16px 12px;
  }
  .es-cs-card__title {
    font-size: 16px;
    padding-right: 32px;
  }
  .es-cs-card__close {
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    font-size: 22px;
  }
  .es-cs-card__eyebrow {
    font-size: 9px;
    letter-spacing: 1.2px;
    margin: 0 0 2px;
  }
  .es-cs-card__body {
    padding: 12px 16px 14px;
  }
  .es-cs-card__lead {
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 10px;
  }
  .es-cs-card__cta {
    padding: 13px 16px;
    font-size: 14px;
    min-height: 44px;
  }
  .es-cs-card__footnote {
    font-size: 10px;
    margin: 8px 0 0;
  }
}

/* ===== Minimized icon (shows when user clicks minus on the card) ===== */
.es-cs-mini {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #003a6b 0%, #0066b3 100%);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 16px 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 24px rgba(0, 12, 28, 0.32),
              0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: es-cs-mini-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.es-cs-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 12, 28, 0.4),
              0 4px 12px rgba(0, 0, 0, 0.12);
}
.es-cs-mini:focus-visible {
  outline: 3px solid #c8102e;
  outline-offset: 2px;
}
@keyframes es-cs-mini-pop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.es-cs-mini__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c8102e;
  box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.6);
  animation: es-cs-pulse 2s infinite;
  flex-shrink: 0;
}
.es-cs-mini__label {
  white-space: nowrap;
}
.es-cs-mini--hidden {
  display: none !important;
}

@media (max-width: 540px) {
  /* On mobile, the minimized icon is a compact circular button —
     not a pill with text — so it doesn't block the mobile menu. */
  .es-cs-mini {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    padding: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
  }
  .es-cs-mini__label {
    display: none;
  }
  .es-cs-mini__dot {
    width: 14px;
    height: 14px;
  }
}

/* Pages that opt-out */
body[data-es-no-widget] .es-cs-card,
body[data-es-no-widget] .es-cs-mini {
  display: none !important;
}
