/* ==========================================================================
   BlissMoney - Bottom-Right Dual-State Lead Popup Widget
   Follows the BlissMoney brand book: brand green #0CAF80, black #1E1E1E,
   white, Raleway, glowing "B" logomark.
   - State 1: "Turn your today into a brighter tomorrow" (intro + Get started)
   - State 2: "Let's plan your next chapter" (WhatsApp + Consultation + Badges)
   ========================================================================== */

.bm-lead-popup {
  --bm-green: #0caf80;
  --bm-green-dark: #0a9c72;
  --bm-ink: #0d251e;
  --bm-surface: rgba(255, 255, 255, 0.04);
  --bm-border: rgba(255, 255, 255, 0.09);
  --bm-text: #ffffff;
  --bm-muted: #aaaaaa;

  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background:
    radial-gradient(
      ellipse 90% 60% at 100% 0%,
      rgba(12, 175, 128, 0.22) 0%,
      transparent 60%
    ),
    linear-gradient(180deg, #0f2a22 0%, #0b1d17 100%);
  color: var(--bm-text);
  border-radius: 20px;
  border: 1px solid rgba(12, 175, 128, 0.28);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.2);
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(24px) scale(0.96);
  transition:
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.35s;
  font-family: var(
    --font-family-base,
    "Raleway",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif
  );
}

.bm-lead-popup::-webkit-scrollbar {
  display: none;
}

.bm-lead-popup.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* When popup is active, hide background floating whatsapp to avoid overlap */
body.bm-popup-active .floating-actions {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

/* Prevent hero title from extending underneath bottom-right popup on desktop */
@media (min-width: 1024px) {
  .hero-title {
    max-width: calc(100% - 360px) !important;
  }
  .hero-title-line {
    white-space: normal !important;
  }
}

/* ==========================================================================
   Shared pieces
   ========================================================================== */
.bm-popup-step-1,
.bm-popup-step-2 {
  position: relative;
  padding: 18px 20px 18px;
  animation: bmPopupSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes bmPopupSlideIn {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.bm-popup-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bm-popup-logo {
  height: 22px;
  width: auto;
  display: block;
}

.bm-popup-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bm-border);
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.bm-popup-close-btn:hover {
  background: rgba(12, 175, 128, 0.18);
  border-color: rgba(12, 175, 128, 0.5);
}

.bm-popup-close-btn:focus-visible,
.bm-popup-btn-primary:focus-visible,
.bm-popup-btn-later:focus-visible,
.bm-popup-whatsapp-box:focus-visible {
  outline: 2px solid var(--bm-green);
  outline-offset: 2px;
}

.bm-popup-title {
  position: relative;
  z-index: 2;
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 10px 0 8px;
}

.bm-popup-title em {
  font-style: normal;
  color: var(--bm-green);
}

.bm-popup-subtitle {
  position: relative;
  z-index: 2;
  font-size: 0.84rem;
  color: var(--bm-muted);
  line-height: 1.5;
  margin: 0 0 14px;
}

/* ==========================================================================
   STATE 1: "Turn your today into a brighter tomorrow"
   ========================================================================== */

/* Glowing "B" logomark (brand hero element) sitting behind the content */
.bm-popup-glow {
  position: absolute;
  top: 58px;
  right: -42px;
  width: 150px;
  height: 150px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

.bm-popup-glow::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(12, 175, 128, 0.35),
    transparent 70%
  );
}

.bm-popup-glow img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(12, 175, 128, 0.45));
}

.bm-popup-eyebrow {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin-top: 26px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(12, 175, 128, 0.5);
  background: rgba(12, 175, 128, 0.12);
  color: var(--bm-green);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bm-popup-step-1 .bm-popup-title {
  max-width: 240px;
  margin-top: 14px;
}

.bm-popup-step-1 .bm-popup-subtitle {
  max-width: 250px;
}

/* Today → Grow → Protect → Achieve */
.bm-popup-journey {
  position: relative;
  z-index: 2;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 4px 0 18px;
  padding: 0;
}

.bm-popup-journey::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.18),
    var(--bm-green)
  );
}

.bm-popup-journey li {
  position: relative;
  padding-top: 18px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--bm-muted);
}

.bm-popup-journey li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #0b1d17;
  border: 2px solid var(--bm-green);
  box-sizing: border-box;
}

.bm-popup-journey li:first-child::before {
  border-color: rgba(255, 255, 255, 0.35);
}

.bm-popup-journey li:last-child {
  color: var(--bm-green);
}

.bm-popup-journey li:last-child::before {
  background: var(--bm-green);
  box-shadow:
    0 0 0 4px rgba(12, 175, 128, 0.22),
    0 0 14px rgba(12, 175, 128, 0.7);
}

/* Primary CTA (also used for "Select date & time") */
.bm-popup-btn-primary,
.bm-popup-btn-select-time {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 46px;
  background-color: var(--bm-green);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(12, 175, 128, 0.3);
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.bm-popup-btn-primary:hover,
.bm-popup-btn-select-time:hover {
  background-color: var(--bm-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(12, 175, 128, 0.42);
}

.bm-popup-btn-primary:active,
.bm-popup-btn-select-time:active {
  transform: translateY(0);
}

.bm-popup-btn-primary svg {
  transition: transform 0.2s ease;
}

.bm-popup-btn-primary:hover svg {
  transform: translateX(3px);
}

.bm-popup-btn-later {
  position: relative;
  z-index: 2;
  display: block;
  margin: 8px auto 0;
  padding: 6px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--bm-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

.bm-popup-btn-later:hover {
  color: #ffffff;
}

/* ==========================================================================
   STATE 2: "Let's plan your next chapter"
   ========================================================================== */
.bm-popup-step-2 .bm-popup-title {
  margin-top: 18px;
}

/* WhatsApp Option Card */
.bm-popup-whatsapp-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(12, 175, 128, 0.1);
  border: 1px solid rgba(12, 175, 128, 0.35);
  border-radius: 14px;
  padding: 10px 12px;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease;
  margin-bottom: 10px;
}

.bm-popup-whatsapp-box:hover {
  background: rgba(12, 175, 128, 0.18);
  border-color: rgba(12, 175, 128, 0.6);
  transform: translateY(-1px);
}

.bm-popup-wa-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--bm-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bm-popup-wa-icon svg {
  width: 18px;
  height: 18px;
}

.bm-popup-wa-text {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.bm-popup-wa-text strong,
.bm-popup-consult-text strong {
  font-size: 0.86rem;
  color: #ffffff;
  font-weight: 700;
}

.bm-popup-wa-text span,
.bm-popup-consult-text span {
  font-size: 0.72rem;
  color: var(--bm-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.bm-popup-wa-arrow {
  color: var(--bm-green);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.bm-popup-whatsapp-box:hover .bm-popup-wa-arrow {
  transform: translateX(2px);
}

/* Consultation Card with Form */
.bm-popup-consult-box {
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-radius: 14px;
  padding: 12px;
}

.bm-popup-consult-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.bm-popup-cal-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(12, 175, 128, 0.12);
  border: 1px solid rgba(12, 175, 128, 0.35);
  color: var(--bm-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bm-popup-cal-icon svg {
  width: 16px;
  height: 16px;
}

.bm-popup-consult-text {
  display: flex;
  flex-direction: column;
}

.bm-popup-inputs-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.bm-popup-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.bm-popup-input-wrap .bm-input-icon {
  position: absolute;
  left: 11px;
  pointer-events: none;
  color: #7f8f89;
}

.bm-popup-input-wrap input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px 10px 34px;
  font-size: 16px; /* 16px stops iOS zooming into the field */
  color: #ffffff;
  font-family: inherit;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
  box-sizing: border-box;
}

.bm-popup-input-wrap input::placeholder {
  color: #7f8f89;
}

.bm-popup-input-wrap input:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.35);
  border-color: var(--bm-green);
  box-shadow: 0 0 0 3px rgba(12, 175, 128, 0.18);
}

.bm-popup-btn-select-time {
  height: 44px;
  font-size: 0.86rem;
}

/* Trust Badges Footer Row */
.bm-popup-trust-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--bm-border);
  margin-top: 12px;
  padding-top: 10px;
}

.bm-popup-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 0 2px;
  color: var(--bm-green);
}

.bm-popup-trust-item:not(:last-child) {
  border-right: 1px solid var(--bm-border);
}

.bm-popup-trust-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.bm-popup-trust-item span {
  font-size: 0.62rem;
  color: var(--bm-muted);
  line-height: 1.25;
  font-weight: 500;
}

/* Small screens: dock as a compact bottom sheet so the hero stays visible */
@media (max-width: 440px) {
  .bm-lead-popup {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 24px);
    border-radius: 18px;
  }

  .bm-popup-step-1,
  .bm-popup-step-2 {
    padding: 16px 16px 14px;
  }

  .bm-popup-glow {
    top: 48px;
    right: -34px;
    width: 128px;
    height: 128px;
  }

  .bm-popup-eyebrow {
    margin-top: 18px;
  }

  .bm-popup-title {
    font-size: 1.4rem;
  }

  .bm-popup-subtitle {
    font-size: 0.8rem;
    margin-bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bm-lead-popup,
  .bm-popup-step-1,
  .bm-popup-step-2 {
    animation: none;
    transition: none;
  }
}
