/* BBULL Forms: isolated service form frontend */

.bbull-forms {
  --bb-forms-primary: var(--primary, #d01920);
  --bb-forms-primary-dark: #a81117;
  --bb-forms-secondary: var(--secondary, #4e6584);
  --bb-forms-text: var(--bb-text, #151b26);
  --bb-forms-muted: var(--bb-text-muted, #5d6675);
  --bb-forms-surface: var(--bb-surface, #fff);
  --bb-forms-surface-muted: var(--bb-surface-muted, #f1f4f8);
  --bb-forms-border: var(--bb-border, #d8dee8);
  --bb-forms-error: #a30f18;
  --bb-forms-focus: #1769aa;
  --bb-forms-radius: var(--bb-radius-card, 22px);
  --bb-forms-font: var(--font-stack, "Manrope", Inter, "Segoe UI", system-ui, -apple-system, sans-serif);
  max-width: 900px;
  margin: 2rem auto;
  color: var(--bb-forms-text);
  font-family: var(--bb-forms-font);
  line-height: 1.55;
}

.bbull-forms *,
.bbull-forms *::before,
.bbull-forms *::after {
  box-sizing: border-box;
}

.bbull-forms [hidden] {
  display: none !important;
}

.bbull-forms__honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bbull-forms__preview,
.bbull-forms__js-required {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid #d29a22;
  border-radius: 10px;
  background: #fff8e8;
  color: #5f4305;
  font-weight: 650;
}

.bbull-forms__result {
  margin: 0 0 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--bb-forms-border);
  border-radius: 10px;
  background: var(--bb-forms-surface-muted);
  font-weight: 650;
}

.bbull-forms__result[data-state="success"] {
  border-color: #2c7a4b;
  background: #edf9f1;
  color: #175c35;
}

.bbull-forms__result[data-state="error"] {
  border-color: var(--bb-forms-error);
  background: #fff1f2;
  color: var(--bb-forms-error);
}

.bbull-forms__header {
  margin-bottom: 1.25rem;
}

.bbull-forms__header h2 {
  margin: .15rem 0 .35rem;
  color: var(--bb-forms-text);
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  line-height: 1.15;
}

.bbull-forms__header p:last-child {
  margin: 0;
  color: var(--bb-forms-muted);
}

.bbull-forms__eyebrow {
  margin: 0;
  color: var(--bb-forms-primary);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.bbull-service-form {
  overflow: hidden;
  border: 1px solid var(--bb-forms-border);
  border-radius: var(--bb-forms-radius);
  background: var(--bb-forms-surface);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .09);
}

.bbull-forms__progress {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bb-forms-border);
  background: var(--bb-forms-surface-muted);
}

.bbull-forms__progress ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bbull-forms__progress li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .55rem;
  color: var(--bb-forms-muted);
  font-size: .84rem;
}

.bbull-forms__progress li > span {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  place-items: center;
  border: 1px solid var(--bb-forms-border);
  border-radius: 50%;
  background: var(--bb-forms-surface);
  font-weight: 800;
}

.bbull-forms__progress li strong {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
}

.bbull-forms__progress li[aria-current="step"] {
  color: var(--bb-forms-text);
}

.bbull-forms__progress li[aria-current="step"] > span {
  border-color: var(--bb-forms-primary);
  background: var(--bb-forms-primary);
  color: #fff;
}

.bbull-forms__progress li.is-complete > span {
  border-color: var(--bb-forms-secondary);
  background: var(--bb-forms-secondary);
  color: #fff;
}

.bbull-forms__step-status {
  margin: 1.25rem 1.5rem 0;
  color: var(--bb-forms-secondary);
  font-weight: 750;
}

.bbull-forms__required-hint {
  margin: .3rem 1.5rem 0;
  color: var(--bb-forms-muted);
  font-size: .9rem;
}

.bbull-forms__step {
  margin: 0;
  padding: 1.35rem 1.5rem 1.5rem;
  border: 0;
}

.bbull-forms__step > legend {
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
}

.bbull-forms__step > legend:focus {
  outline: 2px solid var(--bb-forms-focus);
  outline-offset: 4px;
}

.bbull-forms__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.25rem;
}

.bbull-forms__field {
  min-width: 0;
}

.bbull-forms__field--textarea,
.bbull-forms__field--files,
.bbull-forms__field--checkbox,
.bbull-forms__summary,
.bbull-forms__privacy-link {
  grid-column: 1 / -1;
}

.bbull-forms__field > label:not(.bbull-forms__check) {
  display: block;
  margin: 0 0 .35rem;
  font-weight: 750;
}

.bbull-forms input[type="text"],
.bbull-forms input[type="email"],
.bbull-forms input[type="tel"],
.bbull-forms input[type="file"],
.bbull-forms select,
.bbull-forms textarea {
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: .72rem .8rem;
  border: 1px solid var(--bb-forms-border);
  border-radius: 9px;
  background: var(--bb-forms-surface);
  color: var(--bb-forms-text);
  font: inherit;
}

.bbull-forms textarea {
  min-height: 10rem;
  resize: vertical;
}

.bbull-forms__file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 3rem;
  padding: .55rem;
  border: 1px solid var(--bb-forms-border);
  border-radius: 9px;
  background: var(--bb-forms-surface);
}

.bbull-forms .bbull-forms__file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.bbull-forms__file-button {
  flex-shrink: 0;
  padding: .55rem .75rem;
  border-radius: 7px;
  background: var(--bb-forms-secondary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  pointer-events: none;
}

.bbull-forms__file-selection {
  min-width: 0;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.bbull-forms__file-picker:focus-within {
  outline: 3px solid var(--bb-forms-focus);
  outline-offset: 2px;
}

.bbull-forms [data-validation-state="invalid"] .bbull-forms__file-picker {
  border-color: var(--bb-forms-error);
  box-shadow: 0 0 0 1px var(--bb-forms-error);
}

.bbull-forms input:focus-visible,
.bbull-forms select:focus-visible,
.bbull-forms textarea:focus-visible,
.bbull-forms button:focus-visible,
.bbull-forms a:focus-visible {
  outline: 3px solid var(--bb-forms-focus);
  outline-offset: 2px;
}

.bbull-forms [aria-invalid="true"] {
  border-color: var(--bb-forms-error) !important;
  box-shadow: 0 0 0 1px var(--bb-forms-error);
}

.bbull-forms [data-validation-state="valid"] input[type="text"],
.bbull-forms [data-validation-state="valid"] input[type="email"],
.bbull-forms [data-validation-state="valid"] input[type="tel"],
.bbull-forms [data-validation-state="valid"] input[type="file"],
.bbull-forms [data-validation-state="valid"] .bbull-forms__file-picker,
.bbull-forms [data-validation-state="valid"] select,
.bbull-forms [data-validation-state="valid"] textarea,
.bbull-forms [data-validation-state="valid"] .bbull-forms__check {
  border-color: #27834a;
  box-shadow: 0 0 0 1px #27834a;
}

.bbull-forms__check {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .9rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--bb-forms-surface-muted);
  font-weight: 650;
}

.bbull-forms__check input {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 1.25rem;
  margin: .1rem 0 0;
  accent-color: var(--bb-forms-primary);
}

.bbull-forms__required,
.bbull-forms__error {
  color: var(--bb-forms-error);
}

.bbull-forms__error {
  min-height: 1.25em;
  margin: .28rem 0 0;
  font-size: .88rem;
  font-weight: 650;
}

.bbull-forms__help {
  margin: .35rem 0 0;
  color: var(--bb-forms-muted);
  font-size: .88rem;
}

.bbull-forms__summary {
  margin-top: .25rem;
  padding: 1rem;
  border: 1px solid var(--bb-forms-border);
  border-radius: 12px;
  background: var(--bb-forms-surface-muted);
}

.bbull-forms__summary h3 {
  margin: 0 0 .8rem;
  font-size: 1.1rem;
}

.bbull-forms__summary dl {
  display: grid;
  grid-template-columns: minmax(9rem, .75fr) minmax(0, 1.5fr);
  gap: .45rem 1rem;
  margin: 0;
}

.bbull-forms__summary dt {
  font-weight: 750;
}

.bbull-forms__summary dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.bbull-forms__privacy-link {
  margin: 0;
}

.bbull-forms__privacy-link a {
  color: var(--bb-forms-primary-dark);
  font-weight: 750;
}

.bbull-forms__actions {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--bb-forms-border);
}

.bbull-forms__button {
  min-height: 2.9rem;
  padding: .68rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.bbull-forms__button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.bbull-forms__button--primary {
  margin-left: auto;
  background: var(--bb-forms-primary);
  color: #fff;
}

.bbull-forms__button--primary:hover:not(:disabled) {
  background: var(--bb-forms-primary-dark);
}

.bbull-forms__button--secondary {
  border-color: var(--bb-forms-border);
  background: var(--bb-forms-surface);
  color: var(--bb-forms-text);
}

.bbull-forms__button:disabled {
  border-color: #aeb5bf;
  background: #aeb5bf;
  color: #fff;
  cursor: not-allowed;
  opacity: .72;
}

.bbull-forms__sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 760px) {
  .bbull-forms {
    margin: 1.25rem auto;
  }

  .bbull-forms__progress ol {
    gap: .4rem;
  }

  .bbull-forms__progress li {
    justify-content: center;
  }

  .bbull-forms__progress li strong {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .bbull-forms__fields {
    grid-template-columns: 1fr;
  }

  .bbull-forms__field--textarea,
  .bbull-forms__field--files,
  .bbull-forms__field--checkbox,
  .bbull-forms__summary,
  .bbull-forms__privacy-link {
    grid-column: 1;
  }
}

@media (max-width: 420px) {
  .bbull-forms__progress,
  .bbull-forms__step {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .bbull-forms__step-status,
  .bbull-forms__required-hint {
    margin-right: 1rem;
    margin-left: 1rem;
  }

  .bbull-forms__summary dl {
    grid-template-columns: 1fr;
    gap: .15rem;
  }

  .bbull-forms__summary dd + dt {
    margin-top: .55rem;
  }

  .bbull-forms__actions {
    flex-direction: column-reverse;
  }

  .bbull-forms__button {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bbull-forms__button {
    transition: none;
  }
}
