/* Shared form-interaction kit (form-interaction-convention.md): required marker, completion meter,
   and submit-button disabled/spinner states. Surface-agnostic - each token falls back from the
   app's --lvxd-* to the Storefront's --lvxd-sf-*, same fallback chain as lvxd-shared.css. No new
   colours. */

/* ---- Rule 1: required marker ---- */
.lvxd-req {
  display: inline-block;
  margin-left: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--lvxd-accent, var(--lvxd-sf-accent));
  vertical-align: middle;
}

/* ---- Rule 3: completion meter ---- */
.lvxd-fp {
  margin: 0 0 20px;
}

.lvxd-fp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.lvxd-fp-heading {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--lvxd-text, var(--lvxd-sf-text));
}

.lvxd-fp-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--lvxd-text-muted, var(--lvxd-sf-text-muted));
}

.lvxd-fp-track {
  height: 7px;
  border-radius: 99px;
  background: var(--lvxd-surface-muted, var(--lvxd-sf-surface-tint));
  overflow: hidden;
}

.lvxd-fp-bar {
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--lvxd-accent, var(--lvxd-sf-accent));
  transition: width .28s cubic-bezier(.4, 0, .2, 1);
}

/* Opt-in (FormProgressViewModel.HideWhenComplete): the meter is the Rule 7 "why is the button
   inert" signal, so it only needs to be on screen while something is still outstanding. lvxd-form.js
   sets .is-complete when every required field validates. JS-off never adds the class, so the meter
   stays visible - which is right, because JS-off never disables the button either. */
.lvxd-fp-hide-done.is-complete {
  display: none;
}

.lvxd-fp.is-complete .lvxd-fp-bar {
  background: var(--lvxd-success-border, var(--lvxd-sf-success, var(--lvxd-accent, var(--lvxd-sf-accent))));
}

.lvxd-fp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.lvxd-fp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--lvxd-text-muted, var(--lvxd-sf-text-muted));
  background: var(--lvxd-surface-muted, var(--lvxd-sf-surface-tint));
  border: 1px solid var(--lvxd-border, var(--lvxd-sf-border));
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.lvxd-fp-pill::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 99px;
  border: 1.5px solid var(--lvxd-border, var(--lvxd-sf-border));
  background: transparent;
  transition: background .2s ease, border-color .2s ease;
}

.lvxd-fp-pill.is-done {
  color: var(--lvxd-accent, var(--lvxd-sf-accent));
  border-color: var(--lvxd-accent, var(--lvxd-sf-accent));
  background: var(--lvxd-accent-soft, var(--lvxd-sf-accent-soft));
}

.lvxd-fp-pill.is-done::before {
  background: var(--lvxd-accent, var(--lvxd-sf-accent));
  border-color: var(--lvxd-accent, var(--lvxd-sf-accent));
  /* checkmark */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}

.lvxd-fp-compact .lvxd-fp-head {
  margin-bottom: 0;
}

/* ---- Rules 4-5: submit button disabled + spinner ---- */
.lvxd-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.lvxd-submit[disabled],
.lvxd-submit[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
}

.lvxd-submit-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 99px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  animation: lvxd-submit-spin .6s linear infinite;
}

.lvxd-submit[aria-busy="true"] .lvxd-submit-spinner {
  display: inline-block;
}

@keyframes lvxd-submit-spin {
  to { transform: rotate(360deg); }
}

/* ---- Rule 11: reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .lvxd-fp-bar,
  .lvxd-fp-pill,
  .lvxd-fp-pill::before {
    transition: none;
  }
  .lvxd-submit-spinner {
    animation-duration: 1.4s;
  }
}

/* Layout-agnostic visually-hidden utility (2026-07-31). The two that existed were scoped to one
   surface each - .lvxd-hub-sidebar-sr-only and .lvxd-sf-sr-only - so a shared field partial had
   nothing neutral to reach for when a control needs a label for assistive tech but not on screen.
   Lives here because this file is the only stylesheet loaded by BOTH layouts. */
.lvxd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
