/*--------------------------------------------------------------
  Forms — inputs, selects, textareas, validation states, star rating
--------------------------------------------------------------*/

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: var(--space-2);
}

.form-control,
.form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--color-heading);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--t), box-shadow var(--t);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.12);
}

.form-control::placeholder {
  color: var(--color-muted);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-small);
  color: var(--color-text);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Screen-reader-only text (kept out of the visual flow) */
.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;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.form-optional {
  font-weight: 400;
  color: var(--color-muted);
}

/* Review form (testimonials page) */
.review-form {
  padding: var(--space-8);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.review-form .form-check {
  align-items: flex-start;
  margin: var(--space-5) 0 var(--space-6);
}

.review-form .form-check input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

/* Star rating — CSS-only, driven by radio inputs.
   Reversed row order lets `~` style every star to the left of the
   hovered/checked one. */
.star-rating {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-6);
}

.star-rating legend {
  padding: 0;
  margin-bottom: var(--space-2);
}

.star-rating__stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: var(--space-1);
}

.star-rating input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.star-rating label {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-border);
  cursor: pointer;
  transition: color var(--t), transform var(--t);
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: var(--color-accent);
}

.star-rating label:hover {
  transform: scale(1.15);
}

.star-rating input:focus-visible + label {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.star-rating.is-invalid label {
  color: var(--color-danger);
}

input[type="checkbox"][aria-invalid="true"] {
  outline: 2px solid var(--color-danger);
  outline-offset: 2px;
}

.input-icon {
  position: relative;
}

.input-icon i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
}

.input-icon .form-control {
  padding-left: 2.75rem;
}

/* --- Anti-spam honeypot ---------------------------------------------
   Clipped to nothing rather than display:none, because some bots skip
   hidden inputs but happily fill anything that is in the DOM. Clipping
   is used instead of a negative offset so the field can never affect
   the document width. */
.hp-field {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
