/* NOVALOOM — модалка после отправки формы */
.thanks-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 28px);
  pointer-events: none;
}
.thanks-modal[hidden] {
  display: none !important;
}
.thanks-modal.is-visible {
  pointer-events: auto;
}
body.thanks-open {
  overflow: hidden;
}

.thanks-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.62);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  opacity: 0;
}
.thanks-modal.is-visible .thanks-modal__backdrop {
  animation: thanks-fade-in 0.45s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) forwards;
}

.thanks-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.thanks-confetti__piece {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: thanks-confetti-fall 1.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

.thanks-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: center;
  opacity: 0;
  transform: scale(0.9) translateY(24px);
}
.thanks-modal.is-visible .thanks-modal__panel {
  animation: thanks-panel-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.thanks-modal__card {
  position: relative;
  padding: 32px 28px 26px;
  border-radius: 22px;
  background: linear-gradient(165deg, #141414 0%, #0a0a0a 52%, #1a1210 100%);
  color: #faf7f1;
  border: 1px solid rgba(255, 61, 46, 0.35);
  box-shadow:
    0 0 0 1px rgba(217, 255, 58, 0.08),
    0 32px 90px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(255, 61, 46, 0.12);
  overflow: hidden;
}
.thanks-modal__card::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 61, 46, 0.22) 0%, transparent 68%);
  pointer-events: none;
}
.thanks-modal__card::after {
  content: '';
  position: absolute;
  right: -20%;
  bottom: -30%;
  width: 55%;
  height: 55%;
  background: radial-gradient(circle, rgba(217, 255, 58, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

.thanks-modal--error .thanks-modal__card {
  border-color: rgba(255, 180, 80, 0.4);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(255, 160, 60, 0.1);
}
.thanks-modal--error .thanks-modal__card::before {
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 160, 60, 0.2) 0%, transparent 68%);
}

.thanks-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.thanks-modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.thanks-modal__icon {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
}
.thanks-modal__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.thanks-modal__icon-ring {
  fill: none;
  stroke: rgba(217, 255, 58, 0.35);
  stroke-width: 2;
  transform-origin: 36px 36px;
  animation: thanks-ring-spin 8s linear infinite;
}
.thanks-modal.is-visible .thanks-modal__icon-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: thanks-check-draw 0.55s 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.thanks-modal--error .thanks-modal__icon-ring {
  stroke: rgba(255, 180, 80, 0.4);
  animation: none;
}
.thanks-modal__icon-warn {
  display: none;
}
.thanks-modal--error .thanks-modal__icon-check,
.thanks-modal--error .thanks-modal__icon-ring {
  display: none;
}
.thanks-modal--error .thanks-modal__icon-warn {
  display: block;
}
.thanks-modal--error .thanks-modal__icon-check {
  display: none;
}

.thanks-modal__eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(217, 255, 58, 0.12);
  border: 1px solid rgba(217, 255, 58, 0.28);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime, #d9ff3a);
}
.thanks-modal__eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime, #d9ff3a);
  box-shadow: 0 0 12px var(--lime, #d9ff3a);
  animation: thanks-pulse-dot 1.4s ease-in-out infinite;
}
.thanks-modal--error .thanks-modal__eyebrow {
  background: rgba(255, 160, 60, 0.12);
  border-color: rgba(255, 160, 60, 0.35);
  color: #ffc98a;
}
.thanks-modal--error .thanks-modal__eyebrow-dot {
  background: #ffc98a;
  box-shadow: 0 0 12px rgba(255, 160, 60, 0.8);
}

.thanks-modal__panel h2 {
  position: relative;
  z-index: 1;
  font-family: var(--font-display, 'Unbounded', sans-serif);
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 10px;
  color: #fff;
}
.thanks-modal__panel h2 em {
  font-style: normal;
  color: var(--accent, #ff3d2e);
}
.thanks-modal--error .thanks-modal__panel h2 em {
  color: #ffb84d;
}

.thanks-modal__panel > p,
.thanks-modal__lead {
  position: relative;
  z-index: 1;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 20px;
  max-width: 34em;
  margin-left: auto;
  margin-right: auto;
}

.thanks-modal__perks {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
}
.thanks-modal__perks li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
}
.thanks-modal__perks strong {
  display: block;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lime, #d9ff3a);
  margin-bottom: 2px;
  font-weight: 600;
}
.thanks-modal--error .thanks-modal__perks {
  display: none;
}

.thanks-modal__cta {
  position: relative;
  z-index: 1;
  width: 100%;
  justify-content: center;
  font-size: 15px;
}
.thanks-modal__cta .arrow {
  transition: transform 0.25s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.thanks-modal__cta:hover .arrow {
  transform: translateX(4px);
}
.thanks-modal__cta.btn-send {
  width: 100%;
  margin-top: 0;
}

@keyframes thanks-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes thanks-panel-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(24px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes thanks-check-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes thanks-ring-spin {
  to { transform: rotate(360deg); }
}
@keyframes thanks-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}
@keyframes thanks-confetti-fall {
  0% {
    opacity: 1;
    transform: translate(calc(-50% + var(--x, 0px)), -50%) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + 220px)) rotate(var(--rot, 180deg)) scale(0.6);
  }
}

@media (max-width: 480px) {
  .thanks-modal {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    align-items: flex-end;
  }
  .thanks-modal__panel {
    width: 100%;
    max-width: none;
  }
  .thanks-modal__card {
    padding: 26px 20px 22px;
    border-radius: 20px 20px 16px 16px;
    max-height: min(92vh, 640px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .thanks-modal__perks li {
    font-size: 13px;
    padding: 10px 12px;
  }
  .thanks-modal__panel h2 {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thanks-modal.is-visible .thanks-modal__backdrop,
  .thanks-modal.is-visible .thanks-modal__panel,
  .thanks-modal.is-visible .thanks-modal__icon-check,
  .thanks-confetti__piece,
  .thanks-modal__icon-ring,
  .thanks-modal__eyebrow-dot {
    animation: none !important;
  }
  .thanks-modal__panel,
  .thanks-modal.is-visible .thanks-modal__panel {
    opacity: 1;
    transform: none;
  }
  .thanks-modal__backdrop,
  .thanks-modal.is-visible .thanks-modal__backdrop {
    opacity: 1;
  }
  .thanks-modal.is-visible .thanks-modal__icon-check {
    stroke-dashoffset: 0;
  }
}

.thanks-modal__brief {
  display: block;
  margin: 0 0 14px;
  text-align: center;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent, #FF3D2E);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.thanks-modal__brief:hover {
  filter: brightness(1.08);
}
