/* ==========================================================================
   TPS Empire - Contact Form Popup Modal & Feedback Styles
   ========================================================================== */

/* Modal Backdrop Overlay */
.tps-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(13, 18, 43, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.tps-popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Modal Window Card */
.tps-popup-card {
  position: relative;
  background: #ffffff;
  border-radius: 28px;
  padding: 44px 38px 38px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 
    0 25px 50px -12px rgba(13, 18, 43, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.9) inset,
    0 0 40px rgba(50, 62, 221, 0.12);
  transform: scale(0.85) translateY(24px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.tps-popup-overlay.is-visible .tps-popup-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Top Colorful Glow Accent */
.tps-popup-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #323edd 0%, #6366f1 50%, #ea580c 100%);
  border-radius: 28px 28px 0 0;
}

/* Close Icon Button (Top Right) */
.tps-popup-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  z-index: 10;
}

.tps-popup-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

.tps-popup-close-btn:focus {
  outline: 2px solid #323edd;
  outline-offset: 2px;
}

.tps-popup-close-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* Animated Success Icon Container */
.tps-popup-icon-box {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pulse Ripple Rings Behind Icon */
.tps-popup-ripple-1,
.tps-popup-ripple-2 {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
}

.tps-popup-ripple-1 {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0) 70%);
  animation: tpsPulseGlow 2.4s infinite ease-out;
}

.tps-popup-ripple-2 {
  background: radial-gradient(circle, rgba(50, 62, 221, 0.2) 0%, rgba(50, 62, 221, 0) 70%);
  animation: tpsPulseGlow 2.4s infinite ease-out 1.2s;
}

@keyframes tpsPulseGlow {
  0% {
    transform: scale(0.85);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.3;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* SVG Success Circle & Checkmark */
.tps-popup-svg-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  stroke-width: 3.5;
  stroke: #10b981;
  stroke-miterlimit: 10;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
  filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.25));
}

.tps-check-circle {
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  stroke-width: 3.5;
  stroke-miterlimit: 10;
  stroke: #10b981;
  fill: #ecfdf5;
  transition: all 0.6s cubic-bezier(0.65, 0, 0.45, 1);
}

.tps-popup-overlay.is-visible .tps-check-circle {
  stroke-dashoffset: 0;
  animation: tpsStrokeCircle 0.65s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.tps-check-path {
  transform-origin: 50% 50%;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  stroke: #10b981;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tps-popup-overlay.is-visible .tps-check-path {
  stroke-dashoffset: 0;
  animation: tpsStrokeCheck 0.45s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

@keyframes tpsStrokeCircle {
  0% {
    stroke-dashoffset: 260;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes tpsStrokeCheck {
  0% {
    stroke-dashoffset: 60;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* Modal Title */
.tps-popup-title {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #0d122b;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

/* Modal Body Text */
.tps-popup-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #556075;
  margin: 0 0 20px 0;
  font-weight: 400;
}

/* Metadata Badge (Inquiry summary details) */
.tps-popup-meta-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 26px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tps-popup-meta-item {
  font-size: 13.5px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tps-popup-meta-label {
  font-weight: 700;
  color: #1e293b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 65px;
}

.tps-popup-meta-value {
  color: #323edd;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* Main Action Button */
.tps-popup-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 28px;
  background: linear-gradient(135deg, #323edd 0%, #1e28b8 100%);
  color: #ffffff !important;
  font-size: 15.5px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 10px 25px -4px rgba(50, 62, 221, 0.45);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.tps-popup-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(50, 62, 221, 0.55);
  background: linear-gradient(135deg, #3c48e8 0%, #2531cc 100%);
}

.tps-popup-action-btn:active {
  transform: translateY(1px);
}

.tps-popup-action-btn:focus {
  outline: 3px solid rgba(50, 62, 221, 0.4);
  outline-offset: 2px;
}

/* Form Inline Validation Feedback & Subtle Shake */
.contactForm .form-control.tps-input-error {
  border-color: #ef4444 !important;
  background-color: #fff5f5 !important;
  animation: tpsFieldShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes tpsFieldShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.tps-field-error-msg {
  color: #ef4444;
  font-size: 12px;
  margin-top: 5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Submit Button Loading / Sending State */
.btn-primary.tps-btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.88;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.tps-btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: tpsSpin 0.75s infinite linear;
  display: inline-block;
}

@keyframes tpsSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Body Scroll Lock when modal is active */
body.tps-popup-open {
  overflow: hidden !important;
  padding-right: var(--scrollbar-width, 0px);
}
