/* ==========================================================================
   FineParser — HubSpot embedded form overrides
   Paired with `css: ""` in the hbspt.forms.create() call in signup.html,
   which disables HubSpot's injected default stylesheet so these rules are
   what actually styles the form. HubSpot still sends a residual stylesheet
   for a few structural rules (e.g. a fieldset max-width) even with css: "",
   hence the explicit width/box-sizing resets below.
   ========================================================================== */

.hs-form {
  font-family: var(--font-sans);
  width: 100%;
}

.hs-form fieldset {
  max-width: none;
  width: 100%;
  border: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.hs-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  box-sizing: border-box;
}

/* Vertical rhythm between fields, margin- rather than flex-gap-based, because
   HubSpot nests some fields a level deeper than others — e.g. a
   country-conditional consent checkbox lands inside a `.hs-dependent-field`
   wrapper alongside the country select, not as a direct child of `.hs-form`
   — so a gap on `.hs-form` alone would skip that pair. :where() groups every
   field-like wrapper so the sibling combinator matches any pairing of them,
   regardless of which two end up sharing an immediate parent. */
:where(.hs-form-field, .legal-consent-container, .hs-dependent-field, .hs_submit)
  ~ :where(.hs-form-field, .legal-consent-container, .hs-dependent-field, .hs_submit) {
  margin-top: var(--space-5);
}

.hs-form label,
.hs-form legend {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

.hs-form input[type="text"],
.hs-form input[type="email"],
.hs-form input[type="tel"],
.hs-form input[type="number"],
.hs-form select,
.hs-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-4);
  transition: var(--transition-base);
}

.hs-form input[type="text"]:focus-visible,
.hs-form input[type="email"]:focus-visible,
.hs-form input[type="tel"]:focus-visible,
.hs-form input[type="number"]:focus-visible,
.hs-form select:focus-visible,
.hs-form textarea:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-color: var(--color-accent);
}

/* Error messages and consent options both render as <ul>/<li> — strip the
   bullets and give each its own spacing/color instead. */
.hs-form ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hs-error-msgs {
  margin-top: var(--space-1);
}

.hs-error-msgs label {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-error);
}

/* Legal consent (GDPR) checkboxes only render for visitors HubSpot detects
   as needing them, so their exact wrapper markup varies by HubSpot version —
   cover both the classic `.hs-form-booleancheckbox`/`.hs-form-checkbox`
   field wrappers and the inner `.hs-form-booleancheckbox-display` label
   that actually pairs the input with its text, since that's the element
   that needs the flex/gap to keep the checkbox from sitting flush against
   the text. */
.legal-consent-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.hs-form-booleancheckbox,
.hs-form-checkbox {
  display: flex;
}

.hs-form-booleancheckbox-display,
.hs-form-booleancheckbox label,
.hs-form-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.hs-form-booleancheckbox-display input[type="checkbox"],
.hs-form-booleancheckbox input[type="checkbox"],
.hs-form-checkbox input[type="checkbox"] {
  margin: 3px 0 0;
  flex: none;
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
}

.legal-consent-container a,
.hs-form-booleancheckbox-display a,
.hs-form-booleancheckbox label a,
.hs-form-checkbox label a {
  color: var(--color-accent);
}

.hs-form .hs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  align-self: flex-start;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1;
  white-space: nowrap;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  padding: 12px 24px;
  background: var(--color-accent);
  color: var(--color-accent-text);
  transition: var(--transition-base);
}

.hs-form .hs-button:hover {
  background: var(--color-accent-hover);
}
