/* visit-form.base.css (Lagrange Software): structure and accessibility only.
   No colours, no fonts, no decoration beyond what makes it usable unskinned. Skin it in the site's own CSS. */
.vf {
  --vf-gap: 2rem;            /* between the five groups */
  --vf-space: .75rem;        /* inside a group */
  --vf-radius: .5rem;        /* inputs, chips, button */
  --vf-border: 1px;          /* border width of inputs and chips */
  --vf-control-h: 3rem;      /* inputs and the button */
  --vf-chip-h: 2.75rem;      /* 44 px tap target */
  --vf-focus: 3px solid;     /* focus ring (add a colour in a skin: 3px solid #000) */
  --vf-focus-offset: 2px;
  --vf-scroll-margin: 1rem;  /* raise to clear a sticky header */
  position: relative;
}
.vf [hidden] { display: none !important; }
.vf-form, .vf-sent, .vf-group { scroll-margin-top: var(--vf-scroll-margin); }
.vf-form { margin: 0; }
.vf-sent:focus { outline: none; }
.vf-sent:focus-visible { outline: var(--vf-focus); outline-offset: var(--vf-focus-offset); }

/* groups and questions */
.vf-group, .vf-sub { border: 0; margin: 0; padding: 0; min-width: 0; }
.vf-group + .vf-group { margin-top: var(--vf-gap); }
.vf-sub { margin-top: calc(var(--vf-space) * 1.5); }
.vf-q, .vf-subq { display: block; padding: 0; margin: 0 0 .35rem; font-weight: 700; }
.vf-q { font-size: 1.25em; line-height: 1.25; }
.vf-hint { margin: 0 0 var(--vf-space); }
.vf-label { display: block; margin: 0 0 .3rem; font-weight: 600; }
.vf-opt { font-weight: 400; }
.vf-field { min-width: 0; }
.vf-field + .vf-field, .vf-row + .vf-row, .vf-row + .vf-field, .vf-field + .vf-sub { margin-top: var(--vf-space); }
.vf-row { display: grid; gap: var(--vf-space); align-items: end; }
.vf-row--vehicle { grid-template-columns: 6.5em 1fr 1fr; }
.vf-row--plate { grid-template-columns: 1fr 1fr; margin-top: var(--vf-space); }
.vf-hint--after { margin: .35rem 0 0; }
@media (max-width: 30em) {   /* phones: Year and Make share a line, Model takes the next one whole */
  .vf-row--vehicle { grid-template-columns: 6.5em 1fr; }
  .vf-row--vehicle > .vf-field:last-child { grid-column: 1 / -1; }
}
.vf-row > .vf-field + .vf-field { margin-top: 0; }
.vf-reveal { margin-top: var(--vf-space); }

/* inputs: 16 px or larger, so phones do not zoom */
.vf-input {
  box-sizing: border-box; display: block; width: 100%; min-height: var(--vf-control-h); margin: 0;
  padding: .55rem .75rem; font: inherit; font-size: max(16px, 1em); line-height: 1.3; color: inherit;
  border: var(--vf-border) solid; border-radius: var(--vf-radius);
}
textarea.vf-input { min-height: 5.5rem; resize: vertical; }
.vf-input[aria-invalid="true"] { border-width: calc(var(--vf-border) + 2px); }
.vf-input:focus-visible, .vf-submit:focus-visible, .vf a:focus-visible {
  outline: var(--vf-focus); outline-offset: var(--vf-focus-offset);
}
.vf-error { margin: .35rem 0 0; font-weight: 700; }
.vf-hint + .vf-error { margin: calc(var(--vf-space) * -.5) 0 var(--vf-space); }   /* the first group's message, above its chips */
.vf a[href^="tel:"] { white-space: nowrap; }

/* chips: real checkboxes and radios underneath */
.vf-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
.vf-chip { position: relative; display: inline-flex; }
.vf-chip-input {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.vf-chip-label {
  box-sizing: border-box; display: inline-flex; align-items: center; gap: .5em; min-height: var(--vf-chip-h);
  padding: .45rem .9rem; border: var(--vf-border) solid; border-radius: var(--vf-radius);
  line-height: 1.2; user-select: none; -webkit-user-select: none;
}
.vf-chip-label::before {
  content: ""; flex: none; box-sizing: border-box; width: 1em; height: 1em;
  border: 2px solid; border-radius: .2em;
}
.vf-chip-input[type="radio"] + .vf-chip-label::before { border-radius: 50%; }
.vf-chip-input:checked + .vf-chip-label { box-shadow: inset 0 0 0 1px; }
.vf-chip-input:checked + .vf-chip-label::before { background: currentColor; }
.vf-chip-input:focus-visible + .vf-chip-label { outline: var(--vf-focus); outline-offset: var(--vf-focus-offset); }
[data-vf-group="needs"][aria-invalid="true"] .vf-chip-label { border-style: dashed; }

/* send */
.vf-actions { margin-top: var(--vf-gap); }
.vf-submit {
  box-sizing: border-box; display: block; width: 100%; min-height: var(--vf-control-h); margin: 0;
  padding: .7rem 1.5rem; font: inherit; font-size: max(16px, 1em); font-weight: 700;
  border: var(--vf-border) solid; border-radius: var(--vf-radius); cursor: pointer;
}
.vf-submit:disabled { cursor: progress; }
.vf-status:empty { margin: 0; }
.vf-status, .vf-failed { margin: 0 0 var(--vf-space); }
.vf-failed { font-weight: 700; }
.vf-note, .vf-privacy { margin: var(--vf-space) 0 0; }
@media (min-width: 40em) { .vf-submit { display: inline-block; width: auto; min-width: 14rem; } }

/* sent */
.vf-sent-title { margin: 0 0 var(--vf-space); }
.vf-summary { margin: var(--vf-space) 0; }
.vf-summary dt { font-weight: 700; }
.vf-summary dd { margin: 0 0 .5rem; }
@media (min-width: 40em) {
  .vf-summary { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.25rem; }
  .vf-summary dd { margin: 0; }
}

/* helpers */
.vf-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (forced-colors: active) {
  .vf-chip-input:checked + .vf-chip-label::before { forced-color-adjust: none; background: CanvasText; }
  .vf-chip-input:checked + .vf-chip-label { border-width: 3px; }
}
@media (prefers-reduced-motion: reduce) { .vf * { transition: none !important; animation: none !important; } }
