/*
 * CSS-only floating labels.
 *
 * On the live C5 site the `.animate_lbl` class was toggled by spam-protection-2023.js
 * (removed with the form jQuery in the native-forms migration). Without a replacement,
 * every label sits on top of the typed value. This reproduces the theme's own floated
 * declarations (copied verbatim from atf.css) using pure CSS.
 *
 * These themes render <label> BEFORE the control, so the label is a *preceding* sibling
 * — the `~` combinator can't reach it. `:has()` on the wrapper is required. Every input
 * inside a `.anim_lbl` also carries placeholder=" " so `:not(:placeholder-shown)` only
 * matches once the field has a value (LeadForm / PDF wrappers set it; see the note below
 * for the legacy converted bodies).
 *
 * <select> is intentionally skipped: in this theme a select's `.anim_lbl` has no <label>
 * (the disabled first <option> is the label), so it never floated.
 */

/* Focused, or holding a value → float (base rule from atf.css) */
.anim_lbl:has(input:focus) label,
.anim_lbl:has(input:not(:placeholder-shown)) label,
.anim_lbl:has(textarea:focus) label,
.anim_lbl:has(textarea:not(:placeholder-shown)) label {
  -webkit-transform: translateY(-185%) scale(0.75);
  transform: translateY(-185%) scale(0.75);
  background-color: #5DA5DF;
  z-index: 4;
}

/* Textarea variant */
.anim_lbl:has(textarea:focus) label.lbl_txtara,
.anim_lbl:has(textarea:not(:placeholder-shown)) label.lbl_txtara {
  -webkit-transform: translateY(-22px) scale(0.75);
  transform: translateY(-22px) scale(0.75);
}

/* Context override: forms-2023 background */
.forms-2023 .anim_lbl:has(input:focus) label,
.forms-2023 .anim_lbl:has(input:not(:placeholder-shown)) label,
.forms-2023 .anim_lbl:has(textarea:focus) label,
.forms-2023 .anim_lbl:has(textarea:not(:placeholder-shown)) label {
  background-color: #FDAF1B !important;
}

/* Context override: generic-form-2023 background */
.generic-form-2023 .anim_lbl:has(input:focus) label,
.generic-form-2023 .anim_lbl:has(input:not(:placeholder-shown)) label,
.generic-form-2023 .anim_lbl:has(textarea:focus) label,
.generic-form-2023 .anim_lbl:has(textarea:not(:placeholder-shown)) label {
  background-color: #fff !important;
  color: black;
}

/* Context override: upload boxes float a little higher */
.upload-sec .anim_lbl:has(input:focus) label,
.upload-sec .anim_lbl:has(input:not(:placeholder-shown)) label,
.upload-img-box .anim_lbl:has(input:focus) label,
.upload-img-box .anim_lbl:has(input:not(:placeholder-shown)) label {
  -webkit-transform: translateY(-250%) scale(0.75);
  transform: translateY(-250%) scale(0.75);
}
