/* Form cards (contact and quote): thin blue, violet and magenta light travelling around the edge, a soft
 * ambient glow, calmer focus states and a moving gradient on the submit button.
 * The light is a conic gradient on a square that rotates (transform only), seen through a 1.5px ring mask,
 * so nothing is repainted per frame. Reduced motion: the ring stays still, the glow does not breathe.
 * The card's content, validation and submission are untouched; the ring sits behind it and ignores the pointer. */
.fm-form-card { position: relative; isolation: isolate; }
.fm-energy {
  position: absolute; inset: -1px; z-index: 0; pointer-events: none;
  border-radius: inherit; padding: 1.5px; overflow: hidden;
  container-type: size;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.fm-energy i {
  position: absolute; left: 50%; top: 50%;
  width: calc(max(100cqw, 100cqh) * 1.5); aspect-ratio: 1;
  translate: -50% -50%;
  background: conic-gradient(
    rgb(var(--fm-navy-rgb) / 0.08) 0deg,
    rgb(var(--fm-navy-rgb) / 0.08) 20deg,
    #086BFF 70deg, #6727E8 105deg, #C326D9 130deg,
    rgb(var(--fm-navy-rgb) / 0.08) 150deg,
    rgb(var(--fm-navy-rgb) / 0.08) 200deg,
    #6727E8 250deg, #8B5CFF 280deg, #086BFF 310deg,
    rgb(var(--fm-navy-rgb) / 0.08) 330deg);
}
/* Ambient glow under the card. */
.fm-form-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: radial-gradient(60% 60% at 25% 30%, rgb(var(--fm-blue-rgb) / 0.16), transparent 70%),
              radial-gradient(60% 60% at 80% 75%, rgb(var(--fm-magenta-rgb) / 0.12), transparent 70%);
  filter: blur(36px); opacity: 0.7;
}
@media (min-width: 768px) { .fm-form-card::before { inset: -20px; } }   /* phones: no room outside the card */
.fm-form-card > :not(.fm-energy) { position: relative; z-index: 1; }
/* Consultation bands that carry the same light (home, How It Works, Our Work). */
.fm-cta-band:has(> .fm-energy) { position: relative; isolation: isolate; overflow: hidden; border: 0; border-radius: 28px; }
.fm-cta-band:has(> .fm-energy) > :not(.fm-energy) { position: relative; z-index: 1; }

/* Fields: the label picks up the violet, the field brightens, the ring eases in. */
.fm-form-card .fm-label { transition: color var(--fm-dur) var(--fm-ease); }
.fm-form-card .fm-field:focus-within > .fm-label { color: var(--fm-violet); }
.fm .fm-form-card :is(.fm-input, .fm-select, .fm-textarea):focus-visible {
  border-color: var(--fm-violet); background-color: #fff;
  box-shadow: 0 0 0 4px rgb(var(--fm-violet-rgb) / 0.14), 0 10px 24px -14px rgb(var(--fm-blue-rgb) / 0.5);
}
.fm-form-card :is(.fm-input, .fm-select, .fm-textarea)[aria-invalid="true"]:focus-visible {
  border-color: #C4123A; box-shadow: 0 0 0 4px rgb(196 18 58 / 0.14);
}

/* Submit: the gradient is twice as wide and slides to its magenta end on hover or focus. */
.fm-form-card .fm-btn--brand[type="submit"] {
  background-image: linear-gradient(90deg, var(--fm-blue) 0%, var(--fm-violet) 25%, var(--fm-magenta) 45%, #C4123F 60%, var(--fm-magenta) 78%, var(--fm-violet) 100%);
  background-size: 200% 100%; background-position: 0% 0;
  transition: background-position 700ms var(--fm-ease), box-shadow 320ms var(--fm-ease), transform 320ms var(--fm-ease);
}
.fm-form-card .fm-btn--brand[type="submit"]:is(:hover, :focus-visible):not(:disabled) { background-position: 100% 0; }

@media (prefers-reduced-motion: no-preference) {
  .fm-energy i { animation: fm-energy-spin 7s linear infinite; }
  .fm-form-card::before { animation: fm-energy-breathe 5s ease-in-out infinite alternate; }
  @keyframes fm-energy-spin { to { rotate: 1turn; } }
  @keyframes fm-energy-breathe { from { opacity: 0.45; } to { opacity: 0.9; } }
}
@media (prefers-reduced-motion: reduce) {
  .fm-energy i { rotate: 35deg; }
  .fm-form-card .fm-btn--brand[type="submit"] { transition: none; }
}
@media (forced-colors: active) { .fm-energy, .fm-form-card::before { display: none; } }
