.ai-home-popup {
  position: fixed;
  inset: 0;
  width: min(500px, calc(100vw - 32px));
  max-width: none;
  max-height: min(554px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 2px;
  background: #f4f5fb;
  color: #191825;
  box-shadow: 0 20px 70px rgb(0 0 0 / 28%);
  font-family: "DM Sans", sans-serif;
}

.ai-home-popup[open] {
  display: grid;
  grid-template-rows: minmax(0, 342px) auto;
  animation: ai-home-popup-enter 220ms ease-out both;
}

.ai-home-popup::backdrop {
  background: rgb(0 0 0 / 62%);
  animation: ai-home-popup-backdrop 180ms ease-out both;
}

.ai-home-popup__picture {
  display: block;
  height: 100%;
}

.ai-home-popup__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.ai-home-popup__close-form {
  position: absolute;
  top: 20px;
  right: 20px;
  margin: 0;
}

.ai-home-popup__close {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  background: #fff;
  color: #0000b3;
  cursor: pointer;
}

.ai-home-popup__close span {
  position: relative;
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
}

.ai-home-popup__close span::before,
.ai-home-popup__close span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.ai-home-popup__close span::before { width: 1.5px; height: 16px; }
.ai-home-popup__close span::after { width: 16px; height: 1.5px; }

.ai-home-popup__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 40px 32px;
  text-align: center;
}

.ai-home-popup__content h2 {
  margin: 0 0 12px;
  color: #0000b3;
  font-family: Panama, "DM Sans", sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ai-home-popup__content p {
  max-width: 420px;
  margin: 0;
  color: #191825;
  font-size: 14px;
  line-height: 1.65;
}

.ai-home-popup__cta {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding: 10px 18px;
  background: #0000b3;
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 140ms ease;
}

.ai-home-popup__cta:hover { background: #001b5b; }
.ai-home-popup__cta:focus-visible, .ai-home-popup__close:focus-visible { outline: 2px solid #0000b3; outline-offset: 3px; }
.ai-home-popup__close:focus-visible { outline-color: #fff; }

.ai-home-popup__arrow {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

@keyframes ai-home-popup-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ai-home-popup-backdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 600px) {
  .ai-home-popup[open] {
    grid-template-rows: minmax(0, 236px) auto;
  }

  .ai-home-popup__content { padding: 24px 24px 32px; }
  .ai-home-popup__content h2 { font-size: 24px; }
  .ai-home-popup__content p { font-size: 14px; }
  .ai-home-popup__cta { margin-top: 22px; }
  .ai-home-popup__close-form { top: 14px; right: 14px; }
}

@media (max-height: 620px) {
  .ai-home-popup { max-height: calc(100dvh - 24px); }
  .ai-home-popup[open] { grid-template-rows: minmax(0, 42dvh) auto; }
  .ai-home-popup__content { padding-block: 18px; }
  .ai-home-popup__content h2 { margin-bottom: 8px; }
  .ai-home-popup__cta { min-height: 42px; margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-home-popup[open], .ai-home-popup::backdrop { animation: none; }
  .ai-home-popup__cta { transition: none; }
}