:root {
  --sfg-green: #228b24;
  --sfg-green-deep: #176b1a;
  --sfg-navy: #101840;
  --sfg-navy-soft: #1a2558;
  --sfg-mist: #f4f7fb;
  --sfg-line: rgba(16, 24, 64, 0.1);
  --sfg-shadow: 0 18px 50px rgba(16, 24, 64, 0.28);
  --sfg-radius: 22px;
}

/* Floating chatbot launcher */
.sfg-chat {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1000001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: "Exo", "Segoe UI", sans-serif;
}

.sfg-chat__tip {
  display: grid;
  gap: 2px;
  max-width: min(220px, calc(100vw - 96px));
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--sfg-navy);
  box-shadow: 0 12px 30px rgba(16, 24, 64, 0.18);
  border: 1px solid rgba(34, 139, 36, 0.18);
  transform-origin: bottom right;
  animation: sfg-tip-in 0.45s ease both 0.8s;
}

.sfg-chat__tip strong {
  font-size: 14px;
  line-height: 1.2;
}

.sfg-chat__tip span {
  font-size: 12px;
  opacity: 0.72;
}

.sfg-chat.is-open .sfg-chat__tip,
.sfg-chat.is-tip-hidden .sfg-chat__tip {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
  transition: 0.25s ease;
}

.sfg-chat__fab {
  position: relative;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, var(--sfg-green) 0%, var(--sfg-green-deep) 100%);
  box-shadow: 0 14px 34px rgba(34, 139, 36, 0.45);
  display: grid;
  place-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.sfg-chat__fab:hover,
.sfg-chat__fab:focus-visible {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 18px 40px rgba(34, 139, 36, 0.55);
  outline: none;
}

.sfg-chat__fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  z-index: -1;
  animation: sfg-pulse 2.2s ease-out infinite;
}

.sfg-chat.is-open .sfg-chat__fab-pulse {
  display: none;
}

.sfg-chat__fab-icon {
  display: grid;
  place-items: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sfg-chat__fab-icon--close,
.sfg-chat.is-open .sfg-chat__fab-icon--chat {
  position: absolute;
  opacity: 0;
  transform: scale(0.6) rotate(-20deg);
  pointer-events: none;
}

.sfg-chat.is-open .sfg-chat__fab-icon--close {
  position: static;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.sfg-chat.is-open .sfg-chat__fab {
  background: linear-gradient(145deg, var(--sfg-navy-soft), var(--sfg-navy));
  box-shadow: 0 14px 34px rgba(16, 24, 64, 0.45);
}

@keyframes sfg-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  70% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

@keyframes sfg-tip-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Premium popup shell — solid card (no glass / transparency) */
body.sfg-quote-open .sgpb-popup-overlay-2894 {
  background: rgba(10, 16, 40, 0.72) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1 !important;
}

body.sfg-quote-open .sgpb-popup-dialog-main-div-theme-wrapper-4:has(.sgpb-content-2894),
body.sfg-quote-open #sgpb-popup-dialog-main-div-wrapper:has(.sgpb-content-2894) {
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)) !important;
  transform: none !important;
  box-sizing: border-box !important;
  background: transparent !important;
}

body.sfg-quote-open .sgpb-content-2894,
body.sfg-quote-open #sgpb-popup-dialog-main-div.sgpb-content-2894,
body.sfg-quote-open .sgpb-content.sgpb-content-2894,
body.sfg-quote-open .sgpb-popup-builder-content-2894,
body.sfg-quote-open .sgpb-main-html-content-wrapper,
body.sfg-quote-open #sg-popup-content-wrapper-2894,
body.sfg-quote-open .sg-popup-builder-content {
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.sfg-quote-open .sgpb-content-2894,
body.sfg-quote-open #sgpb-popup-dialog-main-div.sgpb-content-2894,
body.sfg-quote-open .sgpb-content.sgpb-content-2894 {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: min(560px, calc(100vw - 24px)) !important;
  min-width: 0 !important;
  max-width: min(560px, calc(100vw - 24px)) !important;
  height: auto !important;
  max-height: min(88dvh, 760px) !important;
  margin: 0 auto !important;
  transform: none !important;
  border-radius: var(--sfg-radius) !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--sfg-shadow) !important;
  border: 1px solid #e8ecf4 !important;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894,
body.sfg-quote-open .sgpb-main-html-content-wrapper {
  padding: 0 !important;
  margin: 0 !important;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 > p {
  display: none;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .wpcf7 {
  padding: 22px 22px 18px;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .wpcf7::before {
  content: "Request a Quote";
  display: block;
  margin: 0 0 4px;
  color: var(--sfg-navy);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .wpcf7::after {
  content: "Tell us about your property and we’ll get back quickly.";
  display: block;
  margin: 0 0 18px;
  color: rgba(16, 24, 64, 0.68);
  font-size: 0.92rem;
  line-height: 1.45;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .row {
  --bs-gutter-x: 12px;
  --bs-gutter-y: 12px;
  margin: 0 !important;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-group {
  margin-bottom: 0 !important;
  position: relative;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-control,
body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-select,
body.sfg-quote-open .sgpb-popup-builder-content-2894 select,
body.sfg-quote-open .sgpb-popup-builder-content-2894 textarea {
  width: 100% !important;
  min-height: 52px;
  border: 1px solid var(--sfg-line) !important;
  border-radius: 14px !important;
  background: var(--sfg-mist) !important;
  color: var(--sfg-navy) !important;
  box-shadow: none !important;
  padding: 14px 42px 14px 16px !important;
  font-size: 15px !important;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 textarea.form-control {
  min-height: 110px;
  resize: vertical;
  padding-top: 14px !important;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-control:focus,
body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-select:focus,
body.sfg-quote-open .sgpb-popup-builder-content-2894 select:focus,
body.sfg-quote-open .sgpb-popup-builder-content-2894 textarea:focus {
  border-color: rgba(34, 139, 36, 0.55) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(34, 139, 36, 0.12) !important;
  outline: none !important;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-group > i {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(16, 24, 64, 0.4);
  pointer-events: none;
  z-index: 2;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-group.col-12 > i {
  top: 22px;
  transform: none;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 hr {
  border: 0;
  border-top: 1px solid var(--sfg-line);
  margin: 8px 0 4px;
  opacity: 1;
  width: 100%;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 h4 {
  width: 100%;
  margin: 4px 0 2px !important;
  color: var(--sfg-navy) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-btn {
  margin-top: 4px;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .th-btn {
  width: 100%;
  min-height: 54px;
  border: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, var(--sfg-green), var(--sfg-green-deep)) !important;
  color: #fff !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 28px rgba(34, 139, 36, 0.35);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.sfg-quote-open .sgpb-popup-builder-content-2894 .th-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(34, 139, 36, 0.42);
}

body.sfg-quote-open #sgpb-close-button.sgpb-popup-close-button-4 {
  right: 14px !important;
  bottom: auto !important;
  top: 14px !important;
  left: auto !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: rgba(16, 24, 64, 0.08) !important;
  color: transparent !important;
  font-size: 0 !important;
  box-shadow: none !important;
  display: grid !important;
  place-items: center;
}

body.sfg-quote-open #sgpb-close-button.sgpb-popup-close-button-4::before {
  content: "×";
  color: var(--sfg-navy);
  font-size: 28px;
  line-height: 1;
  font-weight: 500;
}

/* Mobile / small screens */
@media (max-width: 767px) {
  .sfg-chat {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .sfg-chat__fab {
    width: 58px;
    height: 58px;
  }

  body.sfg-quote-open .sgpb-popup-dialog-main-div-theme-wrapper-4:has(.sgpb-content-2894),
  body.sfg-quote-open .sgpb-content-2894 {
    max-width: calc(100vw - 16px) !important;
    width: calc(100vw - 16px) !important;
    max-height: min(92vh, 760px) !important;
  }

  body.sfg-quote-open .sgpb-content-2894,
  body.sfg-quote-open #sgpb-popup-dialog-main-div {
    max-height: min(92vh, 760px) !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.sfg-quote-open .sgpb-popup-builder-content-2894 .wpcf7 {
    padding: 18px 14px 14px;
  }

  body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-group.col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-control,
  body.sfg-quote-open .sgpb-popup-builder-content-2894 .form-select,
  body.sfg-quote-open .sgpb-popup-builder-content-2894 select,
  body.sfg-quote-open .sgpb-popup-builder-content-2894 textarea {
    min-height: 48px;
    font-size: 16px !important; /* avoids iOS zoom */
  }

  body.sfg-quote-open #sgpb-close-button.sgpb-popup-close-button-4 {
    top: 10px !important;
    right: 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sfg-chat__fab-pulse,
  .sfg-chat__tip {
    animation: none !important;
  }

  .sfg-chat__fab,
  .sfg-chat__fab-icon {
    transition: none !important;
  }
}

/* Sitewide: broken Jobber embed → restore Contact Form 7 quote forms */
.jobber-inline-work-request,
.jobber-flash--error,
.elementor-widget-html:has(.jobber-inline-work-request),
.elementor-widget-html:has(.jobber-flash--error) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.elementor-widget-rakarcontactform.elementor-hidden-desktop,
.elementor-widget-rakarcontactform.elementor-hidden-tablet,
.elementor-widget-rakarcontactform.elementor-hidden-mobile,
.elementor-widget-rakarcontactform {
  display: block !important;
  visibility: visible !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Premium quote form shell (Home + Contact + anywhere) */
.elementor-widget-rakarcontactform .input-light,
.elementor-widget-rakarcontactform .contact-form.ajax-contact {
  background: #fff;
  border-radius: 22px;
  padding: 24px 20px !important;
  box-shadow: 0 16px 40px rgba(16, 24, 64, 0.12);
  border: 1px solid rgba(16, 24, 64, 0.08);
  text-align: left !important;
}

.elementor-widget-rakarcontactform .sec-title,
.elementor-widget-rakarcontactform h2.sec-title {
  margin: 0 0 18px !important;
  color: var(--sfg-navy) !important;
  font-size: clamp(1.4rem, 3vw, 1.85rem) !important;
  line-height: 1.2 !important;
}

.elementor-widget-rakarcontactform .row {
  --bs-gutter-x: 12px;
  --bs-gutter-y: 12px;
  margin: 0 !important;
}

.elementor-widget-rakarcontactform .form-group {
  margin-bottom: 0 !important;
  position: relative;
}

.elementor-widget-rakarcontactform .form-control,
.elementor-widget-rakarcontactform .form-select,
.elementor-widget-rakarcontactform select,
.elementor-widget-rakarcontactform textarea {
  width: 100% !important;
  min-height: 52px;
  border-radius: 14px !important;
  border: 1px solid rgba(16, 24, 64, 0.1) !important;
  background: #f4f7fb !important;
  box-shadow: none !important;
  color: var(--sfg-navy) !important;
  padding: 14px 42px 14px 16px !important;
}

.elementor-widget-rakarcontactform textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.elementor-widget-rakarcontactform .form-control:focus,
.elementor-widget-rakarcontactform .form-select:focus,
.elementor-widget-rakarcontactform select:focus,
.elementor-widget-rakarcontactform textarea:focus {
  border-color: rgba(34, 139, 36, 0.55) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(34, 139, 36, 0.12) !important;
  outline: none !important;
}

.elementor-widget-rakarcontactform .form-group > i {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(16, 24, 64, 0.4);
  pointer-events: none;
  z-index: 2;
}

.elementor-widget-rakarcontactform h4 {
  width: 100%;
  margin: 8px 0 4px !important;
  color: var(--sfg-navy) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
}

.elementor-widget-rakarcontactform hr {
  border: 0;
  border-top: 1px solid rgba(16, 24, 64, 0.1);
  margin: 10px 0 6px;
  opacity: 1;
  width: 100%;
}

.elementor-widget-rakarcontactform .th-btn,
.elementor-widget-rakarcontactform .form-btn .th-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #228b24, #176b1a) !important;
  border: 0 !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 12px 28px rgba(34, 139, 36, 0.35);
}

/* Contact page layout polish */
.page-id-48 .elementor-element-ca60550,
.page-id-48 .elementor-element-55feed1 {
  width: 100% !important;
}

.page-id-48 .elementor-widget-google_maps .elementor-custom-embed,
.page-id-48 .elementor-widget-google_maps iframe {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 18px;
  overflow: hidden;
}

.page-id-48 .elementor-widget-google_maps iframe {
  min-height: 280px;
  height: clamp(280px, 45vw, 420px) !important;
}

.page-id-48 .media-body {
  word-break: break-word;
}

@media (max-width: 991px) {
  .elementor-widget-rakarcontactform .form-group.col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  .page-id-48 .elementor-element-ca60550,
  .page-id-48 .elementor-element-55feed1 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 767px) {
  .sfg-chat {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .sfg-chat__tip {
    max-width: min(168px, calc(100vw - 92px));
    padding: 10px 12px;
    font-size: 12px;
  }

  .sfg-chat__tip strong {
    font-size: 13px;
  }

  .elementor-widget-rakarcontactform .input-light,
  .elementor-widget-rakarcontactform .contact-form.ajax-contact {
    padding: 18px 14px !important;
    border-radius: 18px;
  }

  .elementor-widget-rakarcontactform .form-control,
  .elementor-widget-rakarcontactform .form-select,
  .elementor-widget-rakarcontactform select,
  .elementor-widget-rakarcontactform textarea {
    min-height: 48px;
    font-size: 16px !important; /* prevent iOS zoom */
  }

  .page-id-48 .elementor-widget-google_maps iframe {
    min-height: 240px;
    height: 240px !important;
  }
}

/* Why Choose / hosted videos: avoid black void while source is repaired */
.elementor-widget-video .elementor-wrapper,
.elementor-widget-video .e-hosted-video {
  background: #111827 url("https://serenefacilitygroup.com.au/booking/images/bg-wcs.webp") center / cover no-repeat !important;
  overflow: hidden;
  border-radius: 18px;
  min-height: 240px;
}

.elementor-widget-video video.elementor-video {
  width: 100% !important;
  height: 100% !important;
  min-height: 240px;
  object-fit: cover !important;
  background: transparent !important;
}

.elementor-widget-video .sfg-why-fallback {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
}
