/* Radar — full-bleed CTA overlay background (tablet+). Phone uses static green wash. */

.contact-radar-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none !important;
  overflow: hidden;
  display: none;
  background: transparent;
}

.contact-overlay.is-active.contact-overlay--radar-live .contact-radar-stage {
  display: block;
}

.contact-radar-stage.radar-container,
.contact-radar-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none !important;
}

/* Under Radar: kill drift gradient so canvas + scrim own the stack */
.contact-overlay.is-active.contact-overlay--radar-live::before {
  animation: none !important;
  background: #000000 !important;
}

/* Dark scrim between Radar and form — keeps text readable */
.contact-overlay.is-active.contact-overlay--radar-live::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(1, 151, 101, 0.12), transparent 62%),
    rgba(0, 0, 0, 0.72);
}

/* Phone / reduced-motion: static dark + soft green (no WebGL) */
.contact-overlay.is-active.contact-overlay--radar-static {
  background-color: #000000 !important;
}

.contact-overlay.is-active.contact-overlay--radar-static::before {
  animation: none !important;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(1, 151, 101, 0.18), transparent 58%),
    #000000 !important;
}

@keyframes contact-phone-green-breathe {
  0%,
  100% {
    opacity: 0.88;
    filter: brightness(0.95);
  }
  50% {
    opacity: 1;
    filter: brightness(1.08);
  }
}

@media (max-width: 639px) {
  .contact-overlay.is-active.contact-overlay--radar-static::before {
    animation: contact-phone-green-breathe 5.5s ease-in-out infinite !important;
    background:
      radial-gradient(ellipse 85% 62% at 50% 38%, rgba(1, 151, 101, 0.24), transparent 60%),
      radial-gradient(circle at 50% 50%, rgba(1, 151, 101, 0.06), transparent 45%),
      #000000 !important;
  }

  .contact-overlay.contact-overlay--success.is-active::before {
    animation: contact-phone-green-breathe 4.5s ease-in-out infinite !important;
    background:
      radial-gradient(ellipse 78% 58% at 50% 40%, rgba(1, 151, 101, 0.28), transparent 62%),
      #000000 !important;
  }
}

.contact-overlay.contact-overlay--success .contact-radar-stage {
  display: none !important;
}

.contact-overlay.is-active .contact-slide {
  position: relative;
  z-index: 2;
}

.contact-overlay.is-active .contact-slide-left,
.contact-overlay.is-active .contact-slide-right {
  position: relative;
  z-index: 2;
}

/* Modal entrance polish */
@media (prefers-reduced-motion: no-preference) {
  .contact-overlay.is-active {
    animation: contact-overlay-fade-in 0.2s ease-out both;
  }

  .contact-overlay.is-active .contact-slide {
    animation: contact-modal-rise 0.25s ease-out 0.05s both;
  }
}

@keyframes contact-overlay-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes contact-modal-rise {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Green focus accent to match Radar / success check */
.contact-overlay .form-control:focus {
  border-color: rgba(1, 151, 101, 0.75) !important;
  box-shadow: 0 0 0 3px rgba(1, 151, 101, 0.22) !important;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-overlay .contact-submit-btn:hover {
  filter: brightness(1.06);
  transform: scale(1.02);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.contact-overlay .contact-submit-btn:active {
  transform: scale(0.97);
}

@media (max-width: 639px) {
  .contact-overlay.is-active #rfq-message-overlay {
    min-height: 5.5rem;
    max-height: 8rem;
  }

  .contact-overlay.is-active #rfq-submit-btn-overlay {
    width: 100%;
  }

  .contact-overlay.is-active .contact-close-inline {
    display: none;
  }
}

/* Tablet: single column under 768; 2-col OK 768–1023 */
@media (min-width: 640px) and (max-width: 767px) {
  .contact-overlay.is-active {
    flex-direction: column;
    overflow-y: auto;
  }

  .contact-overlay.is-active .contact-slide-left,
  .contact-overlay.is-active .contact-slide-right {
    width: 100%;
    max-width: none;
    flex: 0 0 auto;
  }
}

@media (min-width: 1024px) {
  .contact-overlay.is-active {
    justify-content: center;
    align-items: stretch;
  }

  /* Cap modal content ~1400px on wide / ultra-wide */
  .contact-overlay.is-active .contact-slide-left,
  .contact-overlay.is-active .contact-slide-right {
    flex: 1 1 0;
    max-width: min(50%, 700px);
  }
}

@media (min-width: 1920px) {
  .contact-overlay.is-active {
    font-size: 112%;
  }

  .contact-overlay.is-active .form-control:focus-visible,
  .contact-overlay.is-active .contact-submit-btn:focus-visible,
  body.contact-overlay-open #contact-overlay-close:focus-visible {
    outline: 2px solid rgba(1, 151, 101, 0.95);
    outline-offset: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-overlay.is-active,
  .contact-overlay.is-active .contact-slide {
    animation: none !important;
  }

  .contact-overlay.is-active.contact-overlay--radar-static::before,
  .contact-overlay.contact-overlay--success.is-active::before {
    animation: none !important;
  }

  .contact-radar-stage {
    display: none !important;
  }
}
