/* ==========================================================================
   contact-popup-v2.css — modern light-glass restyle of the shared contact
   popup. Loaded after sass/main.css on every page.
   (1rem = 9px — html { font-size: 56.25% } in main.css.)
   ========================================================================== */

.contact-overlay.visible .contact-overlay__backdrop {
  background: rgba(6, 15, 26, 0.45);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
          backdrop-filter: blur(12px) saturate(120%);
}

.contact-popup {
  background: rgba(250, 248, 243, 0.94);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
  border: 1px solid rgba(12, 34, 51, 0.1);
  border-radius: 2.6rem;
  box-shadow: 0 30px 80px rgba(4, 12, 20, 0.4);
  color: #0c2233;
}

.contact-popup__title {
  font-family: "Quicksand", "Nunito", sans-serif;
  color: #0c2233;
  letter-spacing: 0.04em;
}

.contact-popup__line {
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(47, 181, 176, 0.6),
    transparent
  );
}

/* Option cards */
.contact-popup__options {
  gap: 1.6rem;
  padding: 0 1rem;
}

.contact-popup__option {
  background: #ffffff;
  border: 1px solid rgba(12, 34, 51, 0.08);
  border-radius: 1.8rem;
  box-shadow: 0 2px 10px rgba(12, 34, 51, 0.06);
  padding: 1.8rem 0;
  color: #0c2233;
}

.contact-popup__option:hover {
  background: #ffffff;
  border-color: rgba(47, 181, 176, 0.55);
  transform: translateY(-0.3rem);
  box-shadow: 0 12px 26px rgba(12, 34, 51, 0.16);
}

.contact-popup__option:active,
.contact-popup__option:focus-visible {
  outline: 2px solid #2fb5b0;
  outline-offset: 3px;
}

.contact-popup__option-icon {
  width: 3.2rem;
  height: 3.2rem;
  padding: 1.1rem;
  margin-bottom: 0.8rem;
  border-radius: 50%;
  background: rgba(47, 181, 176, 0.12);
  border: 1px solid rgba(47, 181, 176, 0.35);
  box-sizing: content-box;
}

.contact-popup__option-heading {
  font-family: "Quicksand", "Nunito", sans-serif;
  color: #0c2233;
}

.contact-popup__option-info {
  font-family: "Quicksand", "Inter", sans-serif;
  color: rgba(12, 34, 51, 0.6);
}

/* Close button */
.contact-popup__close:hover::before {
  background-color: rgba(12, 34, 51, 0.07);
}

.contact-popup__close:active::before {
  background-color: rgba(12, 34, 51, 0.14);
}

/* Copy toast */
.copy-toast {
  background: #0c2233;
  color: #f4efe4;
  border: 1px solid rgba(67, 214, 207, 0.4);
}

/* --------------------------------------------------------------------------
   Floating contact button v2 — self-drawn lifebuoy SVG on navy glass,
   shared by every page (replaces the old white contact-btn.png circle).
   -------------------------------------------------------------------------- */
.contact-btn2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: linear-gradient(165deg, #14324a 0%, #0a1826 100%);
  border: 1.5px solid rgba(67, 214, 207, 0.45);
  border-radius: 50%;
  aspect-ratio: 1/1;
  cursor: pointer;
  padding: 0;
  color: #f4efe4;
  box-shadow: 0 12px 30px rgba(4, 12, 20, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.contact-btn2:hover,
.contact-btn2:focus-visible {
  transform: translateY(-2px) scale(1.03);
  border-color: #43d6cf;
  box-shadow: 0 16px 38px rgba(4, 12, 20, 0.55),
    0 0 22px rgba(67, 214, 207, 0.35);
}

.contact-btn2__icon {
  width: 40%;
  height: auto;
}

.contact-btn2__label {
  font-family: "Quicksand", sans-serif;
  font-size: clamp(1.3rem, 1vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

/* Mobile: draw the eye — a soft expanding pulse ring, and the phone
   glyph gives a little "ring ring" wiggle every few seconds. */
@media only screen and (max-width: 640px) {
  .contact-btn2 {
    position: relative;
  }

  .contact-btn2::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid rgba(67, 214, 207, 0.7);
    pointer-events: none;
    animation: contact-pulse 2.8s ease-out infinite;
  }

  .contact-btn2__icon {
    transform-origin: 50% 50%;
    animation: phone-ring 5s ease-in-out infinite;
  }
}

@keyframes contact-pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.8;
  }
  55% {
    transform: scale(1.28);
    opacity: 0;
  }
  100% {
    transform: scale(1.28);
    opacity: 0;
  }
}

@keyframes phone-ring {
  0%,
  86%,
  100% {
    transform: rotate(0);
  }
  88% {
    transform: rotate(-13deg);
  }
  90% {
    transform: rotate(11deg);
  }
  92% {
    transform: rotate(-9deg);
  }
  94% {
    transform: rotate(7deg);
  }
  96% {
    transform: rotate(-4deg);
  }
  98% {
    transform: rotate(0);
  }
}

/* Motion safety */
.reduce-animations .contact-btn2::after,
.reduce-animations .contact-btn2__icon {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .contact-btn2::after,
  .contact-btn2__icon {
    animation: none !important;
  }

  .contact-btn2::after {
    display: none;
  }
}

/* The legacy JS adds these classes on hover/click — they were styled for
   the old white button (white flash, 10px border); neutralise them here. */
.contact-btn2.contact-btn-is-hovered {
  background: linear-gradient(165deg, #14324a 0%, #0a1826 100%);
  border: 1.5px solid #43d6cf;
  transform: translateY(-2px) scale(1.04);
}

.contact-btn2.contact-btn-is-active {
  background: linear-gradient(165deg, #14324a 0%, #0a1826 100%);
  border-color: #43d6cf;
  box-shadow: 0 8px 20px rgba(4, 12, 20, 0.5);
}

/* --------------------------------------------------------------------------
   Dark mode — follows the visitor's system preference. A softer mid-navy
   glass rather than the near-black first attempt.
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  .contact-popup {
    background: rgba(21, 45, 64, 0.94);
    border-color: rgba(67, 214, 207, 0.3);
    color: #f4efe4;
  }

  .contact-popup__title {
    color: #f4efe4;
  }

  .contact-popup__option {
    background: rgba(244, 239, 228, 0.08);
    border-color: rgba(244, 239, 228, 0.14);
    box-shadow: none;
    color: #f4efe4;
  }

  .contact-popup__option:hover {
    background: rgba(67, 214, 207, 0.14);
    border-color: rgba(67, 214, 207, 0.55);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  }

  .contact-popup__option-heading {
    color: #f4efe4;
  }

  .contact-popup__option-info {
    color: rgba(244, 239, 228, 0.65);
  }

  /* Black SVG glyphs need inverting on dark; invert() flips the circle
     colours too, so these are pre-inverted to land on teal. */
  .contact-popup__option-icon {
    filter: invert(0.92);
    background: rgba(200, 25, 33, 0.16);
    border-color: rgba(200, 25, 33, 0.35);
  }

  .contact-popup__close-icon {
    filter: invert(0.9);
  }

  .contact-popup__close:hover::before {
    background-color: rgba(244, 239, 228, 0.1);
  }

  .contact-popup__close:active::before {
    background-color: rgba(244, 239, 228, 0.18);
  }
}
