/* Referral slide-in card (js/referral.js). Bottom-left because the chat owns bottom-right.
   Slides with `translate` so the phone bar can still shift it with `transform`. Never fades from 0. */
.ref-pop { position: fixed; left: 24px; bottom: 24px; right: auto; top: auto; margin: 0; z-index: 66; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; width: min(370px, calc(100% - 48px)); padding: 18px 46px 18px 18px; border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; color: var(--navy); box-shadow: 0 12px 40px #12264a2e; font: 400 15px/1.45 var(--text); }
.ref-pop[hidden] { display: none; }
.ref-pop.is-in { animation: ref-pop-in .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ref-pop-in { from { translate: 0 28px; } to { translate: 0 0; } }
.ref-pop__icon { width: 46px; height: 46px; }
.ref-pop__photo { display: none; }
.ref-pop__title { margin: 2px 0 0; font: 800 18px/1.25 var(--display); color: var(--navy); text-wrap: balance; }
.ref-pop__text { margin: 6px 0 14px; color: #3d4a5d; }
.ref-pop__cta { height: 46px; font-size: 15px; }
.ref-pop__close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--navy); cursor: pointer; }
.ref-pop__close:hover { background: var(--grey); }
.ref-pop__close:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
@media (max-width: 640px) {
  /* Above the Call / Text / Free Quote bar, leaving the chat button its corner. */
  .ref-pop { left: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); width: calc(100% - 102px); grid-template-columns: minmax(0, 1fr); padding: 14px 42px 14px 14px; }
  .ref-pop__icon { display: none; }
  .ref-pop__title { font-size: 16px; }
  .ref-pop__text { margin: 4px 0 10px; font-size: 14px; }
  .ref-pop__cta { height: 42px; font-size: 14px; }
  .phone-actions-ready .ref-pop { transform: translateY(var(--phone-action-shift, 0px)); transition: transform .3s ease; }
}
@media (prefers-reduced-motion: reduce) { .ref-pop.is-in { animation: none; } .phone-actions-ready .ref-pop { transition: none; } }

/* Homepage: the same card opens as a centred pop-up (showModal) as soon as the page loads.
   Last in the file and `.ref-pop.ref-pop--modal` so it beats the corner and phone-bar rules. */
.ref-pop.ref-pop--modal { inset: 0; margin: auto; width: min(420px, calc(100% - 40px)); max-height: calc(100% - 40px); overflow: auto; padding: 0; grid-template-columns: minmax(0, 1fr); gap: 0; border: 0; border-radius: 22px; box-shadow: 0 30px 80px #12264a59; text-align: center; transform: none; }
.ref-pop--modal::backdrop { background: #12264a80; }
.ref-pop--modal .ref-pop__photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 40%; background: var(--grey); }
.ref-pop--modal .ref-pop__icon { display: none; }
.ref-pop--modal .ref-pop__body { padding: 24px 26px 28px; }
.ref-pop--modal .ref-pop__title { margin: 0; font-size: 24px; }
.ref-pop--modal .ref-pop__text { margin: 8px auto 22px; max-width: 32ch; font-size: 16px; }
.ref-pop--modal .ref-pop__cta { width: 100%; height: 54px; justify-content: space-between; font-size: 16px; }
.ref-pop--modal .ref-pop__close { top: 12px; right: 12px; z-index: 1; background: #fff; box-shadow: 0 4px 14px #12264a33; }
.ref-pop--modal .ref-pop__close:hover { background: var(--grey); }
@media (max-width: 640px) {
  .ref-pop--modal .ref-pop__body { padding: 20px 20px 22px; }
  .ref-pop--modal .ref-pop__title { font-size: 21px; }
  .ref-pop--modal .ref-pop__text { margin: 6px auto 18px; font-size: 15px; }
}
