/* Nexus cohort modal + IoT video play trigger */

.iot-video-trigger {
  position: relative;
  display: block;
  cursor: pointer;
  border: none;
  padding: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}

.iot-video-trigger:focus-visible {
  outline: 3px solid #15d365;
  outline-offset: 4px;
  border-radius: 30px;
}

.iot-video-trigger .img-100 {
  display: block;
  width: 100%;
  height: auto;
}

.iot-play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4.5rem;
  height: 4.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(3, 4, 94, 0.88);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.iot-video-trigger:hover .iot-play-btn,
.iot-video-trigger:focus-visible .iot-play-btn {
  transform: translate(-50%, -50%) scale(1.06);
  background: #15d365;
  color: #03045e;
}

.iot-play-btn svg {
  width: 1.75rem;
  height: 1.75rem;
  margin-left: 0.2rem;
}

.jk-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  box-sizing: border-box;
}

.jk-modal[hidden] {
  display: none !important;
}

.jk-modal__confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100000;
}

.jk-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 94, 0.72);
  backdrop-filter: blur(4px);
}

.jk-modal__dialog {
  position: relative;
  z-index: 100001;
  width: 100%;
  max-width: 32rem;
  max-height: min(94vh, 920px);
  overflow: auto;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  padding: 1.5rem 1.5rem 1.75rem;
  box-sizing: border-box;
}

.jk-modal__dialog--cohort {
  max-width: min(94vw, 18.5rem);
  max-height: min(92vh, 640px);
  padding: 0.6rem 0.65rem 0.75rem;
}

.jk-modal:not([hidden]) .jk-modal__dialog--cohort {
  animation: jk-dialog-pop 0.55s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

@keyframes jk-dialog-pop {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
  }
  70% {
    transform: scale(1.03) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .jk-modal:not([hidden]) .jk-modal__dialog--cohort {
    animation: none;
  }
}

.jk-modal__close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 5;
  width: 1.65rem;
  height: 1.65rem;
  font-size: 1rem;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #03045e;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.jk-modal__close:hover {
  background: #03045e;
  color: #fff;
}

.jk-modal__badge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.3rem;
}

.jk-modal__badge {
  display: inline-block;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #03045e;
  background: #15d365;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(21, 211, 101, 0.45);
  animation: jk-badge-jubilate 1.6s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes jk-badge-jubilate {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }
  20% {
    transform: scale(1.12) translateY(-4px);
  }
  40% {
    transform: scale(0.95) translateY(0);
  }
  60% {
    transform: scale(1.08) translateY(-2px);
  }
  80% {
    transform: scale(1.02) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .jk-modal__badge {
    animation: none;
  }
}

.jk-modal__title {
  margin: 0 0 0.25rem;
  padding: 0 1.1rem;
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.25;
  color: #03045e;
  text-align: center;
}

.jk-modal__lead {
  margin: 0 auto 0.35rem;
  padding: 0 0.15rem;
  max-width: 100%;
  font-size: 0.625rem;
  line-height: 1.4;
  color: #4a5568;
  text-align: center;
}

.jk-modal__highlights {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  margin: 0 auto 0.35rem;
  max-width: 100%;
}

.jk-modal__pill {
  display: inline-block;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #03045e;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  line-height: 1.2;
}

.jk-modal__pill--actd {
  background: linear-gradient(135deg, #e8f8ef 0%, #f0fdf4 100%);
  border-color: #15d365;
  color: #03045e;
  box-shadow: 0 2px 10px rgba(21, 211, 101, 0.2);
}

.jk-modal__video-stage {
  position: relative;
  width: min(100%, 14rem);
  max-width: 14rem;
  margin: 0 auto 0.45rem;
  aspect-ratio: 9 / 16;
  min-height: 10rem;
  max-height: min(50vh, 17.5rem);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #03045e;
  box-shadow: 0 8px 24px rgba(3, 4, 94, 0.18);
}

.jk-modal__video-stage.is-playing {
  background: #000;
}

.jk-modal__video-poster,
.jk-modal__video-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

.jk-modal__video-poster {
  z-index: 2;
  display: block;
  cursor: pointer;
}

.jk-modal__video-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.4rem;
  z-index: 3;
  margin: 0;
  font-size: 0.5625rem;
  font-weight: 600;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.jk-modal__video-poster.is-hidden {
  display: none;
}

.jk-modal__video-poster-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.jk-modal__video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(3, 4, 94, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}

.jk-modal__video-play:hover,
.jk-modal__video-play:focus-visible {
  transform: translate(-50%, -50%) scale(1.06);
  background: #15d365;
  color: #03045e;
  outline: none;
}

.jk-modal__video-play svg {
  width: 1.2rem;
  height: 1.2rem;
  margin-left: 0.12rem;
}

.jk-modal__video-wrap {
  z-index: 1;
  background: #000;
}

.jk-modal__video-wrap[hidden] {
  display: none !important;
}

.jk-modal__iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.jk-modal__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
}

.jk-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.jk-modal__btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.jk-modal__btn--primary {
  width: 100%;
  max-width: 11rem;
  margin-left: auto;
  margin-right: auto;
  background: #03045e;
  color: #fff;
}

.jk-modal__btn--ghost {
  background: transparent;
  color: #64748b;
  font-weight: 600;
}

.jk-modal__view[hidden] {
  display: none !important;
}

body.jk-modal-open {
  overflow: hidden;
}

@media (min-width: 480px) and (max-width: 991px) {
  .jk-modal__dialog--cohort {
    max-width: min(92vw, 20rem);
    padding: 0.7rem 0.75rem 0.85rem;
  }

  .jk-modal__title {
    font-size: 0.95rem;
  }

  .jk-modal__lead {
    font-size: 0.6875rem;
  }

  .jk-modal__video-stage {
    width: min(100%, 15rem);
    max-width: 15rem;
    max-height: min(52vh, 18.5rem);
  }

  .jk-modal__btn--primary {
    max-width: 12.5rem;
  }
}

@media (max-width: 379px) {
  .jk-modal__dialog--cohort {
    max-width: min(96vw, 17rem);
    padding: 0.5rem 0.55rem 0.65rem;
  }

  .jk-modal__title {
    font-size: 0.8125rem;
    padding: 0 1rem;
  }

  .jk-modal__lead {
    font-size: 0.6rem;
  }

  .jk-modal__video-stage {
    width: min(100%, 12.5rem);
    max-width: 12.5rem;
    max-height: min(46vh, 15.5rem);
  }

  .jk-modal__btn--primary {
    max-width: 11rem;
    font-size: 0.625rem;
  }
}

/* Desktop: larger square video; mobile keeps portrait 9:16 above */
@media (min-width: 992px) {
  .jk-modal__dialog--cohort {
    max-width: min(92vw, 36rem);
    max-height: min(94vh, 900px);
    padding: 1.5rem 1.75rem 1.75rem;
  }

  .jk-modal__btn--primary {
    max-width: 22rem;
    font-size: 0.9375rem;
    padding: 0.65rem 1.25rem;
  }

  .jk-modal__title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .jk-modal__lead {
    font-size: 0.9375rem;
    margin-bottom: 0.65rem;
  }

  .jk-modal__badge {
    font-size: 0.6875rem;
    padding: 0.28rem 0.65rem;
  }

  .jk-modal__video-stage {
    width: min(100%, 28rem);
    max-width: 28rem;
    aspect-ratio: 1 / 1;
    min-height: 20rem;
    max-height: min(72vh, 28rem);
    margin-bottom: 0.75rem;
    border-radius: 1rem;
  }

  .jk-modal__video-poster-img {
    object-fit: cover;
    object-position: center top;
  }
}
