/* ---------------------------------------------------------------------
 * Love Local Long Island — listing EDIT form
 *
 * Standalone rather than reusing submit-form.css. That file carries a lot
 * of submit-page-specific surgery — the rebuilt business hours, the
 * unified uploaders, the suppressed theme popup, the centred submit
 * column. Loading it here would restyle a form that is already working,
 * for the sake of about thirty lines. These rules are copied instead.
 *
 * The selectors still key off #lp-submit-form because ListingPro gives
 * the edit form the same id as the submission form.
 * ------------------------------------------------------------------ */

#lp-submit-form .llli-agree {
  margin: 16px 0 !important;
  padding: 14px 16px;
  border: 1px solid #e4e4e4;
  border-radius: 6px;
  background: #fafafa;
  text-align: left;
  float: none;
  clear: both;
}

#lp-submit-form .llli-agree-label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0;
  float: none !important;
  max-width: none !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: #4a4a4a;
  cursor: pointer;
  white-space: normal;
}

#lp-submit-form .llli-agree-label input[type="checkbox"] {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
  cursor: pointer;
}

#lp-submit-form .llli-agree.llli-agree-error {
  border-color: #bf3333;
  background: #fdf1f1;
}

#lp-submit-form .llli-field-error {
  color: #bf3333;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  margin: 6px 0 0;
}

/* ---------------------------------------------------------------------
 * The Update & Resubmit button
 *
 * The theme sizes this button from a fixed width written for the shorter
 * "Submit" label, so "Update & Resubmit Your Listing" ran straight off
 * the right edge and was cut in half. Sizing it from its own content
 * fixes it at every label length rather than for this one string.
 * ------------------------------------------------------------------ */
#lp-submit-form .submitbutton-wraper input[type="submit"],
#lp-submit-form input[type="submit"][name="listingedit"] {
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: auto;
  padding: 16px 38px;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* The wrapper is what the button is centred in; let it span the row. */
#lp-submit-form .submitbutton-wraper {
  width: 100%;
  max-width: 100%;
  text-align: center;
}

@media (max-width: 768px) {
  #lp-submit-form .submitbutton-wraper input[type="submit"],
  #lp-submit-form input[type="submit"][name="listingedit"] {
    padding: 15px 20px;
    font-size: 15px;
  }
}

/* ---------------------------------------------------------------------
 * Submit spinner
 *
 * Drawn from a border, not an icon font, so it cannot vanish because
 * Font Awesome failed to load or the theme renamed a class. It sits
 * inside the button's right padding, which is widened while it shows so
 * it never lands on top of the label.
 * ------------------------------------------------------------------ */
#lp-submit-form .submitbutton-wraper {
  position: relative;
}

#lp-submit-form .submitbutton-wraper .llli-spinner {
  display: none;
}

#lp-submit-form .submitbutton-wraper.llli-submitting .llli-spinner {
  display: inline-block;
  width: 17px;
  height: 17px;
  margin-left: -34px;
  vertical-align: middle;
  position: relative;
  z-index: 2;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: llli-spin 0.7s linear infinite;
}

#lp-submit-form .submitbutton-wraper.llli-submitting input[type="submit"] {
  padding-right: 52px;
  cursor: progress;
}

@keyframes llli-spin {
  to { transform: rotate(360deg); }
}

/* Respect a reduced-motion preference: still clearly "busy", no spin. */
@media (prefers-reduced-motion: reduce) {
  #lp-submit-form .submitbutton-wraper.llli-submitting .llli-spinner {
    animation: none;
    border-top-color: rgba(255, 255, 255, 0.4);
    opacity: 0.8;
  }
}
