/* ===========================================
   COMPONENT: Success Modal (modal-ui)
   Used after form submission on all pages
   Classes: .niv-modal-* (scoped, no conflicts)
   =========================================== */

.niv-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 18, 28, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  z-index: 100000;
}

.niv-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.niv-modal-card {
  position: relative;
  width: min(100%, 560px);
  border-radius: 28px;
  padding: 188px 34px 30px;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(255,243,212,0.95), rgba(255,255,255,0.96) 42%, rgba(249,244,236,0.98) 100%);
  box-shadow: 0 32px 80px rgba(8,22,35,0.28);
  border: 1px solid rgba(255,255,255,0.62);
  transform: scale(0.92) translateY(18px);
  opacity: 0;
  transition: transform 0.34s ease, opacity 0.34s ease;
  overflow: hidden;
}

.niv-modal-overlay.is-open .niv-modal-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.niv-modal-card::before,
.niv-modal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.niv-modal-card::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,215,125,0.28), transparent 28%),
    radial-gradient(circle at 80% 18%, rgba(255,235,170,0.2), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(255,198,74,0.18), transparent 24%);
}

.niv-modal-card::after {
  background-image: radial-gradient(circle, rgba(255,210,115,0.72) 0 1.2px, transparent 1.4px);
  background-size: 26px 26px;
  opacity: 0.2;
  mix-blend-mode: screen;
}

.niv-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(10,29,44,0.08);
  color: #0b1f3a;
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.niv-modal-close:hover {
  background: rgba(10,29,44,0.14);
  transform: rotate(90deg);
}

.niv-modal-figure {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 186px;
  height: 186px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255,252,243,0.72), rgba(255,247,222,0.56));
  box-shadow:
    0 0 0 4px rgba(255,247,224,0.34),
    0 12px 22px rgba(163,124,29,0.14),
    0 0 18px rgba(255,215,122,0.2);
  animation: nivModalGlow 4.8s ease-in-out infinite;
  z-index: 2;
}

.niv-modal-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  mix-blend-mode: normal;
  filter: drop-shadow(0 10px 18px rgba(27,83,72,0.18));
}

.niv-modal-title {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-family: "Playfair Display", serif;
  font-size: clamp(1rem, 2.2vw, 2.6rem);
  line-height: 1.08;
  color: #2d564b;
  white-space: nowrap;
}

.niv-modal-message {
  position: relative;
  z-index: 1;
  margin: 0 0 24px;
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  color: #24384d;
}

.niv-modal-action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 500px);
  min-height: 62px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #0e8b7f 0%, #0C7F74 100%);
  box-shadow: 0 16px 30px rgba(14,139,127,0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.niv-modal-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(14,139,127,0.36);
  filter: brightness(1.03);
}

.niv-modal-note {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  font-size: 0.98rem;
  color: #76552c;
}

/* Generic variant (no image) */
.niv-modal-card.is-generic { padding-top: 40px; }
.niv-modal-card.is-generic .niv-modal-figure { display: none; }
.niv-modal-card.is-generic .niv-modal-title { margin-top: 0; color: #0b1f3a; font-size: 1.5rem; }
.niv-modal-card.is-generic .niv-modal-message { margin-bottom: 18px; }
.niv-modal-card.is-generic .niv-modal-note { color: var(--color-text-muted); }

@keyframes nivModalGlow {
  0%, 100% {
    box-shadow:
      0 0 0 8px rgba(255,247,224,0.48),
      0 18px 32px rgba(163,124,29,0.2),
      0 0 38px rgba(255,215,122,0.36);
  }
  50% {
    box-shadow:
      0 0 0 11px rgba(255,247,224,0.56),
      0 22px 40px rgba(163,124,29,0.26),
      0 0 52px rgba(255,215,122,0.44);
  }
}

@media (max-width: 640px) {
  .niv-modal-overlay { padding: 16px; }
  .niv-modal-card { width: 100%; padding: 152px 20px 22px; border-radius: 24px; overflow: visible; }
  .niv-modal-figure { top: -6px; width: 150px; height: 150px; }
  .niv-modal-figure img { width: 126px; height: 126px; }
  .niv-modal-action { width: 100%; min-height: 54px; font-size: 0.96rem; }
  .niv-modal-title {
    font-size: clamp(0.9rem, 5.2vw, 1.45rem);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    letter-spacing: -0.01em;
  }
  .niv-modal-note { font-size: 0.92rem; }
}

@media (max-width: 380px) {
  .niv-modal-title {
    font-size: 0.84rem;
    letter-spacing: -0.015em;
  }
}

/* Choice modal — two-button variant */
.niv-modal-choices {
  display: none;
  flex-direction: row;
  gap: 14px;
  position: relative;
  z-index: 1;
  width: min(100%, 500px);
  margin: 0 auto;
}
.niv-modal-choice {
  flex: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 14px 12px;
  border: 0;
  border-radius: 20px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease, filter 0.2s ease;
}
.niv-modal-choice i {
  font-size: 1.35rem;
  line-height: 1;
}
.niv-modal-choice--call {
  background: linear-gradient(145deg, #14c8bb 0%, #0e8b7f 50%, #0a6b62 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(14,139,127,0.38), inset 0 1px 0 rgba(255,255,255,0.18);
}
.niv-modal-choice--wa {
  background: linear-gradient(145deg, #3de070 0%, #1db954 50%, #12a348 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(29,185,84,0.38), inset 0 1px 0 rgba(255,255,255,0.18);
}
.niv-modal-choice::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.niv-modal-choice:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.06);
}
.niv-modal-choice:active { transform: translateY(0) scale(0.98); }

@media (max-width: 640px) {
  .niv-modal-choice { min-height: 68px; font-size: 0.88rem; padding: 12px 10px; border-radius: 16px; }
}
