/* Embedded HubSpot forms (hubspot-forms.js renders them into <div class="ck-hsform"> without HubSpot's own
   stylesheet), in the launch-site design: fields like .ck-input, labels, checkboxes and consent text, error
   messages and the submit button as .btn-default-lg. The sample evidence pack pop-up (.ckm), the products
   page's overview dialog (.po-guide) and form cards on design-system pages (.lead-form) have their own variants
   at the end. Load after the site stylesheets. */

.ck-hsform[aria-busy="true"] { min-height: 320px; }   /* room for the form while HubSpot loads it */
.ck-hsform form { margin: 0; }
.ck-hsform fieldset {
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ck-hsform fieldset.form-columns-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 16px;
}
@media (max-width: 639px) {
  .ck-hsform fieldset.form-columns-2 { grid-template-columns: minmax(0, 1fr); }
}

/* HubSpot still injects a small layout stylesheet (with form-specific selectors): 50% floats, 8px gaps,
   500px wide fieldsets, 95% wide inputs. The grid above lays the columns out instead. */
.ck-hsform fieldset { max-width: none !important; }
.ck-hsform .hs-form-field {
  width: auto !important;
  float: none !important;
}
.ck-hsform .input { margin-right: 0 !important; }
.ck-hsform .hs-input:not([type="checkbox"]):not([type="radio"]) { width: 100% !important; }

/* Fields */
.ck-hsform .hs-form-field { margin: 0 0 20px; }
.ck-hsform .hs-form-field > label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #042f2e;
}
.ck-hsform .hs-form-required {
  margin-left: 2px;
  color: #17b0b5;
}
.ck-hsform .hs-field-desc {
  margin: -2px 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #406160;
}
.ck-hsform .input { margin: 0; }
.ck-hsform .hs-input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #c8d3d9;
  border-radius: 6px;
  background-color: #ffffff;
  color: #042f2e;
  font-family: inherit;
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.ck-hsform select.hs-input {
  padding-right: 40px;
  appearance: none;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23042f2e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.ck-hsform textarea.hs-input {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}
.ck-hsform .hs-input::placeholder { color: #7c9393; }
.ck-hsform .hs-input:not([type="checkbox"]):not([type="radio"]):focus {
  outline: none;
  border-color: #125467;
  box-shadow: 0 0 0 2px rgba(18, 84, 103, 0.18);
}
.ck-hsform .hs-input.error:not([type="checkbox"]):not([type="radio"]) {
  border-color: #042f2e;
  box-shadow: 0 0 0 2px rgba(4, 47, 46, 0.18);
}

/* Checkboxes, radio buttons, consent */
.ck-hsform .inputs-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ck-hsform .inputs-list li + li { margin-top: 8px; }
.ck-hsform .hs-form-booleancheckbox-display,
.ck-hsform .hs-form-checkbox-display,
.ck-hsform .hs-form-radio-display {
  display: flex;
  flex-direction: row;   /* pages whose dialog styles every label as a column */
  align-items: flex-start;
  gap: 12px;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.5;
  color: #406160;
  cursor: pointer;
}
.ck-hsform input[type="checkbox"],
.ck-hsform input[type="radio"] {
  flex: none;
  width: var(--ck-check, 16px) !important;   /* HubSpot's injected layout sets width: auto */
  height: var(--ck-check, 16px);
  margin: 2px 0 0;
  accent-color: #125467;
}
.ck-hsform .hs-richtext,
.ck-hsform .legal-consent-container {
  font-size: 13px;
  line-height: 1.5;
  color: #406160;
}
.ck-hsform .hs-richtext p { margin: 0 0 8px; }
.ck-hsform .hs-richtext a,
.ck-hsform .legal-consent-container a,
.ck-hsform .hs-form-booleancheckbox-display a {
  font-weight: 600;
  color: #042f2e;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Error messages */
.ck-hsform .hs-error-msgs {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.ck-hsform .hs-error-msgs label,
.ck-hsform .hs-error-msg {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #042f2e;
}
.ck-hsform .hs_error_rollup { margin: -4px 0 16px; }
.ck-hsform-fail {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: #042f2e;
}

/* Submit button: .btn-default-lg, full width */
.ck-hsform .hs_submit .actions { margin: 0; }
.ck-hsform .hs-button {
  width: 100%;
  height: 48px;
  padding: 0 26px;
  border: 1px solid #9bf4ef;
  border-radius: 6px;
  background: #9bf4ef;
  color: #053747;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 200ms cubic-bezier(0.22, 1, 0.36, 1), border-color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ck-hsform .hs-button:hover {
  background: #17b0b5;
  border-color: #17b0b5;
}
.ck-hsform .hs-button:active { opacity: 0.85; }
.ck-hsform .hs-button:disabled {
  opacity: 0.6;
  cursor: default;
}
@media (max-width: 1023px) {
  .ck-hsform .hs-button {
    height: 44px;
    padding: 0 20px;
    font-size: 14px;
  }
}

/* Sample evidence pack pop-up (evidence-pack-modal.js): its own field style */
.ckm .ck-hsform .hs-form-field {
  display: block;   /* HubSpot's fields also have the class .field, a grid in site-styles.css */
  margin-bottom: 14px;
}
.ckm .ck-hsform .hs-form-field > label {
  margin-bottom: 6px;
  font-size: 14px;
}
.ckm .ck-hsform fieldset.form-columns-2 { column-gap: 14px; }
.ckm .ck-hsform .hs-input:not([type="checkbox"]):not([type="radio"]) {
  border-color: #7f9799;
  border-radius: 8px;
  font-size: 16px;
}
.ckm .ck-hsform .hs-input:not([type="checkbox"]):not([type="radio"]):hover { border-color: #125467; }
.ckm .ck-hsform .hs-input:not([type="checkbox"]):not([type="radio"]):focus {
  outline: 2px solid #125467;
  outline-offset: 1px;
  border-color: #125467;
  box-shadow: none;
}
.ckm .ck-hsform .hs-input.error:not([type="checkbox"]):not([type="radio"]) {
  border-color: #b42318;
  box-shadow: none;
}
.ckm .ck-hsform .hs-error-msgs label,
.ckm .ck-hsform .hs-error-msg {
  font-weight: 400;
  color: #b42318;
}
.ckm .ck-hsform input[type="checkbox"],
.ckm .ck-hsform input[type="radio"] { --ck-check: 18px; }
.ckm .ck-hsform .hs-button {
  height: auto;
  min-height: 48px;
  margin-top: 4px;
  padding: 12px 20px;
  border: 0;
  color: #042f2e;
  font-size: 15px;
  line-height: 1.2;
}

/* Products page: the product overview dialog (.po-guide), its field style */
.po-guide .ck-hsform .hs-form-field { margin-bottom: 12px; }
.po-guide .ck-hsform .hs-form-field > label {
  margin-bottom: 6px;
  font-size: 14px;
}
.po-guide .ck-hsform .hs-input:not([type="checkbox"]):not([type="radio"]) {
  height: 44px;
  padding: 0 12px;
  border-color: #e0e7ea;
  border-radius: 10px;
  font-size: inherit;
}
.po-guide .ck-hsform .hs-form-booleancheckbox-display { gap: 10px; }
.po-guide .ck-hsform input[type="checkbox"] {
  --ck-check: 13px;   /* the browser's size, as in the design */
  margin-top: 3px;
}

/* Form cards on design-system pages (.form.lead-form, as on /exit-exercise): the design's field style */
.lead-form .ck-hsform .hs-form-field {
  display: block;   /* HubSpot's fields also have the class .field, a grid in site-styles.css */
  margin-bottom: 14px;
}
.lead-form .ck-hsform fieldset.form-columns-2 { column-gap: 12px; }
.lead-form .ck-hsform .hs-form-field > label {
  margin-bottom: 6px;
  font-size: 14px;
}
.lead-form .ck-hsform .hs-input:not([type="checkbox"]):not([type="radio"]) {
  border-radius: 8px;
  font-size: 16px;
}
.lead-form .ck-hsform input[type="checkbox"],
.lead-form .ck-hsform input[type="radio"] { --ck-check: 18px; }
.lead-form .ck-hsform .hs-form-booleancheckbox-display { font-size: 14px; }

/* The design's dark button (.btn-dark), for forms whose card uses it: <div class="ck-hsform" data-button="dark"> */
.ck-hsform[data-button="dark"] .hs-button {
  background: #125467;
  border-color: #125467;
  color: #ffffff;
}
.ck-hsform[data-button="dark"] .hs-button:hover {
  background: #042f2e;
  border-color: #042f2e;
}
