/* =============================================================
   hubspot-form.css — Make Bespoke Studio
   Shared styling for any <form class="mbs-hubspot-form"> on the site.
   Posts to HubSpot Forms API. Matches MBS brand:
     • Jost labels (uppercase tracked 10/0.18em) + brand-green hairline before
     • Underline-only inputs in Jost 300 with stone-light dividers
     • Brand-green-dark focus state
     • Charcoal submit button → brand-green-dark on hover
     • Full dark-theme overrides
   ============================================================= */

.mbs-hubspot-form {
  --mbs-form-fg: var(--charcoal, #1C1C1A);
  --mbs-form-muted: var(--dark-sage, #505E58);
  --mbs-form-line: var(--stone-light, #D4CEC6);
  --mbs-form-accent: var(--brand-green-dark, #4DAF92);
  --mbs-form-accent-light: var(--brand-green, #8DD9BF);
  --mbs-form-cta-bg: var(--charcoal, #1C1C1A);
  --mbs-form-cta-fg: var(--warm-white, #FAFAF7);
  --mbs-form-cta-hover: var(--brand-green-dark, #4DAF92);

  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 640px;
  width: 100%;
  font-family: 'Jost', sans-serif;
}

.mbs-hubspot-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 0;
}
@media (max-width: 720px) {
  .mbs-hubspot-form .form-row { grid-template-columns: 1fr; gap: 32px; }
}

/* Eyebrow-style label: hairline + uppercase tracked Jost */
.mbs-hubspot-form label.form-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mbs-form-muted);
}
.mbs-hubspot-form label.form-field > span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.mbs-hubspot-form label.form-field > span::before {
  content: "";
  display: block;
  width: 18px;
  height: 0.5px;
  background: var(--mbs-form-accent-light);
  flex-shrink: 0;
}

.mbs-hubspot-form input,
.mbs-hubspot-form textarea {
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: var(--mbs-form-fg);
  background: transparent;
  border: 0;
  border-bottom: 0.5px solid var(--mbs-form-line);
  padding: 10px 0 12px;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color 0.25s ease-out;
  width: 100%;
  box-sizing: border-box;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.mbs-hubspot-form input::placeholder,
.mbs-hubspot-form textarea::placeholder {
  color: var(--mbs-form-line);
  font-weight: 300;
  letter-spacing: 0;
  text-transform: none;
}
.mbs-hubspot-form input:focus,
.mbs-hubspot-form textarea:focus {
  outline: none;
  border-bottom-color: var(--mbs-form-accent);
}
.mbs-hubspot-form input:-webkit-autofill,
.mbs-hubspot-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--warm-white, #FAFAF7) inset !important;
  -webkit-text-fill-color: var(--mbs-form-fg) !important;
}
.mbs-hubspot-form textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.65;
  padding-top: 12px;
}

/* Consent row — sentence-case, no eyebrow styling */
.mbs-hubspot-form .form-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0;
  text-transform: none;
  color: var(--mbs-form-muted);
  cursor: pointer;
}
.mbs-hubspot-form .form-consent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
  accent-color: var(--mbs-form-accent);
  border-bottom: 0;
  padding: 0;
  cursor: pointer;
}
.mbs-hubspot-form .form-consent a {
  color: #1C1C1A;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 0.5px;
  transition: color 0.2s;
}
.mbs-hubspot-form .form-consent a:hover {
  color: #4DAF92;
}

/* Submit */
.mbs-hubspot-form .form-submit {
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: var(--mbs-form-cta-bg);
  color: var(--mbs-form-cta-fg);
  border: 0;
  border-radius: 0;
  padding: 20px 36px;
  cursor: pointer;
  transition: background 0.3s ease-out, transform 0.1s, color 0.3s;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  letter-spacing: 0.22em;
}
.mbs-hubspot-form .form-submit:hover {
  background: var(--mbs-form-cta-hover);
  color: var(--warm-white, #FAFAF7);
}
.mbs-hubspot-form .form-submit:active {
  transform: scale(0.98);
}
.mbs-hubspot-form .form-submit:disabled {
  opacity: 0.45;
  cursor: wait;
}

/* Result message — only visible after submit attempt */
.mbs-hubspot-form .form-message {
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  padding: 18px 22px;
  border-left: 2px solid var(--mbs-form-line);
  background: rgba(245, 240, 232, 0.55);
  color: var(--mbs-form-muted);
  display: none;
  letter-spacing: 0;
  text-transform: none;
}
.mbs-hubspot-form .form-message.is-visible { display: block; }
.mbs-hubspot-form .form-message.is-success {
  border-left-color: var(--mbs-form-accent);
  background: rgba(141, 217, 191, 0.18);
  color: var(--mbs-form-fg);
}
.mbs-hubspot-form .form-message.is-error {
  border-left-color: #C0312D;
  background: rgba(192, 49, 45, 0.08);
  color: #8A2420;
}

/* Honeypot — invisible to humans, present for spam bots */
.mbs-hubspot-form .form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ──────────── Dark theme ──────────── */
html[data-theme="dark"] .mbs-hubspot-form {
  --mbs-form-fg: rgba(250, 250, 247, 0.98);
  --mbs-form-muted: rgba(232, 226, 218, 0.88);
  --mbs-form-line: rgba(212, 206, 198, 0.38);
  --mbs-form-cta-bg: var(--warm-white, #FAFAF7);
  --mbs-form-cta-fg: var(--charcoal, #1C1C1A);
  --mbs-form-cta-hover: var(--brand-green, #8DD9BF);
}
html[data-theme="dark"] .mbs-hubspot-form input,
html[data-theme="dark"] .mbs-hubspot-form textarea {
  color: rgba(250, 250, 247, 0.98);
}
html[data-theme="dark"] .mbs-hubspot-form input::placeholder,
html[data-theme="dark"] .mbs-hubspot-form textarea::placeholder {
  color: rgba(232, 226, 218, 0.55);
}
html[data-theme="dark"] .mbs-hubspot-form .form-consent {
  color: rgba(232, 226, 218, 0.85);
}
html[data-theme="dark"] .mbs-hubspot-form .form-consent a {
  color: #FAFAF7;
}
html[data-theme="dark"] .mbs-hubspot-form .form-consent a:hover {
  color: #8DD9BF;
}
html[data-theme="dark"] .mbs-hubspot-form input:-webkit-autofill,
html[data-theme="dark"] .mbs-hubspot-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #141412 inset !important;
  -webkit-text-fill-color: rgba(250, 250, 247, 0.92) !important;
}
html[data-theme="dark"] .mbs-hubspot-form .form-message {
  background: rgba(250, 250, 247, 0.03);
  border-left-color: rgba(212, 206, 198, 0.25);
}
html[data-theme="dark"] .mbs-hubspot-form .form-message.is-success {
  background: rgba(141, 217, 191, 0.10);
  border-left-color: var(--brand-green, #8DD9BF);
  color: var(--warm-white, #FAFAF7);
}
html[data-theme="dark"] .mbs-hubspot-form .form-message.is-error {
  background: rgba(192, 49, 45, 0.14);
  color: #F2B5B2;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mbs-hubspot-form input,
  .mbs-hubspot-form textarea,
  .mbs-hubspot-form .form-submit {
    transition: none;
  }
  .mbs-hubspot-form .form-submit:active { transform: none; }
}
