/*
 * Lead form and calculator styles (group G1, contract C8).
 * Used by public/js/lead-forms.js, forms/partials/privacy-notice,
 * forms/show, forms/thanks and the loft cost calculator.
 * Colours come from the site's own CSS variables in app.css.
 */

/* Privacy notice under every submit button */
.lead-privacy-notice {
  margin: 12px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-dim);
  text-align: center;
}

.lead-privacy-notice a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* Inline feedback box inserted at the top of the form */
.lead-feedback {
  margin: 0 0 18px;
}

.lead-feedback ul {
  margin: 8px 0 0;
  padding-left: 20px;
  list-style: disc;
}

.lead-feedback a,
.lead-success a {
  font-weight: 700;
  text-decoration: underline;
}

.lead-feedback:focus,
.lead-success:focus,
.lead-thanks:focus,
.calc-lead-feedback:focus,
.calc-lead-success:focus {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 3px;
}

/* lead-forms.js hides boxes and the sent form with the hidden attribute.
   Keep them hidden even if a utility class sets a display value. */
[data-lead-form][hidden],
[data-lead-feedback][hidden],
.lead-success[hidden],
.neo-errors[hidden],
.neo-alert[hidden] {
  display: none !important;
}

/* Error under a single field */
.lead-field-error {
  margin: 6px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  color: #f87171;
}

html[data-theme="light"] .lead-field-error {
  color: #991b1b;
}

[data-lead-form] [aria-invalid="true"],
#calc-lead-form [aria-invalid="true"] {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25);
}

/* Sending state */
[data-lead-form].lead-sending button[type="submit"],
[data-lead-form].lead-sending button:not([type]) {
  opacity: 0.75;
  cursor: progress;
}

/* Success panel that replaces the form */
.lead-success {
  text-align: center;
  line-height: 1.6;
}

/* Thank you page */
.lead-thanks {
  padding: clamp(24px, 5vw, 44px);
}

.lead-thanks a {
  color: var(--text-main);
}

.lead-secondary-button {
  background: transparent;
  border: 1px solid var(--border);
}

.lead-secondary-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Loft calculator lead step */
.calc-lead-feedback,
.calc-lead-success {
  margin: 0 0 16px;
  line-height: 1.6;
}

.calc-lead-feedback[hidden],
.calc-lead-success[hidden],
#calc-lead-form[hidden] {
  display: none !important;
}

.calc-optional {
  font-weight: 500;
  color: var(--text-dim);
}

#calc-lead-form .lead-privacy-notice {
  text-align: left;
}

@media (max-width: 640px) {
  .lead-privacy-notice {
    text-align: left;
  }
}
