/* systMD support bubble */
.sjp-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: var(--systmd-font-family, "Titillium Web", sans-serif);
}

.sjp-bubble-toggle {
  height: 60px;
  min-width: 60px;
  padding: 0 22px;
  border-radius: 999px;
  border: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(135deg, var(--systmd-blue, #046BD2), var(--systmd-blue-light, #4A9BE8));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(4, 107, 210, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sjp-bubble-label {
  font-family: var(--systmd-font-family, "Titillium Web", sans-serif);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

/* collapse the pill to a plain circle while the panel is open (X only) */
.sjp-bubble.is-open .sjp-bubble-label { display: none; }
.sjp-bubble.is-open .sjp-bubble-toggle {
  width: 60px;
  min-width: 60px;
  padding: 0;
}

/* keep a focus ring for keyboard users only */
.sjp-bubble-toggle:focus-visible {
  outline: 2px solid var(--systmd-blue-light, #4A9BE8);
  outline-offset: 3px;
}

.sjp-bubble-toggle:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 28px rgba(4, 107, 210, 0.55);
}

.sjp-bubble-toggle .sjp-icon-close { display: none; }
.sjp-bubble.is-open .sjp-bubble-toggle .sjp-icon-close { display: block; }
.sjp-bubble.is-open .sjp-bubble-toggle .sjp-icon-chat { display: none; }

/* Panel is hidden unless the wrapper carries .is-open.
   (Do NOT set display on the base class — it would override [hidden].) */
.sjp-bubble-panel {
  display: none;
  width: min(380px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 120px));
  flex-direction: column;
  background: var(--systmd-white, #fff);
  border-radius: var(--systmd-radius, 16px);
  box-shadow: 0 12px 48px rgba(15, 28, 46, 0.28);
  overflow: hidden;
}

.sjp-bubble.is-open .sjp-bubble-panel {
  display: flex;
}

.sjp-bubble-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--systmd-dark-bg, #0F1C2E), var(--systmd-dark-card, #1E3355));
  color: #fff;
}

.sjp-bubble-header strong {
  font-size: 18px;
  display: block;
}

.sjp-bubble-header p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--systmd-light-text, rgba(229, 241, 255, 0.6));
}

.sjp-bubble-close {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  opacity: 0.75;
}

.sjp-bubble-close:hover { opacity: 1; }

.sjp-bubble-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
}

/* Gravity Forms styling inside the panel */
.sjp-bubble-body .gform_wrapper .gform_fields { grid-row-gap: 12px; }

.sjp-bubble-body .gform_wrapper label.gfield_label {
  font-size: 14px;
  font-weight: 600;
  color: var(--systmd-dark, #1B2A4A);
}

.sjp-bubble-body .gform_wrapper .gfield_required_text {
  font-size: 11px;
  font-weight: 400;
  color: var(--systmd-gray, rgba(0, 0, 0, 0.5));
  margin-left: 4px;
}

.sjp-bubble-body .gform_wrapper .gfield_description {
  font-size: 12px;
  color: var(--systmd-gray, rgba(0, 0, 0, 0.55));
  padding-top: 4px;
}

.sjp-bubble-body .gform_wrapper input[type="text"],
.sjp-bubble-body .gform_wrapper input[type="email"],
.sjp-bubble-body .gform_wrapper input[type="tel"],
.sjp-bubble-body .gform_wrapper select,
.sjp-bubble-body .gform_wrapper textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.4; /* the site sets a fixed 38px line-height on form controls, which clips text here */
  border: 1px solid var(--systmd-border-light, rgba(0, 0, 0, 0.15));
  border-radius: var(--systmd-btn-radius, 8px);
  background-color: #fff;
  color: var(--systmd-dark, #1B2A4A);
}

/* The site strips native select chrome globally (appearance: none),
   so provide our own chevron and spacing. */
.sjp-bubble-body .gform_wrapper select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B2A4A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 38px;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.sjp-bubble-body .gform_wrapper textarea { min-height: 96px; }

.sjp-bubble-body .gform_wrapper .gform_button {
  width: 100%;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  border: 0;
  border-radius: var(--systmd-btn-radius, 8px);
  background: linear-gradient(135deg, var(--systmd-blue, #046BD2), var(--systmd-blue-light, #4A9BE8));
  cursor: pointer;
}

.sjp-bubble-body .gform_wrapper .gform_button:hover { filter: brightness(1.08); }

.sjp-bubble-body .gform_confirmation_message {
  font-size: 15px;
  color: var(--systmd-dark, #1B2A4A);
  padding: 8px 0;
}

@media (max-width: 480px) {
  .sjp-bubble { right: 12px; bottom: 12px; }
  .sjp-bubble-panel { width: calc(100vw - 24px); }
  /* icon-only circle on small screens */
  .sjp-bubble-label { display: none; }
  .sjp-bubble-toggle { width: 60px; min-width: 60px; padding: 0; }
}
