/* Booking form — the demo form and the real Contact Form 7 form share this
   card; the CF7 field rules are in contact-form-7.css. */

.form {
  display: grid;
  gap: 18px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 36px);

  & h3 {
    margin: 0;
  }
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 640px) {
  .row {
    grid-template-columns: 1fr 1fr;
  }
}

.field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
  margin-bottom: 6px;

  & small {
    color: var(--muted-hi);
    font-weight: 400;
  }
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--text-color);
  background: var(--deep);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8em 0.9em;
  transition: border-color 0.2s, box-shadow 0.2s;

  &:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 25%, transparent);
  }

  &[aria-invalid="true"] {
    border-color: var(--negative-color);
  }
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.err {
  color: color-mix(in srgb, var(--negative-color) 70%, white);
  font-size: 0.82rem;
  margin-top: 6px;

  &:empty {
    display: none;
  }
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--text-soft);

  & input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--accent);
    flex: none;
  }
}

.form__submit {
  justify-self: start;
}

.consent {
  font-size: 0.8rem;
  color: var(--muted-hi);
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  margin: 0;
}

.success {
  display: none;

  & .tick {
    width: 56px;
    height: 56px;
    color: var(--accent);

    & path {
      stroke-dasharray: 60;
      stroke-dashoffset: 60;
      animation: tickdraw 0.8s 0.2s var(--ease) forwards;
    }
  }
}

.form.done > :not(.success) {
  display: none;
}

.form.done .success {
  display: block;
}

@keyframes tickdraw {
  to {
    stroke-dashoffset: 0;
  }
}
