/* URBAH CRM 116 — shared inline form, light services / dark homepage.
   No popup, consent validation or education form changes. */
body#service-template .service-page .sp-contact .sp-form {
  --ug-crm-label: #201d30;
  padding: clamp(18px, 2.2vw, 28px) !important;
}
body#service-template .service-page .sp-contact .sp-form > h3 {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
}
.ug-home-crm { --ug-crm-label: #ddd9e8; }
/* Inline form only. The original CRM loader, validation and consent are untouched. */
.ug-home-crm .b24-form {
  --b24-background-color: #201d30 !important;
  --b24-text-color: #f5f2fa !important;
  --b24-primary-color: #ffffff !important;
  --b24-primary-text-color: #201d30 !important;
  --b24-field-background-color: #2b283b !important;
  --b24-field-border-color: #676176 !important;
  --b24-field-color: #ffffff !important;
  --b24-field-focus-background-color: #302c42 !important;
  --b24-popup-background-color: #302c42 !important;
  color: #f5f2fa !important;
  color-scheme: dark;
}
.ug-home-crm .b24-form,
.ug-home-crm .b24-form-wrapper,
.ug-home-crm .b24-form-content,
.ug-home-crm .b24-form-header,
.ug-home-crm .b24-form-padding-side,
.ug-home-crm .b24-form-sign {
  background: transparent !important;
  color: #f5f2fa !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.ug-home-crm .b24-form-wrapper {padding: 0 !important;}
.ug-home-crm .b24-form-padding-side {padding-left: 0 !important; padding-right: 0 !important;}
.ug-home-crm input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.ug-home-crm textarea.b24-form-control,
.ug-home-crm select.b24-form-control {
  background: #2b283b !important;
  border: 1px solid #676176 !important;
  border-radius: 16px !important;
  color: #ffffff !important;
  caret-color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.ug-home-crm input.b24-form-control:focus,
.ug-home-crm textarea.b24-form-control:focus {
  border-color: #a68ae8 !important;
  box-shadow: 0 0 0 2px #a68ae84d !important;
}
.ug-home-crm input.b24-form-control:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #2b283b inset !important;
  -webkit-text-fill-color: #ffffff !important;
}
.ug-home-crm .b24-form-control-label,
.ug-home-crm .b24-form-control-desc,
.ug-home-crm .b24-form-field-agreement,
.ug-home-crm .b24-form-field-agreement label,
.ug-home-crm .b24-form-field-agreement span,
.ug-home-crm .b24-form-control-check-label,
.ug-home-crm .b24-form-sign,
.ug-home-crm .b24-form-sign a {color: #ddd9e8 !important; opacity: 1 !important;}
.ug-home-crm .b24-form-field-agreement a {color: #e2d4ff !important; text-decoration: underline;}
.ug-home-crm input[type="checkbox"] {accent-color: #8e78d0;}
.ug-home-crm .b24-form-btn {background: #ffffff !important; color: #201d30 !important; border-radius: 999px !important;}
.ug-home-crm .b24-form-btn:hover:not(:disabled) {background: #ff1f8f !important; color: #ffffff !important;}
.ug-home-crm .b24-form-btn:disabled {opacity: .65;}
.ug-home-crm .b24-form-btn:focus-visible {outline: 2px solid #c6b6ff !important; outline-offset: 3px;}

/* Text-like controls include Bitrix type=string and other custom types. */
/* Compact common layout; keep the CRM header visible if it contains text. */
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form { margin-top: 0 !important; }
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-wrapper { padding: 0 !important; min-height: 0 !important; }
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-header { padding: 0 !important; margin: 0 !important; }
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-header:empty { display: none !important; }
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-content { padding: 0 !important; margin: 0 !important; }
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-padding-side { padding-left: 0 !important; padding-right: 0 !important; }
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-control-container:has(> .b24-form-control-label):has(> :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) { position: relative !important; padding-top: 22px !important; }
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-control-container:has(> .b24-form-control-label):has(> :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) > .b24-form-control-label {
  display: block !important;
  position: absolute !important;
  top: 0 !important; bottom: auto !important; left: 0 !important; right: auto !important;
  transform: none !important;
  margin: 0 !important; padding: 0 !important;
  color: var(--ug-crm-label, #201d30) !important;
  font-size: 13px !important; line-height: 18px !important;
  background: transparent !important; opacity: 1 !important;
}
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-control-container:has(> .b24-form-control-label):has(> :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) > :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control) {
  box-sizing: border-box !important;
  padding-top: 10px !important; padding-bottom: 10px !important;
  font-size: 16px !important; line-height: 22px !important;
}
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-control-container:has(> .b24-form-control-label):has(> :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) > input.b24-form-control { height: 44px !important; min-height: 44px !important; }
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-control-container:has(> .b24-form-control-label):has(> :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) > textarea.b24-form-control { height: 96px !important; min-height: 96px !important; resize: vertical; }
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-field:has(.b24-form-control-container > :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) { margin-bottom: 12px !important; }

/* Same pill radius as .sp-button, for both inline themes. */
:is(body#service-template .service-page .sp-contact .sp-form, .ug-home-crm) .b24-form-btn {
  border-radius: 999px !important;
}
