/*
  gl-lead-style.css
  Styles for the Salesforce Web-to-Lead embed (lead-form-embed).
  Every selector is scoped under .gl-lead so nothing leaks into the host page.
  Hosted at: /content/css/gl-lead-style.css
*/

.gl-lead {
  --gl-lead-ink: #0f1115;
  --gl-lead-muted: #5b6170;
  --gl-lead-accent: #0569ff;
  --gl-lead-accent-rgb: 5 105 255;
  --gl-lead-field: #fafafb;
  --gl-lead-field-border: #8a8f99;
  --gl-lead-surface: #ffffff;
  --gl-lead-hairline: #e7e8ec;
  --gl-lead-error: #b42318;
  --gl-lead-radius: 12px;
  --gl-lead-font: "Inter var", "Inter", "Geist", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gl-lead-mono: ui-monospace, "SF Mono", "Geist Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --gl-lead-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  container-type: inline-size;
  display: block;
  max-width: 680px;
  margin: 0 auto;
  font-family: var(--gl-lead-font);
  font-size: max(1rem, 16px); /* honours larger user settings; 16px floor prevents iOS zoom */
  font-feature-settings: "cv11", "ss01", "ss03"; /* Inter's cleaner alternates where available */
  line-height: 1.5;
  color: var(--gl-lead-ink);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.gl-lead *,
.gl-lead *::after {
  box-sizing: border-box;
}

/* Form container (positioned to contain the confirmation and status text) */
.gl-lead .gl-lead__form {
  position: relative;
  margin: 0;
  padding: clamp(24px, 7cqi, 48px);
}

.gl-lead .gl-lead__form:focus {
  outline: none; /* focus is parked here only as a neutral reset point */
}

/* Layout: single column, two columns when the container (not viewport) is wide */
.gl-lead .gl-lead__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.375em 1em;
  margin: 0;
  padding: 0;
  border: 0;
}

@container (min-width: 500px) {
  .gl-lead .gl-lead__grid {
    grid-template-columns: 1fr 1fr;
  }

  .gl-lead .gl-lead__field--full {
    grid-column: 1 / -1;
  }
}

.gl-lead .gl-lead__field {
  min-width: 0;
  margin: 0;
}

/* Labels */
.gl-lead .gl-lead__label {
  display: flex;
  align-items: baseline;
  gap: 0.625em;
  margin: 0 0 0.5em;
  padding: 0;
  font-size: 0.875em;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--gl-lead-ink);
}

/* Required / Optional tags */
.gl-lead .gl-lead__tag {
  margin: 0;
  padding: 0;
  font-family: var(--gl-lead-mono);
  font-size: 0.8125em;
  font-weight: 400;
  line-height: inherit;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--gl-lead-muted);
}

/* Inputs */
.gl-lead .gl-lead__input {
  appearance: none;
  display: block;
  width: 100%;
  height: auto;
  min-height: 3.125em;
  margin: 0;
  padding: 0.8125em 1em;
  font: inherit;
  line-height: 1.25;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--gl-lead-ink);
  background: var(--gl-lead-field);
  border: 1px solid var(--gl-lead-field-border);
  border-radius: var(--gl-lead-radius);
  box-shadow: 0 1px 2px rgb(15 17 21 / 0.04);
  outline: 2px solid transparent; /* keeps a visible ring in forced-colors mode */
  outline-offset: 2px;
  transition:
    border-color 0.2s var(--gl-lead-ease),
    background-color 0.2s var(--gl-lead-ease),
    box-shadow 0.2s var(--gl-lead-ease);
}

.gl-lead .gl-lead__input--multiline {
  line-height: 1.5;
  resize: vertical;
}

.gl-lead .gl-lead__input:hover {
  border-color: var(--gl-lead-ink);
}

.gl-lead .gl-lead__input:focus-visible {
  background: var(--gl-lead-surface);
  border-color: var(--gl-lead-accent);
  box-shadow:
    0 0 0 2px var(--gl-lead-accent),
    0 0 0 5px rgb(var(--gl-lead-accent-rgb) / 0.18);
}

.gl-lead .gl-lead__input[aria-invalid="true"] {
  background: var(--gl-lead-surface);
  border-color: var(--gl-lead-error);
  box-shadow: 0 0 0 1px var(--gl-lead-error);
}

.gl-lead .gl-lead__input[aria-invalid="true"]:focus-visible {
  box-shadow:
    0 0 0 2px var(--gl-lead-error),
    0 0 0 5px rgb(180 35 24 / 0.14);
}

/* Inline errors */
.gl-lead .gl-lead__error {
  display: flex;
  align-items: flex-start;
  gap: 0.4em;
  margin: 0.5em 0 0;
  padding: 0;
  font-size: 0.8125em;
  font-weight: 500;
  line-height: 1.4;
  color: var(--gl-lead-error);
}

.gl-lead .gl-lead__error[hidden] {
  display: none;
}

.gl-lead .gl-lead__error-icon {
  flex: none;
  width: 1.2em;
  height: 1.2em;
  fill: currentColor;
}

/* Footer */
.gl-lead .gl-lead__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1em;
  margin: 2.25em 0 0;
}

.gl-lead .gl-lead__send-error {
  flex: 1 1 16em;
  margin: 0;
}

/* Confirmation: fields stay in place (hidden) so the form keeps its height */
.gl-lead .gl-lead__form--sent .gl-lead__grid,
.gl-lead .gl-lead__form--sent .gl-lead__footer {
  visibility: hidden;
}

.gl-lead .gl-lead__success {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin: 0;
  padding: clamp(24px, 7cqi, 48px);
  text-align: center;
  animation: gl-lead-fade-in 0.3s var(--gl-lead-ease);
}

.gl-lead .gl-lead__success[hidden] {
  display: none;
}

.gl-lead .gl-lead__success:focus {
  outline: none; /* receives focus only so screen readers read it */
}

.gl-lead .gl-lead__success-icon {
  width: 3em;
  height: 3em;
  margin: 0 0 0.5em;
  fill: var(--gl-lead-accent);
}

.gl-lead .gl-lead__success-title {
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: 1.25em;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--gl-lead-ink);
}

.gl-lead .gl-lead__success-text {
  max-width: 28em;
  margin: 0;
  padding: 0;
  font-size: 0.9375em;
  line-height: 1.5;
  color: var(--gl-lead-muted);
}

@keyframes gl-lead-fade-in {
  from { opacity: 0; transform: translateY(4px); }
}

/* Button */
.gl-lead .gl-lead__submit {
  appearance: none;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  width: 100%;
  min-height: 3.125em;
  margin: 0;
  padding: 0.8125em 1.5em 0.8125em 1.75em;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
  text-transform: none;
  text-decoration: none;
  color: #ffffff;
  background: var(--gl-lead-ink);
  border: 0;
  border-radius: 10px;
  outline: 2px solid transparent;
  outline-offset: 3px;
  cursor: pointer;
  transition:
    background-color 0.25s var(--gl-lead-ease),
    box-shadow 0.25s var(--gl-lead-ease),
    transform 0.25s var(--gl-lead-ease);
}

@container (min-width: 500px) {
  .gl-lead .gl-lead__submit {
    width: auto;
  }
}

.gl-lead .gl-lead__submit:hover {
  background: var(--gl-lead-muted);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.12) inset,
    0 1px 2px rgb(0 0 0 / 0.25),
    0 12px 24px -8px rgb(0 0 0 / 0.45);
}

.gl-lead .gl-lead__submit:active {
  transform: translateY(1px);
}

.gl-lead .gl-lead__submit:focus-visible {
  outline-color: var(--gl-lead-accent);
}

.gl-lead .gl-lead__submit-label {
  margin: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}

.gl-lead .gl-lead__arrow {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--gl-lead-ease);
}

.gl-lead .gl-lead__submit:hover .gl-lead__arrow {
  transform: translateX(3px);
}

/* Submitting state: arrow becomes a spinner */
.gl-lead .gl-lead__submit[aria-disabled="true"] {
  cursor: progress;
  background: var(--gl-lead-accent);
}

.gl-lead .gl-lead__submit[aria-disabled="true"] .gl-lead__arrow {
  display: none;
}

.gl-lead .gl-lead__submit[aria-disabled="true"]::after {
  content: "";
  width: 1em;
  height: 1em;
  border: 1.75px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: gl-lead-spin 0.7s linear infinite;
}

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

/* Screen-reader-only text */
.gl-lead .gl-lead__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .gl-lead .gl-lead__input,
  .gl-lead .gl-lead__submit,
  .gl-lead .gl-lead__arrow {
    transition: none;
  }

  .gl-lead .gl-lead__submit:hover .gl-lead__arrow,
  .gl-lead .gl-lead__submit:active {
    transform: none;
  }

  .gl-lead .gl-lead__submit[aria-disabled="true"]::after,
  .gl-lead .gl-lead__success {
    animation: none;
  }
}

@media (forced-colors: active) {
  .gl-lead .gl-lead__submit {
    border: 1px solid ButtonText;
  }

  .gl-lead .gl-lead__input[aria-invalid="true"] {
    border-width: 2px;
  }
}
