/* Documo Forms — scoped to .df-form so it cannot leak into Bricks styles. */

.df-form {
  --df-text: #0B2134;
  --df-heading: #1A324F;
  --df-muted: #5B7189;
  --df-accent: #1E7BE0;
  --df-cta: #EE7623;
  --df-cta-dark: #D5651A;
  --df-line: #DEE7F1;
  --df-error: #D92D20;
  --df-radius: 14px;

  /* No card chrome: the form is dropped into a container that already has
     its own background, padding and width. Only the tokens and the layout
     context belong here. Override any --df-* token from the container. */
  width: 100%;
  color: var(--df-text);

  /* Width now comes from the container, not the viewport, so the responsive
     rules below key off the form's own inline size. A narrow column on a wide
     screen collapses the two-column grids exactly like a narrow screen does. */
  container-type: inline-size;
}

.df-form *, .df-form *::before, .df-form *::after { box-sizing: border-box; }

.df-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.df-fieldset { border: 0; margin: 0; padding: 0; }
.df-field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.df-field label { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em; color: var(--df-text); }
.df-req { color: var(--df-cta); }
.df-hint { font-weight: 400; color: var(--df-muted); font-size: 0.8rem; }

.df-q-label { display: block; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em; color: var(--df-heading); margin: 1.5rem 0 0.7rem; }

.df-form input[type="text"],
.df-form input[type="email"],
.df-form select,
.df-form textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.72rem 0.85rem;
  border: 1.5px solid var(--df-line);
  border-radius: 10px;
  background: #FBFCFE;
  color: var(--df-text);
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.df-form textarea { display: block; resize: vertical; min-height: 5.5rem; margin-bottom: 1rem; }
.df-form input:focus, .df-form select:focus, .df-form textarea:focus {
  outline: none;
  border-color: var(--df-accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(30, 123, 224, 0.14);
}
.df-form select { appearance: none; cursor: pointer; padding-right: 2.3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235B7189' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center; }

/* Errors render inline and in the DOM — no floating tooltip fighting a
   third-party stylesheet, and screen readers get them via aria-describedby. */
.df-err { margin: 0.35rem 0 0; font-size: 0.8rem; font-weight: 500; color: var(--df-error); }
.has-error input, .has-error select, .has-error textarea,
.df-form [aria-invalid="true"] {
  border-color: var(--df-error) !important;
  box-shadow: 0 0 0 2px rgba(217, 45, 32, 0.12);
}
.df-error-summary { margin: 0.8rem 0 0; font-size: 0.85rem; font-weight: 600; color: var(--df-error); }

/* Option cards + pills */
.df-usecase { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.df-card input, .df-pill input { position: absolute; opacity: 0; pointer-events: none; }
.df-card {
  position: relative; display: flex; flex-direction: row; align-items: center; gap: 0.75rem;
  padding: 0.95rem 1rem; border: 1.5px solid var(--df-line);
  border-radius: var(--df-radius); cursor: pointer; background: #FBFCFE;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.df-card:hover { border-color: #B9CEE6; }
.df-card:has(input:checked) { border-color: var(--df-accent); background: #F2F8FF; box-shadow: 0 0 0 3px rgba(30,123,224,0.12); }
.df-card-wide { grid-column: 1 / -1; }

.df-ic {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: rgba(30,123,224,0.10); color: var(--df-accent);
  transition: background .15s ease, color .15s ease;
}
.df-card:has(input:checked) .df-ic { background: var(--df-accent); color: #fff; }

.df-card-txt { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.df-card-t { font-weight: 600; font-size: 0.9rem; line-height: 1.2; color: var(--df-heading); }
.df-card-d { font-size: 0.75rem; color: var(--df-muted); line-height: 1.3; }
.df-card input:focus-visible ~ .df-card-txt { outline: 2px solid var(--df-accent); outline-offset: 3px; }

.df-opt-set { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.df-pill {
  position: relative; padding: 0.55rem 0.95rem;
  border: 1.5px solid var(--df-line); border-radius: 999px; cursor: pointer;
  font-size: 0.88rem; font-weight: 500; color: var(--df-text);
  background: #FBFCFE; transition: all .15s ease;
}
.df-pill:hover { border-color: #B9CEE6; }
/* Selection changes colour only. Weight changes or inserted glyphs would
   resize the pill and re-wrap the whole row. */
.df-pill:has(input:checked) { border-color: var(--df-accent); background: var(--df-accent); color: #fff; }
.df-pill:has(input:focus-visible) { outline: 2px solid var(--df-accent); outline-offset: 2px; }
/* Multi-select pills carry the box in both states so width never moves. */
.df-pill-multi::before {
  content: ""; display: inline-block; width: 13px; height: 13px;
  margin-right: 0.45rem; vertical-align: -2px;
  border: 1.5px solid #C3D3E5; border-radius: 4px;
  background-repeat: no-repeat; background-position: center;
  transition: background-color .15s ease, border-color .15s ease;
}
.df-pill-multi:has(input:checked)::before {
  border-color: #fff; background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='%231E7BE0' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

/* Conditional reveal */
.df-reveal {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows .38s cubic-bezier(.22,.61,.36,1), opacity .28s ease;
}
.df-reveal > .df-reveal-inner { overflow: hidden; min-height: 0; }
.df-reveal.is-open { grid-template-rows: 1fr; opacity: 1; }
/* Let the combobox panel escape once the height has settled. */
.df-reveal.is-settled > .df-reveal-inner { overflow: visible; }

.df-branch {
  margin-top: 1.4rem; padding: 1.3rem 1.3rem 0.4rem;
  border: 1px dashed var(--df-line); border-radius: var(--df-radius);
  background: linear-gradient(180deg, #F7FAFE, #FFFFFF);
}
.df-branch-tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--df-accent); margin-bottom: 0.3rem;
}
.df-bar { width: 16px; height: 2px; background: var(--df-accent); border-radius: 2px; }
.df-subbranch { margin-top: 1.35rem; padding-left: 1rem; border-left: 2px solid rgba(30,123,224,0.28); }

/* Combobox */
.df-combo { position: relative; display: flex; flex-direction: column; }
.df-combo-list {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 15rem; overflow-y: auto; margin: 0; padding: 0.3rem;
  list-style: none; background: #fff; border: 1.5px solid var(--df-line);
  border-radius: 12px; box-shadow: 0 18px 38px -20px rgba(11,33,52,0.4); display: none;
}
.df-combo.is-open .df-combo-list { display: block; }
.df-combo.is-up .df-combo-list { top: auto; bottom: calc(100% + 6px); }
.df-combo-opt { padding: 0.5rem 0.6rem; border-radius: 8px; font-size: 0.88rem; cursor: pointer; color: var(--df-text); }
.df-combo-opt:hover, .df-combo-opt.is-active { background: #F2F8FF; color: var(--df-accent); font-weight: 600; }
.df-combo-empty { padding: 0.6rem; font-size: 0.85rem; color: var(--df-muted); }

/* Submit */
.df-submit-row { margin-top: 1.9rem; }
.df-cta {
  width: 100%; font: inherit; font-weight: 700; font-size: 1rem; color: #fff;
  background: var(--df-cta); border: 0; border-radius: 12px; padding: 0.95rem 1.2rem;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  box-shadow: 0 12px 24px -12px rgba(238,118,35,0.7);
  transition: background .15s ease, transform .08s ease;
}
.df-cta:hover { background: var(--df-cta-dark); }
.df-cta:active { transform: translateY(1px); }
.df-cta:disabled { opacity: 0.6; cursor: not-allowed; }
.df-fineprint { margin: 1rem 0 0; font-size: 0.78rem; color: var(--df-muted); text-align: center; }
.df-fineprint a { color: var(--df-accent); }

/* Booking interstitial. Swaps for the whole form once submitted, so the wait
   reads as "we are booking you in" rather than "the form is still sending". */
.df-booking { display: none; }
.df-form.is-booking > *:not(.df-booking) { display: none; }
.df-form.is-booking .df-booking {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1.35rem 1.4rem;
  border: 1.5px solid var(--df-line); border-radius: var(--df-radius);
  background: #F7FAFE;
}
.df-booking-txt { display: flex; flex-direction: column; gap: 0.2rem; }
.df-booking-txt strong { font-size: 0.95rem; font-weight: 600; color: var(--df-heading); }
.df-booking-txt span { font-size: 0.83rem; color: var(--df-muted); line-height: 1.4; }
.df-spinner {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  border: 2.5px solid rgba(30,123,224,0.22);
  border-top-color: var(--df-accent);
  animation: df-spin .7s linear infinite;
}
@keyframes df-spin { to { transform: rotate(360deg); } }
/* Reduced motion: hold a static ring rather than remove the only cue that
   something is still happening. */
@media (prefers-reduced-motion: reduce) {
  .df-spinner { animation: none; border-top-color: var(--df-accent); opacity: .8; }
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.df-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@container (max-width: 560px) {
  .df-grid-2, .df-usecase { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .df-form *, .df-reveal { transition: none !important; }
}
