/* Joomla Center — all Convert Forms forms.
   Add after the existing template CSS, without <style> tags. */

:root .convertforms {
  --control-gap: 9px !important;
  --label-color: #1d3346;
  --label-size: 14px;
  --label-weight: 600;
  --input-color: #1d3346;
  --input-placeholder-color: #657686;
  --input-background-color: #f9fbfd;
  --input-border-color: #cdd7e1;
  --input-border-radius: 7px;
  --input-size: 14px;
  --color-danger: #b83242;
  --color-success: #2e6d45;
  box-sizing: border-box;
  width: 100%;
  max-width: 740px;
  margin-inline: auto;
  padding: 0;
  border: 1px solid #cdd7e1;
  border-top: 4px solid #286194;
  border-radius: 16px;
  background: #fff;
  color: #1d3346;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 16px 48px rgb(25 53 76 / 12%);
}

:root .convertforms .cf-form-wrap {
  padding: 26px 30px 28px;
  background: transparent;
  border-radius: inherit;
}

:root .convertforms .cf-fields {
  align-items: flex-start;
}

:root .convertforms .cf-control-group,
:root .convertforms .cf-control-input {
  min-width: 0;
}

/* Existing heading block; no generated or replaced text. */
:root .convertforms [data-type="html"]:has(h2, .h2) {
  padding-bottom: 18px;
}

:root .convertforms [data-type="html"]:has(h2, .h2) p {
  margin: 0;
  color: #596c7c;
  font-size: 14px;
  line-height: 1.5;
}

:root .convertforms [data-type="html"]:has(h2, .h2) .text-primary {
  color: #286194 !important;
}

:root .convertforms .cf-heading,
:root .convertforms [data-type="html"]:has(h2, .h2) :is(h2, .h2) {
  margin: 12px 0 8px !important;
  color: #1d3346;
  font-family: inherit;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  text-transform: none;
  border: 0;
}

:root .convertforms .cf-label {
  margin-bottom: 7px;
  color: #1d3346;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

:root .convertforms .cf-required-label {
  color: #286194;
}

:root .convertforms .cf-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #cdd7e1;
  border-radius: 7px;
  background: #f9fbfd;
  color: #1d3346;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: none;
}

:root .convertforms .cf-input::placeholder,
:root .convertforms select.cf-input:has(option:disabled:checked) {
  color: #657686;
  opacity: 1;
}

:root .convertforms .cf-select select.cf-input {
  padding-right: 34px;
}

:root .convertforms .cf-select::after {
  right: 14px;
  border-top-color: #657686;
}

:root .convertforms textarea.cf-input {
  min-height: 96px;
  resize: vertical;
}

:root .convertforms .cf-input:focus {
  border-color: #286194 !important;
  background-color: #fff;
  outline: 2px solid rgb(40 97 148 / 24%);
  outline-offset: 2px;
  box-shadow: none;
}

:root .convertforms .cf-input[aria-invalid="true"],
:root .convertforms .cf-input:user-invalid {
  border-color: #b83242;
}

:root .convertforms .cf-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Consent and the last row retain their existing field structure. */
:root .convertforms [data-type="termsofservice"] {
  margin-top: 5px;
  padding-top: 18px;
  border-top: 1px solid #dce4eb;
}

:root .convertforms .cf-checkbox-group {
  align-items: flex-start;
  gap: 9px;
}

:root .convertforms .cf-checkbox-group input[type="checkbox"] {
  appearance: auto;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: #286194;
}

:root .convertforms .cf-checkbox-group .cf-label {
  margin: 0;
  color: #596c7c;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

:root .convertforms .cf-label a,
:root .convertforms .cf-label a:hover,
:root .convertforms .cf-label a:focus {
  color: #286194;
  text-decoration: underline;
  text-underline-offset: 3px;
}

:root .convertforms .cf-label a:hover {
  text-decoration-thickness: 2px;
}

:root .convertforms .captcha-container {
  justify-content: flex-start;
  gap: 10px;
}

:root .convertforms .captcha-container .captcha-equation {
  flex: 0 0 auto;
  color: #1d3346;
  font-size: 16px;
  font-weight: 600;
}

:root .convertforms .captcha-container input.cf-input {
  flex: 0 0 76px;
  width: 76px;
  max-width: 76px;
  text-align: center;
}

:root .convertforms [data-type="captcha"],
:root .convertforms [data-type="submit"] {
  align-self: flex-end;
}

:root .convertforms .cf-btn {
  width: 100%;
  min-height: 46px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #ff9f05;
  color: #30210c;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  opacity: 1;
  transition: background-color 150ms ease;
}

:root .convertforms .cf-btn:hover:not(:disabled) {
  background: #f39200;
  color: #30210c;
  opacity: 1;
}

:root .convertforms .cf-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

:root .convertforms .cf-btn:focus-visible,
:root .convertforms input[type="checkbox"]:focus-visible,
:root .convertforms a:focus-visible {
  outline: 2px solid #286194;
  outline-offset: 3px;
}

/* Regular Labs modals containing a Convert Forms form. */
:root [data-modals-element="modal"] [data-modals-element="slide-content"]:has(.convertforms) {
  padding: 0 !important;
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 20px 60px rgb(14 31 49 / 22%);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #a6b6c5 transparent;
}

:root [data-modals-element="modal"] [data-modals-element="slide-content-inner"]:has(.convertforms) {
  width: min(740px, calc(100vw - 40px)) !important;
  height: auto !important;
  max-height: none !important;
}

:root [data-modals-element="modal"]:has(.convertforms) [data-modals-element="overlay"] {
  background: rgb(14 31 49 / 55%);
  backdrop-filter: blur(4px);
}

@media (max-width: 639px) {
  :root .convertforms {
    --control-gap: 8px !important;
    border-radius: 12px;
  }

  :root .convertforms .cf-form-wrap {
    padding: 22px 20px;
  }

  :root .convertforms .cf-one-half {
    width: 100%;
  }

  :root .convertforms .cf-heading,
  :root .convertforms [data-type="html"]:has(h2, .h2) :is(h2, .h2) {
    font-size: 24px;
  }

  :root .convertforms .cf-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    font-size: 16px;
  }

  :root .convertforms [data-type="submit"] {
    padding-top: 14px;
  }

  :root [data-modals-element="modal"] [data-modals-element="slide-content"]:has(.convertforms) {
    border-radius: 12px;
  }

  :root [data-modals-element="modal"] [data-modals-element="slide-content-inner"]:has(.convertforms) {
    width: calc(100vw - 24px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root .convertforms .cf-btn {
    transition: none;
  }
}
