.stelo-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 350ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.stelo-popup.is-active {
  opacity: 1;
}

.stelo-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 2, 23, 0.5);
  cursor: pointer;
}

.stelo-popup__container {
  position: relative;
  background: #ffffff;
  max-width: 540px;
  width: 90%;
  padding: 40px 44px;
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.19);
  transform: scale(0.9);
  transition: transform 350ms cubic-bezier(0.22, 0.61, 0.36, 1);
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.is-active .stelo-popup__container {
  transform: scale(1);
}
.stelo-popup__container .stelo-popup__illustration,
.stelo-popup__container .stelo-popup__text-content,
.stelo-popup__container .stelo-popup__buttons,
.stelo-popup__container .stelo-popup__form,
.stelo-popup__container .stelo-popup__trust-badge,
.stelo-popup__container .stelo-popup__note,
.stelo-popup__container .stelo-popup__cf7-wrapper {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 350ms cubic-bezier(0.22, 0.61, 0.36, 1), transform 350ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.is-active .stelo-popup__container .stelo-popup__illustration {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 60ms;
}
.is-active .stelo-popup__container .stelo-popup__text-content {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 80ms;
}
.is-active .stelo-popup__container .stelo-popup__trust-badge {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 200ms;
}
.is-active .stelo-popup__container .stelo-popup__buttons,
.is-active .stelo-popup__container .stelo-popup__form,
.is-active .stelo-popup__container .stelo-popup__cf7-wrapper {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 200ms;
}
.is-active .stelo-popup__container .stelo-popup__note {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 260ms;
}

.stelo-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  border-radius: 50%;
  transition: background-color 200ms ease, color 200ms ease;
  padding: 0;
}
.stelo-popup__close:hover, .stelo-popup__close:focus {
  background-color: #e5e7eb;
  color: #374151;
}
.stelo-popup__close:focus-visible {
  outline: 2px solid #3A5BF0;
  outline-offset: 2px;
}

.stelo-popup__heading {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.5px;
  color: #212127;
  text-align: center;
  width: 100%;
}

.stelo-popup__body {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: #6B7280;
  text-align: center;
  width: 100%;
}
.stelo-popup__body p {
  margin: 0;
}
.stelo-popup__body hr {
  border: none;
  width: 48px;
  height: 3px;
  background: #d7daf9;
  border-radius: 2px;
  margin: 20px auto;
}

.stelo-popup__text-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.stelo-popup__highlight {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  color: #3a5bf0;
  text-align: center;
  width: 100%;
}

.stelo-popup__illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, #3a5bf0 0%, #6b8af2 50%, #d7daf9 100%);
}

.stelo-popup__trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f0f4ff;
  color: #3a5bf0;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 100px;
}

.stelo-popup__trust-icon {
  flex-shrink: 0;
}

.stelo-popup__note {
  font-size: 13px;
  font-weight: 500;
  color: #9CA3AF;
  text-align: center;
  margin: 0;
}

.stelo-popup__buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.stelo-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 200ms ease, transform 100ms ease;
}
.stelo-popup__btn:hover, .stelo-popup__btn:focus {
  opacity: 0.8;
}
.stelo-popup__btn:active {
  transform: scale(0.98);
}
.stelo-popup__btn img {
  width: 150px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.stelo-popup__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.stelo-popup__field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.stelo-popup__field-row {
  display: flex;
  gap: 14px;
}
.stelo-popup__field-row .stelo-popup__field {
  flex: 1;
  min-width: 0;
}

.stelo-popup__label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.stelo-popup__label--sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stelo-popup__input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 200ms ease;
  box-sizing: border-box;
  height: 52px;
}
.stelo-popup__input:focus-visible {
  outline: 2px solid transparent;
  border-color: #3A5BF0;
  box-shadow: 0 0 0 3px rgba(58, 91, 240, 0.3);
}

.stelo-popup__input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 0 18px;
  transition: border-color 200ms ease;
  background: #fff;
}
.stelo-popup__input-wrap:focus-within {
  border-color: #3A5BF0;
  box-shadow: 0 0 0 3px rgba(58, 91, 240, 0.3);
}
.stelo-popup__input-wrap .stelo-popup__input {
  border: none;
  border-radius: 0;
  padding: 14px 0;
  height: 52px;
  box-sizing: border-box;
}
.stelo-popup__input-wrap .stelo-popup__input:focus-visible {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}
.stelo-popup__field--error .stelo-popup__input-wrap {
  border-color: #e74c3c;
}
.stelo-popup__field--error .stelo-popup__input-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.stelo-popup__input-icon {
  flex-shrink: 0;
  color: #9CA3AF;
  width: 20px;
  height: 20px;
}

.stelo-popup__textarea {
  resize: vertical;
  min-height: 110px;
  padding: 16px 18px;
}

.stelo-popup__field--error .stelo-popup__input {
  border-color: #e74c3c;
}
.stelo-popup__field--error .stelo-popup__input:focus-visible {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.stelo-popup__field-error {
  font-size: 13px;
  color: #e74c3c;
  margin-top: 4px;
  min-height: 0;
}
.stelo-popup__field-error:empty {
  display: none;
}

.stelo-popup__btn--submit {
  width: 100%;
  height: 54px;
  background-color: #3A5BF0;
  color: #fff;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  gap: 10px;
  border: none;
}
.stelo-popup__btn--submit > * {
  margin: 0;
}
.stelo-popup__btn--submit:hover, .stelo-popup__btn--submit:focus {
  background-color: #2F4DD6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(58, 91, 240, 0.35);
}
.stelo-popup__btn--submit:focus-visible {
  outline: 2px solid #3A5BF0;
  outline-offset: 2px;
}
.stelo-popup__btn--submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.stelo-popup__btn-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.stelo-popup__spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: stelo-spin 0.6s linear infinite;
}

@keyframes stelo-spin {
  to {
    transform: rotate(360deg);
  }
}
.stelo-popup__message {
  font-size: 14px;
  line-height: 1.5;
  min-height: 0;
  padding: 0;
  border-radius: 12px;
  transition: all 200ms ease;
}
.stelo-popup__message--success {
  background-color: #eafaf1;
  color: #27ae60;
  padding: 12px 16px;
  border: 1px solid rgba(39, 174, 96, 0.2);
}
.stelo-popup__message--error {
  background-color: #fdf0ef;
  color: #e74c3c;
  padding: 12px 16px;
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.stelo-popup__success-state {
  text-align: center;
  padding: 24px 0;
}

.stelo-popup__success-checkmark {
  width: 52px;
  height: 52px;
  color: #27ae60;
  margin-bottom: 16px;
}

.stelo-popup__success-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: stelo-circle 600ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.stelo-popup__success-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stelo-check 300ms cubic-bezier(0.22, 0.61, 0.36, 1) 400ms forwards;
}

@keyframes stelo-circle {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes stelo-check {
  to {
    stroke-dashoffset: 0;
  }
}
.stelo-popup__success-text {
  font-size: 16px;
  font-weight: 600;
  color: #212127;
  margin: 0;
}

.stelo-popup__drag-handle {
  display: none;
}

.stelo-popup__cf7-wrapper .wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stelo-popup__cf7-wrapper .wpcf7-form-control-wrap {
  display: block;
}
.stelo-popup__cf7-wrapper input[type=text],
.stelo-popup__cf7-wrapper input[type=email],
.stelo-popup__cf7-wrapper input[type=tel],
.stelo-popup__cf7-wrapper input[type=url],
.stelo-popup__cf7-wrapper input[type=number],
.stelo-popup__cf7-wrapper textarea,
.stelo-popup__cf7-wrapper select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 200ms ease;
  box-sizing: border-box;
}
.stelo-popup__cf7-wrapper input[type=text]:focus-visible,
.stelo-popup__cf7-wrapper input[type=email]:focus-visible,
.stelo-popup__cf7-wrapper input[type=tel]:focus-visible,
.stelo-popup__cf7-wrapper input[type=url]:focus-visible,
.stelo-popup__cf7-wrapper input[type=number]:focus-visible,
.stelo-popup__cf7-wrapper textarea:focus-visible,
.stelo-popup__cf7-wrapper select:focus-visible {
  outline: 2px solid transparent;
  border-color: #3A5BF0;
  box-shadow: 0 0 0 3px rgba(58, 91, 240, 0.3);
}
.stelo-popup__cf7-wrapper textarea {
  resize: vertical;
  min-height: 110px;
}
.stelo-popup__cf7-wrapper input[type=submit] {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #3A5BF0;
  color: #fff;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 200ms ease, transform 100ms ease;
}
.stelo-popup__cf7-wrapper input[type=submit]:hover, .stelo-popup__cf7-wrapper input[type=submit]:focus {
  background-color: #2F4DD6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(58, 91, 240, 0.35);
}
.stelo-popup__cf7-wrapper input[type=submit]:active {
  transform: scale(0.98);
}
.stelo-popup__cf7-wrapper .wpcf7-not-valid-tip {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 4px;
}
.stelo-popup__cf7-wrapper .wpcf7-response-output {
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 16px;
  border-radius: 12px;
  margin: 0;
}
.stelo-popup__cf7-wrapper .wpcf7-mail-sent-ok,
.stelo-popup__cf7-wrapper .wpcf7-response-output[class*=sent] {
  background-color: #eafaf1;
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, 0.2);
}
.stelo-popup__cf7-wrapper .wpcf7-validation-errors,
.stelo-popup__cf7-wrapper .wpcf7-acceptance-missing {
  background-color: #fdf0ef;
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.2);
}
.stelo-popup__cf7-wrapper .wpcf7-spinner {
  margin: 0 auto;
}

@media (max-width: 767px) {
  .stelo-popup {
    align-items: flex-end;
  }
  .stelo-popup__drag-handle {
    display: block;
    width: 36px;
    height: 4px;
    background: #d0d5dd;
    border-radius: 2px;
    margin: 0 auto 12px;
  }
  .stelo-popup__container {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 24px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 350ms cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .is-active .stelo-popup__container {
    transform: translateY(0);
  }
  .stelo-popup__heading {
    font-size: 22px;
  }
  .stelo-popup__buttons {
    flex-direction: column;
  }
  .stelo-popup__field-row {
    flex-direction: column;
  }
  .stelo-popup__btn img {
    width: 150px;
    height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stelo-popup,
  .stelo-popup__container,
  .stelo-popup__illustration,
  .stelo-popup__text-content,
  .stelo-popup__heading,
  .stelo-popup__body,
  .stelo-popup__highlight,
  .stelo-popup__buttons,
  .stelo-popup__form,
  .stelo-popup__trust-badge,
  .stelo-popup__note,
  .stelo-popup__cf7-wrapper {
    transition: none !important;
    animation: none !important;
    transition-delay: 0ms !important;
  }
  .stelo-popup__container .stelo-popup__illustration,
  .stelo-popup__container .stelo-popup__text-content,
  .stelo-popup__container .stelo-popup__heading,
  .stelo-popup__container .stelo-popup__body,
  .stelo-popup__container .stelo-popup__highlight,
  .stelo-popup__container .stelo-popup__buttons,
  .stelo-popup__container .stelo-popup__form,
  .stelo-popup__container .stelo-popup__trust-badge,
  .stelo-popup__container .stelo-popup__note,
  .stelo-popup__container .stelo-popup__cf7-wrapper {
    opacity: 1;
    transform: none;
  }
  .stelo-popup__success-circle,
  .stelo-popup__success-check {
    animation: none !important;
    stroke-dashoffset: 0;
  }
}
