/* Default form CSS. Values from del/resource-post-type/mockup/single-resource.html.
   Resources → Settings → Form style can replace this whole file with an edited copy.
   Two-class selectors: the kit styles every `.elementor-kit-7 button` as a pill. */

.rdm-form {
  --rdm-deep-blue: #245db3;
  --rdm-ink: #0f182b;
  --rdm-text: #111827;
  --rdm-label: #374151;
  --rdm-muted: #6b7280;
  --rdm-placeholder: #9ca3af;
  --rdm-border: #e6e6e6;
  --rdm-surface: #ffffff;
}

/* Everything from the template sits in this grid, so vertical spacing is the gap. */
.rdm-form .rdm-form__fields {
  display: grid;
  gap: 13px;
}

.rdm-form .rdm-form__label {
  display: block;
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: var(--rdm-label);
}

.rdm-form .rdm-form__input {
  display: block;
  width: 100%;
  height: 41px;
  margin: 7px 0 0;
  padding: 0 15px;
  border: 1px solid var(--rdm-border);
  border-radius: 6px;
  background: var(--rdm-surface);
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  color: var(--rdm-text);
}
.rdm-form .rdm-form__input::placeholder {
  color: var(--rdm-placeholder);
}
.rdm-form .rdm-form__input:focus {
  outline: none;
  border-color: var(--rdm-deep-blue);
}

/* Button: 24px below the field above (11px margin + 13px grid gap). */
.rdm-form .rdm-form__submit,
.rdm-form .rdm-form__submit:visited,
.rdm-form .rdm-form__submit:hover,
.rdm-form .rdm-form__submit:focus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 11px 0 0;
  padding: 17px 24px;
  border: 0;
  border-radius: 8px;
  background: var(--rdm-deep-blue);
  font: inherit;
  font-size: 16px;
  line-height: 17px;
  font-weight: 700;
  color: var(--rdm-surface);
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.rdm-form .rdm-form__submit:hover {
  filter: brightness(0.95);
}
.rdm-form .rdm-form__submit:focus-visible {
  outline: 2px solid var(--rdm-deep-blue);
  outline-offset: 2px;
}
.rdm-form .rdm-form__submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Consent: not in Figma; small muted text 16px under the field above (3px + 13px gap). */
.rdm-form .rdm-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 17px;
  font-weight: 400;
  color: var(--rdm-muted);
}
.rdm-form .rdm-form__consent input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--rdm-deep-blue);
}
.rdm-form .rdm-form__consent-body {
  display: block;
}
.rdm-form .rdm-form__consent-agree {
  font-weight: 600;
  color: var(--rdm-label);
  cursor: pointer;
}

.rdm-form .rdm-form__consent a,
.rdm-form .rdm-form__consent a:visited {
  color: var(--rdm-deep-blue);
  text-decoration: underline;
}
.rdm-form .rdm-form__consent a:hover,
.rdm-form .rdm-form__consent a:focus-visible {
  color: var(--rdm-ink);
}

/* <div class="rdm-row"> in the template: fields side by side on every screen. */
.rdm-form .rdm-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 13px 10px;
}

/* [consent-without-checkbox]: the same text, no checkbox to click. */
.rdm-form .rdm-form__consent--text {
  display: block;
  cursor: auto;
}

/* ---- Effects (del/resource-post-type/mockup/form-effects.html) ---- */

/* Input focus: border eases in + faint brand-blue ring. */
.rdm-form .rdm-form__input {
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.rdm-form .rdm-form__input:focus {
  box-shadow: 0 0 0 3px rgba(36, 93, 179, 0.12);
}

/* Button: smooth hover, 1px press. */
.rdm-form .rdm-form__submit {
  transition: filter 150ms ease, transform 100ms ease, opacity 150ms ease;
}
.rdm-form .rdm-form__submit:active {
  transform: translateY(1px);
}

/* Submitting: spinner in the button, same size. */
.rdm-form .rdm-form__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: rdm-spin 700ms linear infinite;
}
@keyframes rdm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* System error line under the button; field mistakes under the field. */
@keyframes rdm-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rdm-form .rdm-form__error,
.rdm-form .rdm-form__field-error {
  margin: 0;
  font-size: 12px;
  line-height: 17px;
  color: #b42318;
  animation: rdm-in 220ms ease-out;
}
/* Static error row: inside .rdm-form__field it sits 6px under the input; after the consent label
   it is a grid item, so pull it up by part of the gap. Empty = takes no space. */
.rdm-form .rdm-form__field-error {
  margin-top: 6px;
}
.rdm-form .rdm-form__consent + .rdm-form__field-error {
  margin-top: -7px;
}
.rdm-form .rdm-form__field-error:empty {
  display: none;
}
.rdm-form .rdm-form__error[hidden] {
  display: none;
}
.rdm-form .rdm-form__input[aria-invalid="true"] {
  border-color: #b42318;
}

@media (prefers-reduced-motion: reduce) {
  .rdm-form * {
    transition: none !important;
    animation: none !important;
  }
}

/* The download-token field: in the form for HubSpot, never visible or focusable. */
.rdm-form .rdm-form__token {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Shown in place of the form when the resource has no usable download file.
   Not inside .rdm-form, so it cannot use the variables above — colour is literal.
   Two selectors so the theme's own `p` rules do not win. */
p.rdm-form__unavailable {
  max-width: 420px;
  margin: 0 auto;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  color: #6b7280;
}

/* [checkbox name "Label"]: a plain tick box, e.g. the HubSpot email opt-in. */
.rdm-form .rdm-form__check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0 0;
}
.rdm-form .rdm-form__check input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--rdm-deep-blue);
}
.rdm-form .rdm-form__check-label {
  font-size: 13px;
  line-height: 18px;
  color: var(--rdm-muted);
  cursor: pointer;
}

/* "Check again" on the unavailable notice: forgets the day-long verdict and asks HubSpot once more. */
.rdm-form__recheck {
	white-space: nowrap;
}

/* Flow 1 only: the page stays, so the form says the file is on its way. */
.rdm-form .rdm-form__done {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: #1a6b43;
  animation: rdm-in 220ms ease-out;
}
.rdm-form .rdm-form__done[hidden] {
  display: none;
}

/* Settings → Form text can switch the motion off; the form behaves exactly the same without it. */
.rdm-form--no-fade .rdm-form__error,
.rdm-form--no-fade .rdm-form__field-error,
.rdm-form--no-fade .rdm-form__done {
  animation: none;
}
