/* ========================
   HubSpot Lead Form – slide-in drawer
   ======================== */

.hs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 28, 21, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.hs-overlay.is-visible {
  opacity: 1;
}

.hs-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1001;
  width: min(440px, 100vw);
  height: 100dvh;
  background: var(--color-background);
  box-shadow: -16px 0 48px rgba(8, 28, 21, 0.18);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hs-drawer.is-open {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .hs-overlay,
  .hs-drawer {
    transition: none;
  }
}

.hs-drawer__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-secondary);
  color: var(--color-foreground);
  cursor: pointer;
  transition: background var(--transition-base);
}

.hs-drawer__close:hover {
  background: var(--color-border);
}

.hs-drawer__inner {
  padding: 3.5rem 2rem 2.5rem;
}

.hs-drawer__eyebrow {
  color: var(--color-foreground-muted);
  margin-bottom: 0.5rem;
}

.hs-drawer__title {
  font-size: var(--font-size-3xl);
  line-height: 1.15;
  color: var(--color-foreground);
  margin-bottom: 0.75rem;
}

.hs-drawer__intro {
  color: var(--color-foreground-muted);
  line-height: 1.55;
  margin-bottom: 1.75rem;
}

/* Form */
.hs-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* The explicit display values above would otherwise override the [hidden]
   attribute, so make sure hidden always wins when toggled from JS. */
.hs-form[hidden],
.hs-form__success[hidden] {
  display: none;
}

/* Honeypot spam trap — visually removed but still fillable by bots. */
.hs-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.hs-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.hs-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.hs-form__field label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-foreground);
}

.hs-form__field label span {
  color: var(--color-primary-green);
}

.hs-form__field input,
.hs-form__field textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  font: inherit;
  font-size: var(--font-size-sm);
  color: var(--color-foreground);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.hs-form__field textarea {
  resize: vertical;
  min-height: 3.5rem;
}

.hs-form__field input:focus,
.hs-form__field textarea:focus {
  outline: none;
  border-color: var(--color-primary-green);
  box-shadow: 0 0 0 3px rgba(5, 87, 42, 0.12);
}

.hs-form__field input:user-invalid {
  border-color: #c0392b;
}

/* Consent */
.hs-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: var(--font-size-xs);
  line-height: 1.45;
  color: var(--color-foreground-muted);
  cursor: pointer;
  margin-top: 0.25rem;
}

.hs-form__consent input {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.1rem;
  accent-color: var(--color-primary-green);
}

.hs-form__consent a {
  color: var(--color-primary-green);
  text-decoration: underline;
}

/* Error message */
.hs-form__error {
  margin: 0;
  padding: 0.625rem 0.875rem;
  font-size: var(--font-size-sm);
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
  border-radius: var(--radius-lg);
}

/* Submit */
.hs-form__submit {
  position: relative;
  width: 100%;
  justify-content: center;
  align-items: center;
  margin-top: 0.5rem;
}

.hs-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.hs-form__submit.is-loading .hs-form__submit-label {
  visibility: hidden;
}

.hs-form__submit.is-loading::after {
  content: "";
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--radius-full);
  animation: hs-spin 0.6s linear infinite;
}

@keyframes hs-spin {
  to { transform: rotate(360deg); }
}

/* Success state */
.hs-form__success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.875rem;
  padding-top: 1rem;
  color: var(--color-foreground);
}

.hs-form__success svg {
  color: var(--color-primary-green);
}

.hs-form__success h3 {
  font-size: var(--font-size-2xl);
}

.hs-form__success p {
  color: var(--color-foreground-muted);
  line-height: 1.55;
}

.hs-form__success .btn {
  margin-top: 0.5rem;
}
