/* Standalone forms (public form page + embed). Kailah, Oct 2026. */
.kform-wrap { max-width: 760px; margin: 0 auto; padding: 40px 16px 64px; }
.kform-card { --kform-accent-fallback: var(--theme-color, #0997d9); background: #fff; border: 1px solid #e6e8ec; border-radius: 16px; padding: 32px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.kform-title { font-size: 1.75rem; line-height: 1.25; margin: 0 0 8px; }
.kform-desc { color: #4b5563; margin-bottom: 24px; white-space: normal; }
/* A field is a flex column so the error message can be ORDERED directly
   under its input, whatever order the markup emits things in. The error is
   appended last for every field type (see kform_render_field), which on a
   field with a character counter left the counter sitting between the input
   and its error — so the message appeared ~20px below the field, right-
   aligned counter above it and the next field just beneath, and read as
   belonging to the field BELOW. */
.kform-field {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  /* A flex column stretches its children to full width, which would defeat
     the shrink-to-fit on the scale group and the capped widths on phone /
     date / number / file. flex-start keeps every child at its own width. */
  align-items: flex-start;
}
/* Everything keeps its source order except these two: the error moves up to
   sit against its input, and the counter drops below it. */
.kform-field > .kform-error { order: 1; }
.kform-field > .kform-count { order: 2; }
/* ...except the controls that fill the row: with align-items:flex-start a
   bare input would otherwise shrink to its intrinsic size. width:100% plus
   the max-width set on .kform-tel / .kform-narrow / .kform-file means the
   capped ones stop at their cap and everything else fills. */
.kform-field > :is(.form-control, .form-select, .kform-choices, .kform-rating, .kform-tel) { width: 100%; }
.kform-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 575px) { .kform-row { grid-template-columns: 1fr; gap: 0; } .kform-card { padding: 20px; } }
.kform-label { display: block; font-weight: 600; margin-bottom: 6px; color: #111827; }
.kform-req { color: #b42318; }
.kform-help { font-size: .875rem; color: #6b7280; margin: -2px 0 8px; }
.kform-heading { margin: 28px 0 12px; padding-top: 12px; border-top: 1px solid #eef0f3; }
.kform-heading h3 { font-size: 1.2rem; margin: 0 0 4px; }
.kform-paragraph { color: #374151; margin-bottom: 20px; }
.kform-choices .form-check { margin-bottom: 6px; }
.kform .form-check-input:checked { background-color: var(--kform-accent, var(--kform-accent-fallback)); border-color: var(--kform-accent, var(--kform-accent-fallback)); }
.kform-single-check .form-check-label { font-weight: 600; }
/* row-reverse + the `input:checked ~ label` chain is what fills every star up
   to the chosen one: the inputs are emitted high-to-low, so the later
   siblings are the LOWER values. Keep that order if you touch the markup. */
.kform-rating { display: inline-flex; flex-direction: row-reverse; gap: 4px; position: relative; }
/* The inputs were position:absolute with no positioned ancestor, so every one
   of them escaped the row and stacked at the SAME coordinates over the stars.
   They are only 1px but still hit-testable, so a click often landed on
   whichever input happened to be on top instead of the star under the
   pointer — tapping the 5th star would select 1. Take them out of hit
   testing entirely and let the <label> do the work: clicking a label
   activates its own input, which is what makes this pattern reliable.
   Still focusable for keyboard users (clip, not display:none), and
   :focus-visible below draws the ring on the matching star. */
.kform-rating input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}
/* Generous tap target: the glyph alone is a thin diagonal, so padding gives
   a thumb somewhere to land on a phone. touch-action/user-select stop a tap
   turning into a text selection or a double-tap zoom mid-rating. */
.kform-rating label {
  font-size: 2rem;
  line-height: 1;
  color: #d0d5dd;
  cursor: pointer;
  padding: 2px 1px;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: color .12s ease;
}
.kform-rating input:checked ~ label, .kform-rating label:hover, .kform-rating label:hover ~ label { color: #f5a524; }
.kform-rating input:focus-visible + label { outline: 2px solid var(--kform-accent, var(--kform-accent-fallback)); outline-offset: 2px; border-radius: 4px; }
/* The scale and its end labels share one inline-width wrapper so the labels
   line up with the ENDS OF THE BUTTONS. They used to be a space-between row
   at full form width, which pushed "Not likely" / "Very likely" out to the
   page edges, far from the scale they describe and easy to miss. */
.kform-scale-group { display: inline-block; max-width: 100%; }
.kform-scale { display: flex; flex-wrap: wrap; gap: 6px; }
.kform-scale-btn { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d0d5dd; border-radius: 8px; cursor: pointer; background: #fff; }
.kform-scale .btn-check:checked + .kform-scale-btn { background: var(--kform-accent, var(--kform-accent-fallback)); border-color: var(--kform-accent, var(--kform-accent-fallback)); color: #fff; }
.kform-scale .btn-check:focus-visible + .kform-scale-btn { outline: 2px solid var(--kform-accent, var(--kform-accent-fallback)); outline-offset: 2px; }
/* Darker and a touch larger than the old .8rem/#6b7280: these carry the
   meaning of the whole question ("Quiet" vs "Packed"), so they should read as
   part of it rather than as faint hint text. gap keeps them apart when the
   scale is narrow enough that the two would otherwise meet. */
.kform-scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: .875rem;
  font-weight: 500;
  color: #374151;
  margin-top: 6px;
}
/* A file picker is a button plus a filename, so a full-row control leaves a
   long empty stretch beside it. */
.kform-file { max-width: 420px; }
@media (max-width: 575px) {
  .kform-file { max-width: 100%; }
}
/* Tied to the field above it, not floating between two fields: 2px off the
   input it belongs to, and a little weight so it reads as a message rather
   than hint text. */
.kform-error, .kform-form-error { color: #b42318; font-size: .875rem; font-weight: 500; margin-top: 2px; }
.kform-error:empty { margin-top: 0; }
/* "N characters left" under Short answer / Paragraph; amber when nearly full. */
.kform-count { color: #6b7280; font-size: .8125rem; margin-top: 4px; text-align: right; }
.kform-count.is-low { color: #b45309; }
.kform-field.has-error .form-control, .kform-field.has-error .form-select { border-color: #b42318; }
.kform-turnstile { margin: 8px 0 16px; }
/* Submit row: bottom-right, matching the event checkout's actions row.
   The directory self-submit form centers its button instead; these pages are
   a single column of questions ending in one action, so trailing-aligned
   reads as "the end of the form" the way a dialog's primary action does. */
.kform-submit-row {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}
/* Mirrors .theme-btn in style.css so a form page's Submit looks like every
   other submit on the site (directory self-submit, join modal, event
   checkout). Declared here rather than reusing the class because
   web/form_embed.php loads only Bootstrap + this file -- it injects
   --theme-color but not style.css -- so .theme-btn would be unstyled in an
   embed. --kform-accent lets a form override the org color; the theme
   color is the fallback. */
.kform-submit {
  outline: none;
  border: 1px solid var(--kform-accent, var(--theme-color, var(--kform-accent-fallback)));
  background: var(--kform-accent, var(--theme-color, var(--kform-accent-fallback)));
  color: var(--theme-on-primary, #fff);
  min-width: 160px;
  height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: 0.3s;
}
.kform-submit:hover:not([disabled]) { background: var(--theme-color-hover, var(--kform-accent, var(--kform-accent-fallback))); }
.kform-submit[disabled] { opacity: .6; cursor: not-allowed; pointer-events: none; }
@media (max-width: 575px) {
  /* Full width on a phone, where a trailing button is an awkward thumb
     reach and there is nothing beside it to align to. */
  .kform-submit-row { justify-content: stretch; }
  .kform-submit { width: 100%; }
}
.kform-done { text-align: center; padding: 24px 0 8px; }
.kform-done-icon {
  width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--kform-accent, var(--theme-color, var(--kform-accent-fallback)));
  color: var(--theme-on-primary, #fff);
  animation: kform-pop .35s ease-out;
}
.kform-done-title { font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; }
.kform-done-text { color: #4b5563; font-size: 1.05rem; margin: 0 auto; max-width: 460px; white-space: pre-line; }
.kform-intro[hidden] { display: none; }
@keyframes kform-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kform-done-icon { animation: none; } }
.kform-done:focus { outline: none; }
.kform-closed { background: #f9fafb; border: 1px solid #eef0f3; border-radius: 10px; padding: 16px; color: #374151; margin-top: 8px; }
.kform-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
/* Embed mode: no page chrome, transparent around the card */
body.kform-embed { background: transparent; margin: 0; }
body.kform-embed .kform-wrap { padding: 0; max-width: none; }
/* Custom-domain page: the form box is an iframe from public.kannect.co */
/* ── Phone + date/number widths ───────────────────────────────────────────
   A form page is one column of questions, so these are capped rather than
   stretched: a phone number and a date are fixed-width by nature and a
   full-row control leaves a long empty stretch beside the value. Short
   answer, email and paragraph still fill the row. */
.kform-tel { width: 100%; max-width: 340px; padding: 0; }
.kform-narrow { max-width: 260px; }
@media (max-width: 575px) {
  /* Full width on a phone, where there is no room to spare. */
  .kform-tel, .kform-narrow { max-width: 100%; }
}
/* web/phone_input.php ships no CSS of its own — its header says .phone-input
   must already exist in the host stylesheet, and each page that uses the
   widget defines it locally (see web/directory_self_submit.php). The embed
   page loads only Bootstrap + this file, so without this the number input
   would draw its own border inside the widget's flag row. */
.kform .phone-input,
.kform-wrap .phone-input {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  height: 100%;
  padding: 0;
  margin: 0;
  font-size: 16px;
}
.kform .phone-input:focus,
.kform-wrap .phone-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* height is a PLACEHOLDER, replaced as soon as the embed posts its real
   height. 600px left a visible band of empty space under a shorter form
   while that first message was in flight. */
.kform-frame { width: 100%; border: 0; min-height: 120px; height: 420px; display: block; }
