/* Captain Forms — front end. Colours come from Captain Forms → Settings (brand colour) or the per-form accent. */
.cf-wrap {
  --cf-accent: var(--cf-brand, #1e88e5);
  --cf-ink: #0f172a;
  --cf-muted: #475569;
  --cf-line: #cbd5e1;
  --cf-soft: #f1f5f9;
  --cf-error: #b91c1c;
  --cf-radius: 8px;
  color: var(--cf-ink);
  font-size: 16px;
  line-height: 1.5;
  max-width: 920px;
  margin: 0 auto;
}
.cf-wrap *, .cf-wrap *::before, .cf-wrap *::after { box-sizing: border-box; }
.cf-wrap .cf-form { margin: 0; }
.cf-wrap [hidden] { display: none !important; }
.cf-wrap .cf-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cf-wrap .cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Progress */
.cf-wrap .cf-progress { margin: 0 0 28px; }
.cf-wrap .cf-progress__text { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cf-accent); margin-bottom: 8px; }
.cf-wrap .cf-progress__bar { height: 6px; background: var(--cf-soft); border-radius: 99px; overflow: hidden; }
.cf-wrap .cf-progress__bar span { display: block; height: 100%; background: var(--cf-accent); border-radius: 99px; transition: width .35s ease; }

/* Fields */
.cf-wrap .cf-field { margin: 0 0 22px; }
.cf-wrap .cf-field.cf-type-hidden { margin: 0; }
.cf-wrap .cf-label, .cf-wrap legend.cf-label { display: block; margin: 0 0 8px; padding: 0; font-size: 15px; font-weight: 700; color: var(--cf-ink); line-height: 1.4; float: none; width: auto; border: 0; }
.cf-wrap .cf-req { color: var(--cf-error); }
.cf-wrap .cf-desc { margin: 6px 0 0; font-size: 14px; color: var(--cf-muted); }
.cf-wrap .cf-sublabel { display: block; margin: 4px 0 0; font-size: 13px; color: var(--cf-muted); font-weight: 400; }

.cf-wrap .cf-form input.cf-input,
.cf-wrap .cf-form select.cf-input,
.cf-wrap .cf-form textarea.cf-input {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--cf-ink);
  background: #fff;
  border: 1px solid var(--cf-line);
  border-radius: var(--cf-radius);
  box-shadow: none;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.cf-wrap .cf-form textarea.cf-input { min-height: 130px; resize: vertical; }
.cf-wrap .cf-form .cf-input:focus { outline: none; border-color: var(--cf-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cf-accent) 22%, transparent); }
.cf-wrap .cf-form .cf-input::placeholder { color: #94a3b8; opacity: 1; }
.cf-wrap .cf-select { position: relative; }
.cf-wrap .cf-select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--cf-muted); border-bottom: 2px solid var(--cf-muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.cf-wrap .cf-form select.cf-input { padding-right: 40px; cursor: pointer; }

/* Width by size (on wide screens) */
@media (min-width: 720px) {
  .cf-wrap .cf-size-small > .cf-input, .cf-wrap .cf-size-small > .cf-input-wrap, .cf-wrap .cf-size-small > .cf-select { max-width: 280px; }
  .cf-wrap .cf-size-medium > .cf-input, .cf-wrap .cf-size-medium > .cf-input-wrap, .cf-wrap .cf-size-medium > .cf-select, .cf-wrap .cf-size-medium > .iti { max-width: 580px; }
  .cf-wrap .cf-col .cf-field > * { max-width: none; }
}

/* Name */
.cf-wrap .cf-name { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 580px; }
.cf-wrap .cf-name:has(.cf-name__part:nth-child(3)) { grid-template-columns: 1fr 1fr 1fr; }

/* Choices */
.cf-wrap .cf-choices { margin: 0; padding: 0; border: 0; min-width: 0; }
.cf-wrap .cf-choice-list { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.cf-wrap .cf-choice-list--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cf-wrap .cf-choice { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px 14px; min-height: 48px; border: 1px solid var(--cf-line); border-radius: var(--cf-radius); background: #fff; cursor: pointer; font-size: 15px; font-weight: 500; line-height: 1.35; transition: border-color .15s ease, background-color .15s ease; }
.cf-wrap .cf-choice:hover { border-color: var(--cf-accent); }
.cf-wrap .cf-choice input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--cf-accent); cursor: pointer; }
.cf-wrap .cf-choice:has(input:checked) { border-color: var(--cf-accent); background: color-mix(in srgb, var(--cf-accent) 7%, #fff); }
.cf-wrap .cf-choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.cf-wrap .cf-choice:has(input:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cf-accent) 25%, transparent); }

/* Sections */
.cf-wrap .cf-type-divider { margin: 40px 0 22px; padding-top: 28px; border-top: 1px solid #e2e8f0; }
.cf-wrap .cf-page > .cf-type-divider:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.cf-wrap .cf-section { margin: 0; font-size: clamp(21px, 2.4vw, 26px); line-height: 1.25; font-weight: 800; color: var(--cf-ink); letter-spacing: -.01em; }
.cf-wrap .cf-section-desc { margin: 8px 0 0; color: var(--cf-muted); font-size: 15px; }
.cf-wrap .cf-section-desc p { margin: 0 0 8px; }
.cf-wrap .cf-content { padding: 14px 16px; background: var(--cf-soft); border-radius: var(--cf-radius); }
.cf-wrap .cf-content > :last-child { margin-bottom: 0; }

/* Layout columns */
.cf-wrap .cf-type-layout { margin-bottom: 4px; }
.cf-wrap .cf-layout-title { font-weight: 700; margin-bottom: 8px; }
.cf-wrap .cf-cols { display: flex; flex-wrap: wrap; gap: 0 18px; }
.cf-wrap .cf-col { flex: 1 1 100%; min-width: 0; }
@media (min-width: 720px) {
  .cf-wrap .cf-col { flex: 1 1 calc(var(--cf-w) * 1% - 18px); }
}

/* Themes (Salient) decorate list items with bullets/markers: none inside forms. */
.cf-wrap ul.cf-suggest > li, .cf-wrap ul.cf-files > li { list-style: none !important; margin-left: 0; padding-left: 0; background-image: none; }
.cf-wrap ul.cf-suggest > li::before, .cf-wrap ul.cf-files > li::before, .cf-wrap ul.cf-suggest > li::marker, .cf-wrap ul.cf-files > li::marker { content: none !important; display: none !important; }
.cf-wrap ul.cf-suggest > li.cf-suggest__item { padding: 10px 12px; }
.cf-wrap ul.cf-files > li.cf-file { padding: 10px 12px 14px; }

/* Address suggestions */
.cf-wrap .cf-address { position: relative; }
.cf-wrap .cf-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--cf-line); border-radius: var(--cf-radius); box-shadow: 0 14px 30px rgba(15, 23, 42, .14); }
.cf-wrap .cf-suggest__item { padding: 10px 12px; border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1.35; margin: 0; }
.cf-wrap .cf-suggest__item span { color: var(--cf-muted); font-size: 14px; }
.cf-wrap .cf-suggest__item.is-active, .cf-wrap .cf-suggest__item:hover { background: var(--cf-soft); }
.cf-wrap .cf-suggest__brand { padding: 6px 12px 2px; font-size: 11px; color: #94a3b8; text-align: right; list-style: none; }
.cf-wrap .cf-map { height: 200px; margin-top: 10px; border-radius: var(--cf-radius); overflow: hidden; border: 1px solid var(--cf-line); }

/* Phone */
.cf-wrap .iti { display: block; width: 100%; }
.cf-wrap .iti__country-container { z-index: 2; }
.cf-wrap .iti__dropdown-content { z-index: 40; }

/* Files */
.cf-wrap .cf-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 26px 18px; text-align: center; border: 2px dashed var(--cf-line); border-radius: var(--cf-radius); background: #fafcff; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; max-width: 580px; }
.cf-wrap .cf-drop:hover, .cf-wrap .cf-drop.is-over, .cf-wrap .cf-drop:focus-visible { border-color: var(--cf-accent); background: color-mix(in srgb, var(--cf-accent) 5%, #fff); outline: none; }
.cf-wrap .cf-drop svg { width: 30px; height: 30px; color: var(--cf-accent); }
.cf-wrap .cf-drop__main { font-weight: 600; font-size: 15px; }
.cf-wrap .cf-drop__main u { color: var(--cf-accent); text-underline-offset: 3px; }
.cf-wrap .cf-drop__hint { font-size: 13px; color: var(--cf-muted); }
.cf-wrap .cf-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cf-wrap .cf-files { list-style: none; margin: 10px 0 0; padding: 0; max-width: 580px; }
.cf-wrap .cf-file { position: relative; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 12px; margin: 0 0 8px; padding: 10px 12px 14px; border: 1px solid var(--cf-line); border-radius: var(--cf-radius); background: #fff; font-size: 14px; }
.cf-wrap .cf-file__name { font-weight: 600; overflow-wrap: anywhere; }
.cf-wrap .cf-file__meta { color: var(--cf-muted); font-size: 13px; }
.cf-wrap .cf-file__bar { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; background: var(--cf-soft); border-radius: 3px; overflow: hidden; }
.cf-wrap .cf-file__bar span { display: block; width: 0; height: 100%; background: var(--cf-accent); transition: width .2s ease; }
.cf-wrap .cf-file.is-done .cf-file__bar span { background: #16a34a; }
.cf-wrap .cf-file.is-error { border-color: var(--cf-error); }
.cf-wrap .cf-file.is-error .cf-file__meta { color: var(--cf-error); grid-column: 1 / -1; }
.cf-wrap .cf-file__remove { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--cf-soft); color: var(--cf-muted); font-size: 20px; line-height: 1; cursor: pointer; }
.cf-wrap .cf-file__remove:hover { background: #fee2e2; color: var(--cf-error); }

/* Signature */
.cf-wrap .cf-sig { max-width: 580px; border: 1px solid var(--cf-line); border-radius: var(--cf-radius); background: #fff; overflow: hidden; }
.cf-wrap .cf-sig__pad { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; background: linear-gradient(transparent 132px, #e2e8f0 132px, #e2e8f0 133px, transparent 133px); }
.cf-wrap .cf-sig__bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--cf-soft); font-size: 13px; color: var(--cf-muted); }
.cf-wrap .cf-signed .cf-sig__hint { color: #16a34a; font-weight: 600; }
.cf-wrap .cf-signed .cf-sig__hint::before { content: "✓ "; }

/* Errors */
.cf-wrap .cf-error { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--cf-error); }
.cf-wrap .cf-has-error .cf-input, .cf-wrap .cf-has-error .cf-drop, .cf-wrap .cf-has-error .cf-sig, .cf-wrap .cf-has-error .cf-choice { border-color: var(--cf-error); }
.cf-wrap .cf-errors-summary { margin: 0 0 22px; padding: 14px 16px; border-radius: var(--cf-radius); background: #fef2f2; border: 1px solid #fecaca; color: var(--cf-error); font-weight: 600; }

/* Review step */
.cf-wrap .cf-preview-notice { margin: 0 0 18px; padding: 14px 16px; border-left: 4px solid var(--cf-accent); background: var(--cf-soft); border-radius: 0 var(--cf-radius) var(--cf-radius) 0; }
.cf-wrap .cf-preview-notice p { margin: 0 0 6px; }
.cf-wrap .cf-preview-notice p:last-child { margin: 0; }
.cf-wrap .cf-preview__section { margin: 24px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cf-accent); }
.cf-wrap .cf-preview__list { margin: 0; border: 1px solid #e2e8f0; border-radius: var(--cf-radius); overflow: hidden; }
.cf-wrap .cf-preview__row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; padding: 11px 14px; border-bottom: 1px solid #f1f5f9; font-size: 15px; }
.cf-wrap .cf-preview__row:last-child { border-bottom: 0; }
.cf-wrap .cf-preview__row:nth-child(even) { background: #fafbfc; }
.cf-wrap .cf-preview__row dt { color: var(--cf-muted); margin: 0; }
.cf-wrap .cf-preview__row dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 560px) { .cf-wrap .cf-preview__row { grid-template-columns: 1fr; gap: 2px; } }

/* Buttons */
.cf-wrap .cf-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 30px; }
.cf-wrap .cf-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 30px; border: 2px solid transparent; border-radius: var(--cf-radius); font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; line-height: 1.2; transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
.cf-wrap .cf-btn--primary { background: var(--cf-accent); color: #fff; }
.cf-wrap .cf-btn--primary:hover { filter: brightness(.92); transform: translateY(-1px); }
.cf-wrap .cf-btn--ghost { background: transparent; border-color: var(--cf-line); color: var(--cf-ink); }
.cf-wrap .cf-btn--ghost:hover { border-color: var(--cf-ink); }
.cf-wrap .cf-btn:disabled { opacity: .6; cursor: wait; transform: none; }
.cf-wrap .cf-btn.is-busy { text-transform: none; letter-spacing: 0; }
.cf-wrap .cf-link { padding: 6px 2px; border: 0; background: none; color: var(--cf-accent); font: inherit; font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 560px) {
  .cf-wrap .cf-nav { flex-direction: column; align-items: stretch; }
  .cf-wrap .cf-btn { width: 100%; padding: 14px 18px; white-space: normal; }
  .cf-wrap .cf-name { grid-template-columns: 1fr 1fr; }
}

/* Done / saved */
.cf-wrap .cf-done, .cf-wrap .cf-saved__box { padding: 36px 28px; text-align: center; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); outline: none; }
.cf-wrap .cf-done__icon { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: #dcfce7; color: #16a34a; }
.cf-wrap .cf-done__icon svg { width: 32px; height: 32px; }
.cf-wrap .cf-done p { font-size: 18px; margin: 0 0 8px; }
.cf-wrap .cf-saved__box { text-align: left; }
.cf-wrap .cf-saved__link { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.cf-wrap .cf-saved__link input { flex: 1 1 260px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--cf-line); border-radius: var(--cf-radius); font-size: 14px; }
.cf-wrap .cf-saved__email { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 16px 0; }
.cf-wrap .cf-saved__email label { flex: 1 1 260px; font-weight: 700; font-size: 15px; }
.cf-wrap .cf-saved__email input { display: block; width: 100%; min-height: 50px; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--cf-line); border-radius: var(--cf-radius); font-size: 16px; }
.cf-wrap .cf-saved__sent { flex-basis: 100%; color: #16a34a; font-weight: 600; margin: 0; }
.cf-missing { color: #b91c1c; font-weight: 700; }
