/* Every selector starts at .sdm-so: the widget sits on every page of the
   client's site, beside the theme's header, content and footer. Sizes are px,
   never rem (Bricks sets the root to 62.5%). */

.sdm-so {
  /* A flat fill of the client theme's primary, then the CRM brand accent. */
  --sdm-so-bg: var(--brand-primary, var(--brand-accent, #dd2c1f));
  --sdm-so-ink: var(--brand-text-light, #ffffff);
  --sdm-so-cta: grey;
  --sdm-so-cta-ink: white;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
}

.sdm-so *,
.sdm-so *::before,
.sdm-so *::after {
  box-sizing: border-box;
}

/* The tab: always on the left edge, vertically centred. */
.sdm-so .sdm-so-tab {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 16px 10px;
  border: 0;
  border-radius: 0 6px 6px 0;
  background: var(--sdm-so-bg);
  color: var(--sdm-so-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-50%);
  transition: transform 0.3s ease, filter 0.15s ease;
}

.sdm-so .sdm-so-tab:hover {
  background: var(--sdm-so-bg);
  color: var(--sdm-so-ink);
  filter: brightness(1.08);
}

.sdm-so .sdm-so-tab:focus-visible {
  outline: 3px solid var(--sdm-so-cta);
  outline-offset: 2px;
}

.sdm-so .sdm-so-tab-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.sdm-so .sdm-so-tab-icon {
  display: block;
  width: 20px;
  height: 20px;
}

.sdm-so.is-open .sdm-so-tab {
  transform: translate(-110%, -50%);
}

/* The card: docked to the left edge, slides out from behind it. No backdrop,
   so the page stays usable while it is open. */
.sdm-so .sdm-so-card {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 99991;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 22px 30px 26px;
  border-radius: 0 4px 4px 0;
  background: var(--sdm-so-bg);
  color: var(--sdm-so-ink);
  text-align: center;
  box-shadow: 4px 6px 18px rgba(0, 0, 0, 0.28);
  visibility: hidden;
  transform: translate(-110%, -50%);
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

.sdm-so.is-open .sdm-so-card {
  visibility: visible;
  transform: translate(0, -50%);
  transition: transform 0.3s ease, visibility 0s;
}

.sdm-so .sdm-so-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--sdm-so-bg);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sdm-so .sdm-so-close:hover {
  background: #f2f2f2;
  color: var(--sdm-so-bg);
}

.sdm-so .sdm-so-close:focus-visible {
  outline: 3px solid var(--sdm-so-cta);
  outline-offset: 2px;
}

.sdm-so .sdm-so-close svg {
  display: block;
  width: 14px;
  height: 14px;
}

/* The mail icon in a white-bordered circle. Both take the card's text colour,
   so they stay readable on whatever the theme's primary is. */
.sdm-so .sdm-so-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin: 2px auto 14px;
  border: 3px solid var(--sdm-so-ink);
  border-radius: 50%;
  color: var(--sdm-so-ink);
}

.sdm-so .sdm-so-mail {
  display: block;
  width: 38px;
  height: 38px;
}

.sdm-so .sdm-so-title {
  margin: 0 0 6px;
  color: var(--sdm-so-ink);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
}

.sdm-so .sdm-so-sub {
  margin: 0 0 16px;
  color: var(--sdm-so-ink);
  font-size: 15px;
}

/* The WPForms form. WPForms ships its own high-specificity styles, so the
   overrides that matter are !important. Labels are hidden visually, not
   removed: screen readers still read them, and the JS copies each one into
   its field's placeholder when the form has none. */
.sdm-so .sdm-so-form {
  text-align: left;
}

.sdm-so .sdm-so-form .wpforms-container {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sdm-so .sdm-so-form .wpforms-field {
  margin: 0 !important;
  padding: 0 0 10px !important;
}

.sdm-so .sdm-so-form .wpforms-field-label,
.sdm-so .sdm-so-form .wpforms-field-sublabel {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.sdm-so .sdm-so-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.sdm-so .sdm-so-form select,
.sdm-so .sdm-so-form textarea {
  width: 100% !important;
  max-width: none !important;
  height: 36px !important;
  padding: 6px 10px !important;
  border: 1px solid #e6e6e6 !important;
  border-radius: 2px !important;
  background: #ffffff !important;
  color: #1c1b1f !important;
  font-size: 15px !important;
  box-shadow: none !important;
}

.sdm-so .sdm-so-form textarea {
  height: 80px !important;
}

.sdm-so .sdm-so-form input::placeholder,
.sdm-so .sdm-so-form textarea::placeholder {
  color: #8c8c8c;
  opacity: 1;
}

.sdm-so .sdm-so-form .wpforms-recaptcha-container {
  display: flex;
  justify-content: center;
  margin: 4px -20px 6px !important;
  padding: 0 !important;
}

.sdm-so .sdm-so-form .wpforms-submit-container {
  margin: 0 !important;
  padding: 6px 0 0 !important;
  text-align: center;
}

.sdm-so .sdm-so-form button[type="submit"] {
  width: 100% !important;
  height: auto !important;
  padding: 11px 12px !important;
  border: 0 !important;
  border-radius: 2px !important;
  background: var(--sdm-so-cta) !important;
  color: var(--sdm-so-cta-ink) !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.25) !important;
}

.sdm-so .sdm-so-form button[type="submit"]:hover {
  background: var(--sdm-so-cta) !important;
  color: var(--sdm-so-cta-ink) !important;
  filter: brightness(1.05);
}

.sdm-so .sdm-so-form label.wpforms-error,
.sdm-so .sdm-so-form em.wpforms-error {
  color: var(--sdm-so-ink) !important;
  font-size: 13px !important;
}

.sdm-so .sdm-so-form .wpforms-confirmation-container-full {
  margin: 0 !important;
  border: 0 !important;
  background: #ffffff !important;
  color: #1c1b1f !important;
}

/* Preview only: the CRM draws a form as .sdm-mock-* until a real one is pushed. */
.sdm-so .sdm-mock-form {
  padding: 0;
  border: 0;
  background: transparent;
}

.sdm-so .sdm-mock-badge,
.sdm-so .sdm-mock-label {
  display: none;
}

.sdm-so .sdm-mock-field {
  margin-bottom: 10px;
}

.sdm-so .sdm-mock-input {
  display: block;
  height: 36px;
  padding: 8px 10px;
  border: 1px solid #e6e6e6;
  border-radius: 2px;
  background: #ffffff;
  color: #8c8c8c;
  font-size: 15px;
  text-align: left;
}

.sdm-so .sdm-mock-input::placeholder {
  color: #8c8c8c;
  opacity: 1;
}

.sdm-so .sdm-mock-submit {
  display: block;
  padding: 11px 12px;
  border-radius: 2px;
  background: var(--sdm-so-cta);
  color: var(--sdm-so-cta-ink);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.25);
}

@media (max-width: 480px) {
  .sdm-so .sdm-so-tab {
    padding: 12px 8px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sdm-so .sdm-so-tab,
  .sdm-so .sdm-so-card {
    transition: none;
  }
}

@media print {
  .sdm-so {
    display: none;
  }
}