/* ============================================================
   RTCL Success Alerts – Premium Popup Styles
   ============================================================ */

/* ---------- Golden Header Menu & Buttons ---------- */
.main-header .main-navigation-area .main-navigation ul li a,
.rt-mobile-menu .offscreen-navigation ul li a {
  color: #d4af37 !important;
}

.main-header .main-navigation-area .main-navigation ul.menu > li > a:hover,
.main-header .main-navigation-area .main-navigation ul li a:hover,
.main-header .main-navigation-area .main-navigation ul li.current-menu-item > a {
  color: #b8860b !important;
}

.header-icon-area .header-btn-area .header-btn {
  color: #ffffff !important;
  background: linear-gradient(135deg, #f0c95a 0%, #d4af37 100%) !important;
  border: 1px solid #d4af37 !important;
}

.header-icon-area .header-btn-area .header-btn:hover {
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%) !important;
  border: 1px solid transparent !important;
}

.header-icon-area .header-btn-area .header-btn i {
  background-color: #ffffff !important;
  color: #d4af37 !important;
}

.header-icon-area .header-btn-area .header-btn:hover i {
  color: #d4af37 !important;
}

.header-icon-area .header-login-icon {
  border: 1px solid #d4af37 !important;
  background: #fdf6e0 !important;
  color: #b8860b !important;
}

.header-icon-area .header-login-icon:hover {
  border: 1px solid transparent !important;
  background: #d4af37 !important;
  color: #ffffff !important;
}

/* ---------- UsersWP Login / Register form fields ---------- */
.uwp_page .uwp_form {
  max-width: 420px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.uwp_page .uwp_form .form-control {
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
  background: #fffdf5;
  border: 1.5px solid #d9b64f;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(180, 140, 20, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.uwp_page .uwp_form .form-control:hover {
  border-color: #c9a227;
}

.uwp_page .uwp_form .form-control:focus {
  border-color: #b8860b;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.25);
  outline: none;
}

.uwp_page .uwp_form .input-group-text {
  border: 1.5px solid #d9b64f;
  background: #fdf6e0;
  color: #a97c0e;
  border-radius: 12px;
}

.uwp_page .uwp-form-password-wrap .uwp-password-wrap .form-control,
.uwp_page .uwp-password-wrap .form-control {
  padding-right: 48px;
}

.uwp_page .uwp_form .uwp_login_submit,
.uwp_page .uwp_form .uwp_register_submit {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #4a3500;
  background: linear-gradient(135deg, #f0c95a 0%, #d4af37 100%);
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 20px -6px rgba(212, 175, 55, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.uwp_page .uwp_form .uwp_login_submit:hover,
.uwp_page .uwp_form .uwp_register_submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -8px rgba(212, 175, 55, 0.65);
}

/* ---------- Overlay ---------- */
.cgsa-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

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

/* ---------- Card ---------- */
.cgsa-popup {
  position: relative;
  width: 420px;
  max-width: 92vw;
  padding: 48px 36px 36px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow:
    0 25px 60px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  text-align: center;
  transform: scale(0.7) translateY(30px);
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.35s ease;
}

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

/* Glow ring behind card */
.cgsa-popup::before {
  content: "";
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.25) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ---------- Icon Wrapper ---------- */
.cgsa-popup__icon-wrapper {
  position: absolute;
  top: -44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.cgsa-popup__icon-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 24px -4px rgba(34, 197, 94, 0.5),
    0 0 0 5px #ffffff;
}

/* ---------- SVG Checkmark ---------- */
.cgsa-popup__checkmark {
  width: 44px;
  height: 44px;
}

.cgsa-popup__checkmark-circle {
  stroke: #ffffff;
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: cgsa-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.2s forwards;
}

.cgsa-popup__checkmark-check {
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: cgsa-stroke 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

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

/* ---------- Titles ---------- */
.cgsa-popup__title {
  margin: 0 0 8px;
  padding-top: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.cgsa-popup__message {
  margin: 0 0 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #64748b;
}

/* ---------- Button ---------- */
.cgsa-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 14px 40px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 4px 14px -3px rgba(34, 197, 94, 0.55),
    0 2px 4px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  outline: none;
}

.cgsa-popup__btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px -5px rgba(34, 197, 94, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.08);
}

.cgsa-popup__btn:active {
  transform: translateY(0);
  box-shadow:
    0 2px 8px -2px rgba(34, 197, 94, 0.45);
}

/* ---------- Type Variations ---------- */

/* Info type */
.cgsa-popup.is-info .cgsa-popup__icon-ring {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow:
    0 8px 24px -4px rgba(59, 130, 246, 0.5),
    0 0 0 5px #ffffff;
}

.cgsa-popup.is-info .cgsa-popup__btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow:
    0 4px 14px -3px rgba(59, 130, 246, 0.55),
    0 2px 4px rgba(0, 0, 0, 0.06);
}

.cgsa-popup.is-info .cgsa-popup__btn:hover {
  box-shadow:
    0 8px 24px -5px rgba(59, 130, 246, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.08);
}

.cgsa-popup.is-info::before {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
}

/* Warning type */
.cgsa-popup.is-warning .cgsa-popup__icon-ring {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow:
    0 8px 24px -4px rgba(245, 158, 11, 0.5),
    0 0 0 5px #ffffff;
}

.cgsa-popup.is-warning .cgsa-popup__btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow:
    0 4px 14px -3px rgba(245, 158, 11, 0.55),
    0 2px 4px rgba(0, 0, 0, 0.06);
}

.cgsa-popup.is-warning .cgsa-popup__btn:hover {
  box-shadow:
    0 8px 24px -5px rgba(245, 158, 11, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.08);
}

.cgsa-popup.is-warning::before {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
}

/* ---------- Confetti Particles ---------- */
.cgsa-confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: 24px;
}

.cgsa-confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  opacity: 0;
}

@keyframes cgsa-confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(260px) rotate(720deg) scale(0.4);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .cgsa-popup {
    width: 100%;
    padding: 44px 24px 28px;
    border-radius: 20px;
  }

  .cgsa-popup__icon-ring {
    width: 72px;
    height: 72px;
  }

  .cgsa-popup__checkmark {
    width: 36px;
    height: 36px;
  }

  .cgsa-popup__title {
    font-size: 1.15rem;
  }

  .cgsa-popup__message {
    font-size: 0.88rem;
  }

  .cgsa-popup__btn {
    width: 100%;
    padding: 14px 24px;
  }
}

/* ---------- Dark mode support ---------- */
@media (prefers-color-scheme: dark) {
  .cgsa-popup {
    background: #1e293b;
    box-shadow:
      0 25px 60px -12px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  }

  .cgsa-popup__title {
    color: #f1f5f9;
  }

  .cgsa-popup__message {
    color: #94a3b8;
  }

  .cgsa-popup__icon-ring {
    box-shadow:
      0 8px 24px -4px rgba(34, 197, 94, 0.4),
      0 0 0 4px #1e293b;
  }

  .cgsa-popup.is-info .cgsa-popup__icon-ring {
    box-shadow:
      0 8px 24px -4px rgba(59, 130, 246, 0.4),
      0 0 0 4px #1e293b;
  }

  .cgsa-popup.is-warning .cgsa-popup__icon-ring {
    box-shadow:
      0 8px 24px -4px rgba(245, 158, 11, 0.4),
      0 0 0 4px #1e293b;
  }
}

/* ---------- Close (X) Button ---------- */
.cgsa-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.cgsa-popup__close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* ---------- Sparkle animation ---------- */
@keyframes cgsa-sparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 1; transform: scale(1); }
}

.cgsa-popup__icon-ring::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  top: 8px;
  right: 10px;
  animation: cgsa-sparkle 1.5s ease-in-out 0.8s 2;
  pointer-events: none;
}

/* ---------- Pulse ring ---------- */
@keyframes cgsa-pulse-ring {
  0% {
    transform: translateX(-50%) scale(0.8);
    opacity: 0.7;
  }
  100% {
    transform: translateX(-50%) scale(1.6);
    opacity: 0;
  }
}

.cgsa-popup__icon-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid #22c55e;
  animation: cgsa-pulse-ring 1.2s ease-out 0.4s 1;
  pointer-events: none;
}

.cgsa-popup.is-info .cgsa-popup__icon-wrapper::after {
  border-color: #3b82f6;
}

.cgsa-popup.is-warning .cgsa-popup__icon-wrapper::after {
  border-color: #f59e0b;
}
