/* ==========================================================================
   "Leave a Message" floating button + panel
   Built from popup-components-template.md with popup-config.yaml.

   Adapted for this site:
   - Every custom property is prefixed --popup-* so it never overrides the
     site's own --white / --radius / --shadow-lg etc. in css/styles.css.
   - The template's .btn / .btn-primary are .popup-btn / .popup-btn-primary,
     because the site already styles .btn on every page.
   - Fonts point at the site's Montserrat (already loaded on every page).
   - The navbar phone and WhatsApp sections are not included: the site's
     navbar already shows the phone number, and there is no WhatsApp number.
   ========================================================================== */

/* THEME: change --popup-main-color to re-theme. Everything else derives from it. */
:root {
  --popup-main-color: #013d6c;     /* main_color in popup-config.yaml (site navy) */
  --popup-main-contrast: #ffffff;  /* text/icon color drawn ON TOP of the main color */

  /* Fallback shades (used only if the browser lacks color-mix()) */
  --popup-main-color-dark: #01325a;
  --popup-main-color-light: #e7edf3;
}

@supports (color: color-mix(in srgb, red, red)) {
  :root {
    --popup-main-color-dark: color-mix(in srgb, var(--popup-main-color) 82%, black);
    --popup-main-color-light: color-mix(in srgb, var(--popup-main-color) 12%, white);
  }
}

:root {
  /* Neutrals */
  --popup-black: #1a1a1a;
  --popup-white: #ffffff;
  --popup-grey-100: #f2f2f2;
  --popup-grey-300: #dcdcdc;
  --popup-grey-600: #6b6b6b;

  /* Type: the site's own font */
  --popup-font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --popup-font-serif: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Shape */
  --popup-radius: 12px;
  --popup-radius-sm: 8px;
  --popup-shadow-md: 0 8px 30px rgba(0, 0, 0, 0.14);
  --popup-shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.28);
}

/* ==========================================================================
   Buttons (template .btn / .btn-primary)
   ========================================================================== */
.popup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--popup-font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--popup-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.popup-btn:active { transform: translateY(1px); }

.popup-btn-primary {
  background: var(--popup-main-color);
  color: var(--popup-main-contrast);
}
.popup-btn-primary:hover { background: var(--popup-main-color-dark); }

/* ==========================================================================
   Leave a Message: floating action button
   ========================================================================== */
.contact-fab {
  position: fixed;
  right: 24px;
  bottom: 0px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--popup-main-color);
  color: var(--popup-main-contrast);
  border: none;
  border-top-left-radius: 25px;
  border-top-right-radius: 25px;
  font-family: var(--popup-font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--popup-shadow-md);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.contact-fab:hover { background: var(--popup-main-color-dark); }
.contact-fab svg { flex: 0 0 auto; }

@media (max-width: 560px) {
  .contact-fab {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 65px;
    font-size: 0.85rem;
  }
  .contact-fab:hover { transform: translateX(-50%); }
}

/* ==========================================================================
   Leave a Message: panel
   ========================================================================== */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
}
.contact-modal[hidden] { display: none; }

.contact-modal-backdrop {
  position: fixed;
  inset: 0;
  background: transparent; /* click-outside-to-close catcher, no dimming */
}

.contact-modal-dialog {
  position: fixed;
  right: 24px;
  bottom: 60px; /* sits just above the fab */
  width: min(380px, calc(100vw - 48px));
  max-height: min(620px, calc(100vh - 140px)); /* template: 560px; raised to fit the reCAPTCHA notice */
  background: var(--popup-white);
  border-radius: var(--popup-radius);
  box-shadow: var(--popup-shadow-lg);
  padding: 28px 26px;
  overflow-y: auto;
  transform-origin: bottom right;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.contact-modal.is-open .contact-modal-dialog {
  opacity: 1;
}

@media (max-width: 560px) {
  .contact-modal-dialog {
    right: 12px;
    left: 12px;
    bottom: 76px;
    width: auto;
    padding: 22px 20px;
  }
}

.contact-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--popup-grey-100);
  color: var(--popup-black);
  border-radius: 50%;
  cursor: pointer;
}
.contact-modal-close:hover { background: var(--popup-grey-300); }

.contact-modal-dialog h2 {
  font-family: var(--popup-font-serif);
  font-size: 1.5rem;
  margin: 0 0 8px;
  padding-right: 30px;
  color: var(--popup-black);
}

.contact-modal-intro {
  color: var(--popup-grey-600);
  font-family: var(--popup-font-sans);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 24px;
}

.contact-modal .form-group { margin-bottom: 14px; }

.contact-modal .form-group input,
.contact-modal .form-group textarea {
  width: 100%;
  font-family: var(--popup-font-sans);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--popup-grey-300);
  border-radius: var(--popup-radius-sm);
  background: var(--popup-white);
  color: var(--popup-black);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.contact-modal .form-group input:focus,
.contact-modal .form-group textarea:focus {
  outline: none;
  border-color: var(--popup-main-color);
  box-shadow: 0 0 0 3px var(--popup-main-color-light);
}
.contact-modal .form-group textarea { min-height: 110px; resize: vertical; }

.contact-modal-submit { width: 100%; margin-top: 6px; }

/* reCAPTCHA notice. Google allows hiding the floating badge (which would sit
   behind the Leave a Message button) when this notice is shown with the form. */
.contact-modal-recaptcha {
  margin: 14px 0 0;
  font-family: var(--popup-font-sans);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--popup-grey-600);
}
.contact-modal-recaptcha a { color: inherit; text-decoration: underline; }
.contact-modal-recaptcha a:hover { color: var(--popup-main-color); }

.grecaptcha-badge { visibility: hidden; }
