/* =========================================================
   RetroCube Auto Popup — premium + animated (site-wide)
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap");

.rc-apop {
  --ap-red: #d00304;
  --ap-gold: #e8b84a;
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.rc-apop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
body.rc-apop-lock {
  overflow: hidden;
}

.rc-apop-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(208, 3, 4, 0.35), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(232, 184, 74, 0.18), transparent 45%),
    rgba(10, 4, 4, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.rc-apop.is-open .rc-apop-backdrop {
  opacity: 1;
}

.rc-apop-dialog {
  position: relative;
  z-index: 2;
  width: min(920px, 100%);
  transform: translateY(36px) scale(0.94);
  opacity: 0;
  transition:
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.55s ease;
}
.rc-apop.is-open .rc-apop-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.rc-apop-close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  background: linear-gradient(145deg, #ff3a3a, #d00304 55%, #8f1010);
  box-shadow: 0 12px 28px rgba(208, 3, 4, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.rc-apop-close:hover {
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 16px 34px rgba(208, 3, 4, 0.55);
}

.rc-apop-panel {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(160deg, #2a1414 0%, #140a0a 55%, #1a0c0c 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(232, 184, 74, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}
.rc-apop-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  z-index: 4;
  background: linear-gradient(90deg, #7a1212, #d00304, #ffc328, #d00304, #7a1212);
  background-size: 200% 100%;
  animation: rcApopBar 5.5s linear infinite;
}

@keyframes rcApopBar {
  to { background-position: 200% 0; }
}
@keyframes rcApopFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes rcApopSpin {
  to { transform: rotate(360deg); }
}
@keyframes rcApopPulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.15); }
}
@keyframes rcApopShine {
  0% { transform: translateX(-120%) skewX(-16deg); opacity: 0; }
  30% { opacity: 0.55; }
  100% { transform: translateX(220%) skewX(-16deg); opacity: 0; }
}
@keyframes rcApopDot {
  0%, 100% { opacity: 0.4; box-shadow: 0 0 0 0 rgba(232, 184, 74, 0.4); }
  50% { opacity: 1; box-shadow: 0 0 0 6px rgba(232, 184, 74, 0); }
}
@keyframes rcApopPhoneIn {
  from { opacity: 0; transform: translateY(28px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.rc-apop-visual {
  position: relative;
  min-height: 520px;
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.rc-apop-visual-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: right center;
  opacity: 0.35;
  filter: saturate(1.1);
  z-index: 0;
}
.rc-apop-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(20, 8, 8, 0.15) 0%, rgba(20, 8, 8, 0.75) 70%, rgba(12, 5, 5, 0.95) 100%),
    radial-gradient(ellipse at 50% 30%, rgba(208, 3, 4, 0.35), transparent 55%);
}
.rc-apop-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  z-index: 1;
  pointer-events: none;
}
.rc-apop-orb.o1 {
  width: 220px;
  height: 220px;
  top: -40px;
  left: -50px;
  background: radial-gradient(circle, rgba(208, 3, 4, 0.55), transparent 70%);
  animation: rcApopFloat 8s ease-in-out infinite;
}
.rc-apop-orb.o2 {
  width: 180px;
  height: 180px;
  right: -40px;
  bottom: 80px;
  background: radial-gradient(circle, rgba(232, 184, 74, 0.4), transparent 70%);
  animation: rcApopFloat 10s ease-in-out infinite reverse;
}
.rc-apop-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  z-index: 1;
  pointer-events: none;
}
.rc-apop-ring.r1 {
  width: 200px;
  height: 200px;
  top: 18%;
  left: 50%;
  margin-left: -100px;
  animation: rcApopSpin 28s linear infinite;
}
.rc-apop-ring.r2 {
  width: 140px;
  height: 140px;
  top: 24%;
  left: 50%;
  margin-left: -70px;
  border-color: rgba(232, 184, 74, 0.35);
  animation: rcApopSpin 18s linear infinite reverse;
}
.rc-apop-spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e8b84a;
  box-shadow: 0 0 12px rgba(232, 184, 74, 0.85);
  z-index: 2;
  animation: rcApopPulse 2.4s ease-in-out infinite;
}
.rc-apop-spark.s1 { top: 16%; left: 18%; }
.rc-apop-spark.s2 { top: 28%; right: 16%; animation-delay: 0.6s; background: #fff; }
.rc-apop-spark.s3 { bottom: 38%; left: 22%; animation-delay: 1.2s; }

.rc-apop-phone {
  position: relative;
  z-index: 3;
  width: min(280px, 78%);
  margin-bottom: 18px;
  animation: rcApopPhoneIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
  filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.45));
}
.rc-apop.is-open .rc-apop-phone {
  animation: rcApopPhoneIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both, rcApopFloat 6s ease-in-out 1.2s infinite;
}
.rc-apop-phone img {
  display: block;
  width: 100%;
  height: auto;
}
.rc-apop-visual-copy {
  position: relative;
  z-index: 3;
  text-align: center;
  color: #fff;
  font-family: "DM Sans", system-ui, sans-serif;
}
.rc-apop-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ap-gold);
}
.rc-apop-tagline {
  margin: 0 0 14px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  color: #fffaf4;
}
.rc-apop-pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.rc-apop-pills li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 245, 235, 0.88);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.rc-apop-pills li i { color: var(--ap-gold); font-size: 10px; }

.rc-apop-formwrap {
  position: relative;
  z-index: 2;
  padding: 40px 36px 34px;
  font-family: "DM Sans", system-ui, sans-serif;
  background:
    radial-gradient(500px 220px at 100% 0%, rgba(232, 184, 74, 0.1), transparent 55%),
    linear-gradient(165deg, rgba(40, 20, 20, 0.4), transparent 40%);
}
.rc-apop-kicker {
  margin: 0 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ap-gold);
}
.rc-apop-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ap-gold);
  animation: rcApopDot 2s ease-in-out infinite;
}
.rc-apop-formwrap h3 {
  margin: 0 0 10px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fffaf4;
}
.rc-apop-sub {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 245, 235, 0.7);
}
.rc-apop-sub span {
  color: var(--ap-gold);
  font-weight: 700;
}

.rc-apop-field {
  position: relative;
  margin-bottom: 12px;
}
.rc-apop-field i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(232, 184, 74, 0.85);
  font-size: 13px;
  z-index: 1;
  pointer-events: none;
}
.rc-apop-field--area i {
  top: 18px;
  transform: none;
}
.rc-apop-field .form-control,
.rc-apop-field input,
.rc-apop-field textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
  padding: 14px 16px 14px 44px !important;
  font-size: 14px !important;
  height: auto !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.rc-apop-field textarea {
  min-height: 88px;
  resize: vertical;
}
.rc-apop-field .form-control::placeholder,
.rc-apop-field input::placeholder,
.rc-apop-field textarea::placeholder {
  color: rgba(255, 245, 235, 0.45) !important;
}
.rc-apop-field .form-control:focus,
.rc-apop-field input:focus,
.rc-apop-field textarea:focus {
  border-color: rgba(232, 184, 74, 0.55) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 0 0 4px rgba(232, 184, 74, 0.12) !important;
}

.rc-apop-submit {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 16px 24px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(110deg, #ff3a3a 0%, #d00304 40%, #9a1010 70%, #d00304 100%);
  background-size: 220% 100%;
  box-shadow: 0 16px 36px rgba(208, 3, 4, 0.4);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  animation: rcApopBar 4.5s linear infinite;
}
.rc-apop-submit-shine {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: rcApopShine 3.2s ease-in-out infinite;
  pointer-events: none;
}
.rc-apop-submit-label,
.rc-apop-submit i {
  position: relative;
  z-index: 1;
}
.rc-apop-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 44px rgba(208, 3, 4, 0.5);
}

.rc-apop-field label.error,
.rc-apop-formwrap label.error {
  color: #ffb4b4;
  font-size: 11px;
  margin-top: 4px;
  display: block;
}

@media (max-width: 991px) {
  .rc-apop {
    padding: 16px;
    align-items: center;
    justify-content: center;
  }
  .rc-apop-panel {
    grid-template-columns: 1fr;
    max-height: min(92vh, 780px);
    overflow: auto;
  }
  .rc-apop-visual {
    min-height: 180px;
    padding: 20px 16px 14px;
    order: 2;
  }
  .rc-apop-formwrap {
    order: 1;
    padding: 28px 18px 22px;
  }
  .rc-apop-phone {
    width: min(160px, 55%);
    margin-bottom: 8px;
  }
  .rc-apop-tagline {
    font-size: 15px;
  }
  .rc-apop-close {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
  }
}
@media (max-width: 767px) {
  .rc-apop-visual {
    display: none;
  }
  .rc-apop-formwrap {
    padding: 28px 16px 20px;
  }
  .rc-apop-formwrap h3 {
    font-size: 26px;
  }
  .rc-apop-panel {
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rc-apop,
  .rc-apop-backdrop,
  .rc-apop-dialog,
  .rc-apop-phone,
  .rc-apop-orb,
  .rc-apop-ring,
  .rc-apop-spark,
  .rc-apop-dot,
  .rc-apop-panel::before,
  .rc-apop-submit,
  .rc-apop-submit-shine {
    animation: none !important;
    transition: none !important;
  }
  .rc-apop.is-open .rc-apop-dialog {
    transform: none;
  }
}
