/**
 * Shared contact popup and standalone footer-style CTA.
 */

.tnstack-contact-cta-standalone {
  --tnstack-footer-primary: var(--theme-palette-color-1, #2d6bff);
  --tnstack-footer-primary-rgb: 45, 107, 255;
  --tnstack-footer-surface: rgba(255, 255, 255, 0.045);
  --tnstack-footer-border: rgba(255, 255, 255, 0.1);
  --tnstack-footer-text: #aeb9c9;
  --tnstack-footer-heading: #f7f9fc;
  width: min(
    calc(100% - 32px),
    var(--theme-normal-container-max-width, 1290px)
  );
  margin: clamp(64px, 8vw, 110px) auto;
  color: var(--tnstack-footer-text);
  font-family: var(--theme-font-family, Manrope, sans-serif);
}

.tnstack-contact-cta-standalone *,
.tnstack-contact-cta-standalone *::before,
.tnstack-contact-cta-standalone *::after,
.tnstack-contact-modal *,
.tnstack-contact-modal *::before,
.tnstack-contact-modal *::after {
  box-sizing: border-box;
}

body.tnstack-contact-modal-open {
  overflow: hidden;
}
.tnstack-contact-modal[hidden] {
  display: none;
}

.tnstack-contact-modal {
  --contact-primary: #2d6bff;
  --contact-primary-dark: #1a2b5c;
  --contact-primary-rgb: 45, 107, 255;
  --contact-text: #d2d7dc;
  --contact-heading: #fff;
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  font-family: var(--theme-font-family, Manrope, sans-serif);
}

.tnstack-contact-modal__backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: rgba(1, 4, 10, 0.78);
  backdrop-filter: blur(10px);
  transition: opacity 0.22s ease;
}

.tnstack-contact-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  color: var(--contact-text);
  background:
    radial-gradient(
      circle at 90% 0,
      rgba(var(--contact-primary-rgb), 0.22),
      transparent 30%
    ),
    linear-gradient(145deg, #0b101c, #070a11 72%);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  scrollbar-width: thin;
}

.tnstack-contact-modal.is-open .tnstack-contact-modal__backdrop {
  opacity: 1;
}
.tnstack-contact-modal.is-open .tnstack-contact-modal__dialog {
  opacity: 1;
  transform: none;
}

.tnstack-contact-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #b8c1cf;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.tnstack-contact-modal__close:hover {
  color: #fff;
  border-color: rgba(var(--contact-primary-rgb), 0.5);
  background: rgba(var(--contact-primary-rgb), 0.1);
}
.tnstack-contact-modal__close svg {
  width: 21px;
  height: 21px;
}
.tnstack-contact-modal__header {
  padding-right: 42px;
}
.tnstack-contact-modal__header > span {
  color: #9eb5ff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tnstack-contact-modal__header h2 {
  margin: 8px 0 12px;
  color: var(--contact-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 850;
  letter-spacing: -0.025em;
  line-height: 1.16;
  text-wrap: balance;
}
.tnstack-contact-modal__header p {
  margin: 0 0 27px;
  color: #9ba5b5;
  font-size: 0.9rem;
  line-height: 1.65;
}

.tnstack-contact-form {
  display: grid;
  gap: 17px;
}
.tnstack-contact-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.tnstack-contact-form__field {
  display: grid;
  gap: 8px;
  margin: 0;
}
.tnstack-contact-form__field > span {
  color: #dbe1ec;
  font-size: 0.78rem;
  font-weight: 700;
}
.tnstack-contact-form__field b {
  color: #77a0ff;
}

.tnstack-contact-form :where(input, select, textarea) {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  outline: 0;
  color: #eef2f8;
  background: rgba(0, 0, 0, 0.28);
  font: inherit;
  font-size: 0.88rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.tnstack-contact-form textarea {
  min-height: 112px;
  resize: vertical;
}
.tnstack-contact-form select {
  color-scheme: dark;
}
.tnstack-contact-form :where(input, select, textarea):focus {
  border-color: var(--contact-primary);
  background: rgba(var(--contact-primary-rgb), 0.055);
  box-shadow: 0 0 0 3px rgba(var(--contact-primary-rgb), 0.14);
}
.tnstack-contact-form :where(input, textarea)::placeholder {
  color: #687487;
}
.tnstack-contact-form__website {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.tnstack-contact-form__status {
  min-height: 0;
  margin: -3px 0;
  font-size: 0.8rem;
  line-height: 1.5;
}
.tnstack-contact-form__status:empty {
  display: none;
}
.tnstack-contact-form__status.is-error {
  color: #ff9f9f;
}
.tnstack-contact-form__status.is-success {
  padding: 11px 13px;
  border: 1px solid rgba(83, 197, 138, 0.3);
  border-radius: 8px;
  color: #a8e8c4;
  background: rgba(83, 197, 138, 0.08);
}

.tnstack-contact-form__submit {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 13px 22px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--contact-primary);
  box-shadow: 0 14px 30px rgba(var(--contact-primary-rgb), 0.25);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
}

.tnstack-contact-form__submit:hover {
  background: #3e78ff;
  transform: translateY(-1px);
}
.tnstack-contact-form__submit:disabled {
  cursor: wait;
  opacity: 0.72;
}
.tnstack-contact-form__submit svg {
  width: 19px;
  height: 19px;
}
.tnstack-contact-form__submit.is-loading svg {
  animation: tnstack-contact-pulse 0.8s ease-in-out infinite alternate;
}
.tnstack-contact-form__privacy {
  margin: -5px 0 0;
  color: #6f7a8b;
  font-size: 0.7rem;
  line-height: 1.5;
  text-align: center;
}

@keyframes tnstack-contact-pulse {
  to {
    transform: translateX(5px);
    opacity: 0.45;
  }
}

@media (max-width: 600px) {
  .tnstack-contact-cta-standalone {
    width: min(
      calc(100% - 24px),
      var(--theme-normal-container-max-width, 1290px)
    );
  }
  .tnstack-contact-modal {
    padding: 10px;
  }
  .tnstack-contact-modal__dialog {
    max-height: calc(100dvh - 20px);
    padding: 30px 20px 24px;
    border-radius: 15px;
  }
  .tnstack-contact-modal__close {
    top: 12px;
    right: 12px;
  }
  .tnstack-contact-modal__header {
    padding-right: 36px;
  }
  .tnstack-contact-form__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tnstack-contact-modal * {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
