/**
 * Front-end styles.
 *
 * Deliberately quiet: a form should inherit the theme's typography and colour,
 * not fight it. What we style is layout, spacing and the states a theme rarely
 * covers — errors, the honeypot, the step indicator.
 */

.lynbro-form-wrap {
  --lynbro-brand: #1a7f5a;
  --lynbro-line: #e2ebe6;
  --lynbro-error: #c8102e;
  margin: 0 0 1.5em;
}

.lynbro-form {
  display: block;
}

/* The honeypot must be unreachable for people and plausible for robots:
   off-screen rather than display:none, which some bots skip. */
.lynbro-forms-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lynbro-form-note {
  font-size: 0.875em;
  opacity: 0.75;
  margin: 0 0 1em;
}

.lynbro-field {
  margin: 0 0 1.15em;
}

.lynbro-field[hidden] {
  display: none;
}

.lynbro-field-label {
  display: block;
  font-weight: 600;
  margin: 0 0 0.35em;
}

.lynbro-field .lynbro-req {
  color: var(--lynbro-error);
}

.lynbro-field input[type="text"],
.lynbro-field input[type="email"],
.lynbro-field input[type="tel"],
.lynbro-field input[type="url"],
.lynbro-field input[type="number"],
.lynbro-field input[type="date"],
.lynbro-field input[type="time"],
.lynbro-field input[type="file"],
.lynbro-field select,
.lynbro-field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.lynbro-field-desc,
.lynbro-field-hint {
  font-size: 0.85em;
  opacity: 0.75;
  margin: 0.35em 0 0;
}

.lynbro-field-error {
  color: var(--lynbro-error);
  font-size: 0.875em;
  margin: 0.35em 0 0;
}

.lynbro-field.has-error input,
.lynbro-field.has-error select,
.lynbro-field.has-error textarea {
  border-color: var(--lynbro-error);
}

.lynbro-choices {
  display: grid;
  gap: 0.4em;
}

.lynbro-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  font-weight: 400;
}

.lynbro-choice input {
  margin-top: 0.25em;
  flex: 0 0 auto;
}

.lynbro-field-heading {
  margin: 1.5em 0 0.5em;
}

.lynbro-field-divider {
  border: 0;
  border-top: 1px solid var(--lynbro-line);
  margin: 1.5em 0;
}

.lynbro-form-actions {
  display: flex;
  gap: 0.6em;
  flex-wrap: wrap;
  margin-top: 1.2em;
}

.lynbro-form-notice {
  padding: 0.9em 1.1em;
  border-radius: 6px;
  border: 1px solid var(--lynbro-line);
  margin: 0 0 1.2em;
}

.lynbro-form-notice.is-success {
  border-color: var(--lynbro-brand);
  background: #f3f8f5;
}

.lynbro-form-notice.is-error {
  border-color: var(--lynbro-error);
  background: #fdf2f4;
}

/* Two- and three-column rows, when the theme gives us the width for them. */
@media (min-width: 600px) {
  .lynbro-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.2em;
  }

  .lynbro-form > *,
  .lynbro-form-step {
    flex: 0 0 100%;
  }

  .lynbro-form-step {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.2em;
  }

  .lynbro-form-step > .lynbro-field.is-full,
  .lynbro-form-step > .lynbro-form-actions {
    flex: 0 0 100%;
  }

  .lynbro-form-step > .lynbro-field.is-half {
    flex: 1 1 calc(50% - 0.6em);
  }

  .lynbro-form-step > .lynbro-field.is-third {
    flex: 1 1 calc(33.333% - 0.8em);
  }
}

/* Step indicator */
.lynbro-form-progress {
  margin: 0 0 1.4em;
}

.lynbro-form-progress.is-steps {
  display: flex;
  gap: 0.5em;
  list-style: none;
  padding: 0;
  counter-reset: none;
}

.lynbro-form-progress.is-steps li {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 2px;
  background: var(--lynbro-line);
}

.lynbro-form-progress.is-steps li.is-active {
  background: var(--lynbro-brand);
}

.lynbro-form-progress.is-steps li span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.lynbro-form-progress .bar {
  height: 6px;
  border-radius: 3px;
  background: var(--lynbro-line);
  overflow: hidden;
}

.lynbro-form-progress .bar span {
  display: block;
  height: 100%;
  background: var(--lynbro-brand);
  transition: width 0.25s ease;
}

.lynbro-form-progress .label {
  font-size: 0.85em;
  opacity: 0.75;
  margin: 0.4em 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .lynbro-form-progress .bar span {
    transition: none;
  }
}
