/* HubSpot book-a-demo modal */
.terms-hubspot-modal {
  box-sizing: border-box;
  padding: clamp(8px, 2vh, 20px);
  overflow-y: auto;
}

.terms-hubspot-modal .book-demo-form-wrapper {
  box-sizing: border-box;
  width: min(100%, 600px);
  max-width: 600px;
  max-height: calc(100dvh - clamp(16px, 4vh, 40px));
  margin: auto !important;
  padding: clamp(24px, 4vh, 36px) clamp(18px, 4vw, 32px) !important;
  overflow-y: auto;
}

.terms-hubspot-modal .productpagemodal-close {
  z-index: 2;
}

.terms-hubspot-modal .hs-form-html,
.terms-hubspot-modal .hs-form-html * {
  box-sizing: border-box;
}

.terms-hubspot-modal .hs-form-html,
.terms-hubspot-modal .hs-form,
.terms-hubspot-modal .hs-form fieldset {
  width: 100%;
  max-width: none !important;
  margin: 0;
}

/* Compact spacing for small screens. */
.terms-hubspot-modal .hs-form-field {
  margin-bottom: 10px !important;
}

.terms-hubspot-modal .hs-input {
  width: 100% !important;
  height: 38px !important;
  padding: 8px 12px !important;
  border: 1px solid var(--form-border) !important;
  border-radius: 8px !important;
  background-color: #0f172a !important;
  color: #ffffff !important;
  font: inherit;
  outline: none;
}

.terms-hubspot-modal textarea.hs-input {
  height: auto !important;
  min-height: 76px;
  resize: vertical;
}

.terms-hubspot-modal .hs-input:focus {
  border-color: var(--link-color) !important;
  box-shadow: 0 0 0 3px rgba(107, 124, 255, 0.2);
}

.terms-hubspot-modal .hs-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.terms-hubspot-modal label,
.terms-hubspot-modal legend {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.35;
}

.terms-hubspot-modal .inputs-list,
.terms-hubspot-modal .hs-error-msgs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.terms-hubspot-modal .hs-form-booleancheckbox-display,
.terms-hubspot-modal .hs-form-checkbox-display,
.terms-hubspot-modal .hs-form-radio-display {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.terms-hubspot-modal input[type="checkbox"].hs-input,
.terms-hubspot-modal input[type="radio"].hs-input {
  flex: 0 0 auto;
  width: 18px !important;
  height: 18px !important;
  margin: 1px 0 0 !important;
  padding: 0 !important;
}

.terms-hubspot-modal .hs-error-msgs {
  margin-top: 4px;
}

.terms-hubspot-modal .hs-error-msg {
  color: #fca5a5;
  font-size: 12px;
}

.terms-hubspot-modal .hs_submit .actions {
  margin: 14px 0 0;
  padding: 0;
}

.terms-hubspot-modal .hs-button {
  width: 100%;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid #122c72;
  border-radius: 8px;
  background: #122c72;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.terms-hubspot-modal .hs-button:hover,
.terms-hubspot-modal .hs-button:focus-visible {
  border-color: #1b3f9f;
  background: #1b3f9f;
}

/* Transparent form copy and dark-mode text visibility. */
.terms-hubspot-modal .hs-richtext,
.terms-hubspot-modal .hs-richtext * {
  background: transparent !important;
  color: var(--text-secondary) !important;
}

.terms-hubspot-modal .hs-richtext p {
  margin: 0 0 10px;
}

.terms-hubspot-modal .hs-richtext a {
  color: var(--link-color) !important;
}

html[data-theme="dark"] .terms-hubspot-modal .hs-richtext,
html[data-theme="dark"] .terms-hubspot-modal .hs-richtext *,
.dark-mode .terms-hubspot-modal .hs-richtext,
.dark-mode .terms-hubspot-modal .hs-richtext * {
  background: transparent !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .terms-hubspot-modal .hs-input,
.dark-mode .terms-hubspot-modal .hs-input {
  background-color: #0f172a !important;
  color: #ffffff !important;
}

html[data-theme="light"] .terms-hubspot-modal .hs-input {
  background-color: #f8faff !important;
  color: #0f172a !important;
}

/* Keep the confirmation compact instead of retaining the form's old height. */
.terms-hubspot-modal .submitted-message {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 4px 0 !important;
  background: transparent !important;
  color: var(--text-primary) !important;
  line-height: 1.5;
  text-align: center;
}

.terms-hubspot-modal .submitted-message > :first-child {
  margin-top: 0 !important;
}

.terms-hubspot-modal .submitted-message > :last-child {
  margin-bottom: 0 !important;
}

.terms-hubspot-modal .book-demo-form-wrapper:has(.submitted-message) {
  padding-block: 24px !important;
}

@media (max-width: 600px) {
  .terms-hubspot-modal .book-demo-form-wrapper {
    padding: 24px 18px !important;
  }
}

@media (max-height: 720px) {
  .terms-hubspot-modal {
    align-items: flex-start;
    padding-block: 8px;
  }

  .terms-hubspot-modal .book-demo-form-wrapper {
    max-height: calc(100dvh - 16px);
    padding-block: 18px !important;
  }

  .terms-hubspot-modal .hs-form-field {
    margin-bottom: 8px !important;
  }

  .terms-hubspot-modal .hs-input {
    height: 36px !important;
  }

  .terms-hubspot-modal .hs_submit .actions {
    margin-top: 10px;
  }
}
