/*
 * AH Digital — Contact Page v1
 */

.ah-contact-page,
.ah-contact-page * {
  box-sizing: border-box;
}

.ah-contact-page {
  overflow-x: clip;
  background: var(--ah-color-bg);
  color: var(--ah-color-text);
}

.ah-contact-page :where(h1, h2, h3, p) {
  margin-block-start: 0;
}

.ah-contact-page :where(div, section, form, fieldset) {
  min-width: 0;
}

.ah-contact-eyebrow {
  color: var(--ah-color-brand);
  font-family: var(--ah-font-mono);
  font-size: clamp(0.66rem, 0.62rem + 0.1vw, 0.74rem);
  font-weight: 750;
  letter-spacing: 0.085em;
}

/* Hero / layout */
.ah-contact-hero {
  position: relative;
  padding-block: clamp(72px, 8vw, 124px);
  background:
    radial-gradient(circle at 16% 18%, color-mix(in srgb, var(--ah-color-brand) 8%, transparent), transparent 28%),
    radial-gradient(circle at 88% 48%, color-mix(in srgb, var(--ah-color-intelligence) 5%, transparent), transparent 30%),
    var(--ah-color-bg);
}

.ah-contact-hero::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--ah-color-border) 54%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ah-color-border) 54%, transparent) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 93%);
  pointer-events: none;
}

.ah-contact-hero > .ah-container {
  position: relative;
  z-index: 1;
}

.ah-contact-hero__layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.64fr) minmax(0, 1.36fr);
  align-items: start;
  gap: clamp(50px, 7vw, 108px);
}

.ah-contact-hero__intro {
  position: sticky;
  inset-block-start: 112px;
}

.ah-contact-hero__intro h1 {
  max-width: 8.5ch;
  margin-block: 18px 0;
  color: var(--ah-color-text);
  font-size: clamp(3.2rem, 5.25vw, 5.9rem);
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.ah-contact-hero__lead {
  max-width: 48ch;
  margin-block-start: 26px;
  color: var(--ah-color-text-secondary);
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.12rem);
  line-height: 1.72;
}

.ah-contact-hero__principle {
  display: grid;
  gap: 7px;
  margin-block-start: 34px;
  border-inline-start: 2px solid var(--ah-color-intelligence);
  padding-inline-start: 18px;
}

.ah-contact-hero__principle span {
  color: var(--ah-color-brand);
  font-family: var(--ah-font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.ah-contact-hero__principle strong {
  max-width: 30ch;
  color: var(--ah-color-text);
  font-size: 1rem;
  line-height: 1.45;
}

.ah-contact-channels {
  display: grid;
  margin-block-start: 38px;
  border-block-start: 1px solid var(--ah-color-border);
}

.ah-contact-channels a {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-block-end: 1px solid var(--ah-color-border);
  color: var(--ah-color-text);
  padding-block: 15px;
  text-decoration: none;
}

.ah-contact-channels a > span {
  color: var(--ah-color-text-muted);
  font-family: var(--ah-font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.ah-contact-channels a > strong {
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.ah-contact-channels a > i {
  color: var(--ah-color-text-muted);
  font-style: normal;
}

.ah-contact-channels a:hover strong,
.ah-contact-channels a:focus-visible strong {
  color: var(--ah-color-brand);
}

.ah-contact-availability {
  margin-block-start: 28px;
}

.ah-contact-availability p {
  margin-block-start: 8px;
  color: var(--ah-color-text-secondary);
  font-size: 0.8rem;
}

/* Form shell */
.ah-contact-form-shell {
  overflow: hidden;
  border: 1px solid var(--ah-color-border);
  border-radius: 30px;
  background: var(--ah-color-surface);
  box-shadow: var(--ah-shadow-feature);
}

.ah-contact-form-shell__head {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-block-end: 1px solid var(--ah-color-border);
  padding: 16px clamp(22px, 3vw, 34px);
}

.ah-contact-form-shell__head > div {
  display: grid;
  gap: 4px;
}

.ah-contact-form-shell__head > div > span {
  color: var(--ah-color-brand);
  font-family: var(--ah-font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.ah-contact-form-shell__head > div > strong {
  font-size: 1rem;
}

.ah-contact-form {
  display: grid;
}

.ah-contact-hp {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.ah-contact-fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  border-block-end: 1px solid var(--ah-color-border);
  padding: clamp(28px, 4vw, 44px);
}

.ah-contact-fieldset legend {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 3px 12px;
  width: 100%;
  color: var(--ah-color-text);
  padding: 0;
}

.ah-contact-fieldset legend > span {
  grid-row: 1 / 3;
  color: var(--ah-color-brand);
  font-family: var(--ah-font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding-block-start: 4px;
}

.ah-contact-fieldset legend > strong {
  font-size: clamp(1.1rem, 1.2vw, 1.28rem);
  line-height: 1.35;
}

.ah-contact-fieldset legend > small {
  color: var(--ah-color-text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

/* Services */
.ah-contact-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-block-start: 26px;
}

.ah-contact-service {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 82px;
  cursor: pointer;
  border: 1px solid var(--ah-color-border);
  border-radius: 16px;
  background: var(--ah-color-surface-soft);
  padding: 14px;
  transition:
    border-color var(--ah-duration-fast) var(--ah-ease-standard),
    background-color var(--ah-duration-fast) var(--ah-ease-standard),
    transform var(--ah-duration-fast) var(--ah-ease-standard);
}

.ah-contact-service:hover {
  border-color: color-mix(in srgb, var(--ah-color-brand) 40%, var(--ah-color-border));
}

.ah-contact-service:has(input:focus-visible) {
  outline: 2px solid var(--ah-color-focus);
  outline-offset: 3px;
}

.ah-contact-service:has(input:checked) {
  border-color: color-mix(in srgb, var(--ah-color-brand) 58%, var(--ah-color-border));
  background: color-mix(in srgb, var(--ah-color-brand) 8%, var(--ah-color-surface));
}

.ah-contact-service input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ah-contact-service__box {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--ah-color-border);
  border-radius: 8px;
  color: var(--ah-color-text-muted);
  font-size: 1rem;
  font-weight: 500;
}

.ah-contact-service:has(input:checked) .ah-contact-service__box {
  border-color: var(--ah-color-brand);
  background: var(--ah-color-brand);
  color: #fff;
}

.ah-contact-service:has(input:checked) .ah-contact-service__box {
  font-size: 0;
}

.ah-contact-service:has(input:checked) .ah-contact-service__box::before {
  content: "✓";
  font-size: 0.9rem;
}

.ah-contact-service__copy {
  display: grid;
  gap: 3px;
}

.ah-contact-service__copy strong {
  color: var(--ah-color-text);
  font-size: 0.86rem;
}

.ah-contact-service__copy small {
  color: var(--ah-color-text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.ah-contact-selection {
  margin-block-start: 20px;
  border: 1px dashed var(--ah-color-border-strong);
  border-radius: 14px;
  padding: 14px;
}

.ah-contact-selection > span {
  color: var(--ah-color-text-muted);
  font-family: var(--ah-font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ah-contact-selection > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 10px;
}

.ah-contact-selection button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--ah-color-border);
  border-radius: var(--ah-radius-pill);
  background: var(--ah-color-surface);
  color: var(--ah-color-text);
  cursor: pointer;
  font-family: var(--ah-font-mono);
  font-size: 0.62rem;
  padding: 7px 10px;
}

.ah-contact-selection button span {
  color: var(--ah-color-text-muted);
}

.ah-contact-unsure {
  margin-block-start: 16px;
  border: 0;
  background: transparent;
  color: var(--ah-color-text-secondary);
  cursor: pointer;
  font-size: 0.76rem;
  padding: 0;
  text-align: start;
  text-decoration: underline;
  text-decoration-color: var(--ah-color-border-strong);
  text-underline-offset: 4px;
}

/* Goals / stage */
.ah-contact-goals,
.ah-contact-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-block-start: 24px;
}

.ah-contact-goals label,
.ah-contact-stage label {
  position: relative;
  cursor: pointer;
}

.ah-contact-goals input,
.ah-contact-stage input {
  position: absolute;
  opacity: 0;
}

.ah-contact-goals span,
.ah-contact-stage span {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--ah-color-border);
  border-radius: var(--ah-radius-pill);
  background: var(--ah-color-surface-soft);
  color: var(--ah-color-text-secondary);
  font-size: 0.76rem;
  padding: 8px 13px;
}

.ah-contact-goals label:has(input:checked) span,
.ah-contact-stage label:has(input:checked) span {
  border-color: var(--ah-color-brand);
  background: color-mix(in srgb, var(--ah-color-brand) 8%, var(--ah-color-surface));
  color: var(--ah-color-text);
}

.ah-contact-goals label:has(input:focus-visible) span,
.ah-contact-stage label:has(input:focus-visible) span {
  outline: 2px solid var(--ah-color-focus);
  outline-offset: 3px;
}

/* Inputs */
.ah-contact-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-block-start: 26px;
}

.ah-contact-field {
  display: grid;
  gap: 8px;
}

.ah-contact-field--full {
  grid-column: 1 / -1;
}

.ah-contact-field label {
  color: var(--ah-color-text);
  font-size: 0.76rem;
  font-weight: 650;
}

.ah-contact-field input,
.ah-contact-field textarea {
  width: 100%;
  border: 1px solid var(--ah-color-border);
  border-radius: 12px;
  background: var(--ah-color-surface-soft);
  color: var(--ah-color-text);
  font: inherit;
  outline: none;
  transition:
    border-color var(--ah-duration-fast) var(--ah-ease-standard),
    box-shadow var(--ah-duration-fast) var(--ah-ease-standard),
    background-color var(--ah-duration-fast) var(--ah-ease-standard);
}

.ah-contact-field input {
  min-height: 52px;
  padding-inline: 14px;
}

.ah-contact-field textarea {
  min-height: 190px;
  resize: vertical;
  padding: 14px;
  line-height: 1.65;
}

.ah-contact-field input:focus,
.ah-contact-field textarea:focus {
  border-color: var(--ah-color-brand);
  background: var(--ah-color-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ah-color-brand) 10%, transparent);
}

.ah-contact-field textarea::placeholder,
.ah-contact-field input::placeholder {
  color: var(--ah-color-text-muted);
  opacity: 0.82;
}

.ah-contact-field--message {
  margin-block-start: 24px;
}

.ah-contact-message-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  color: var(--ah-color-text-muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

/* Submit */
.ah-contact-submit {
  display: grid;
  gap: 18px;
  padding: clamp(28px, 4vw, 42px);
}

.ah-contact-submit > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ah-font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.ah-contact-submit > div span {
  color: var(--ah-color-text-muted);
}

.ah-contact-submit > div strong {
  color: var(--ah-color-signal);
}

.ah-contact-submit > div i {
  width: clamp(14px, 2vw, 30px);
  height: 1px;
  background: linear-gradient(90deg, var(--ah-color-brand), var(--ah-color-intelligence));
}

.ah-contact-submit > p {
  max-width: 70ch;
  color: var(--ah-color-text-muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.ah-contact-submit > p a {
  color: var(--ah-color-text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ah-contact-submit .ah-button {
  justify-self: start;
}

/* Notices */
.ah-contact-notice {
  margin: 24px 24px 0;
  border: 1px solid var(--ah-color-border);
  border-radius: 14px;
  padding: 16px 18px;
}

.ah-contact-notice strong {
  display: block;
  font-size: 0.9rem;
}

.ah-contact-notice p {
  margin-block-start: 5px;
  color: var(--ah-color-text-secondary);
  font-size: 0.78rem;
}

.ah-contact-notice--success {
  border-color: color-mix(in srgb, var(--ah-color-signal) 42%, var(--ah-color-border));
  background: color-mix(in srgb, var(--ah-color-signal) 5%, var(--ah-color-surface));
}

.ah-contact-notice--error {
  border-color: color-mix(in srgb, #d55353 45%, var(--ah-color-border));
}

/* Trust strip */
.ah-contact-trust {
  padding-block: 0 clamp(76px, 8vw, 120px);
}

.ah-contact-trust__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--ah-color-border);
  border-radius: 24px;
  background: var(--ah-color-surface);
}

.ah-contact-trust__grid > div {
  min-height: 230px;
  padding: clamp(26px, 3vw, 36px);
}

.ah-contact-trust__grid > div + div {
  border-inline-start: 1px solid var(--ah-color-border);
}

.ah-contact-trust__grid span {
  color: var(--ah-color-brand);
  font-family: var(--ah-font-mono);
  font-size: 0.66rem;
  font-weight: 800;
}

.ah-contact-trust__grid strong {
  display: block;
  margin-block-start: 42px;
  color: var(--ah-color-text);
  font-size: 1.2rem;
}

.ah-contact-trust__grid p {
  margin-block-start: 12px;
  color: var(--ah-color-text-secondary);
  font-size: 0.84rem;
  line-height: 1.65;
}

/* Laptop / zoom-safe */
@media (max-width: 1180px) {
  .ah-contact-hero__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-contact-hero__intro {
    position: static;
    max-width: 820px;
  }

  .ah-contact-hero__intro h1 {
    max-width: 12ch;
  }

  .ah-contact-form-shell {
    width: min(100%, 980px);
  }
}

@media (min-width: 900px) and (max-height: 760px) {
  .ah-contact-hero {
    padding-block: 58px 74px;
  }

  .ah-contact-hero__intro {
    position: static;
  }
}

/* Tablet */
@media (max-width: 900px) {
  .ah-contact-services {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-contact-trust__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-contact-trust__grid > div {
    min-height: 0;
  }

  .ah-contact-trust__grid > div + div {
    border-inline-start: 0;
    border-block-start: 1px solid var(--ah-color-border);
  }
}

/* Mobile */
@media (max-width: 767px) {
  .ah-contact-hero {
    padding-block: 62px 70px;
  }

  .ah-contact-hero__intro h1 {
    max-width: 100%;
    font-size: clamp(2.65rem, 12vw, 4.1rem);
  }

  .ah-contact-form-shell {
    border-radius: 20px;
  }

  .ah-contact-form-shell__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ah-contact-fieldset {
    padding: 26px 20px;
  }

  .ah-contact-fieldset legend {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .ah-contact-fields-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-contact-field--full {
    grid-column: auto;
  }

  .ah-contact-message-meta {
    flex-direction: column;
    gap: 6px;
  }

  .ah-contact-submit {
    padding: 26px 20px;
  }

  .ah-contact-submit > div {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .ah-contact-submit > div::-webkit-scrollbar {
    display: none;
  }

  .ah-contact-submit .ah-button {
    width: 100%;
    justify-content: space-between;
  }

  .ah-contact-channels a {
    grid-template-columns: 76px minmax(0, 1fr) auto;
  }
}

@media (max-width: 480px) {
  .ah-contact-service {
    min-height: 78px;
  }

  .ah-contact-goals,
  .ah-contact-stage {
    align-items: stretch;
    flex-direction: column;
  }

  .ah-contact-goals label,
  .ah-contact-stage label,
  .ah-contact-goals span,
  .ah-contact-stage span {
    width: 100%;
  }

  .ah-contact-channels a {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ah-contact-channels a > span {
    grid-column: 1 / -1;
  }
}

@supports not selector(:has(*)) {
  .ah-contact-service input,
  .ah-contact-goals input,
  .ah-contact-stage input {
    position: static;
    opacity: 1;
    pointer-events: auto;
  }
}

@supports not (color: color-mix(in srgb, black, white)) {
  .ah-contact-hero,
  .ah-contact-service:has(input:checked),
  .ah-contact-goals label:has(input:checked) span,
  .ah-contact-stage label:has(input:checked) span {
    background: var(--ah-color-bg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ah-contact-service,
  .ah-contact-field input,
  .ah-contact-field textarea {
    transition: none;
  }
}
/*
 * AH Digital — Contact separator spacing fix v1
 *
 * Fixes the visual collision between horizontal section separators
 * and fieldset/legend headings across the Contact form.
 */

.ah-contact-fieldset {
  position: relative;
  border-block-end: 0;
}

/* Draw the separator independently from the native fieldset/legend model. */
.ah-contact-fieldset::after {
  position: absolute;
  inset-inline: clamp(20px, 3vw, 44px);
  inset-block-end: 0;
  height: 1px;
  background: var(--ah-color-border);
  content: "";
  pointer-events: none;
}

/*
 * Native <legend> rendering can visually sit on a fieldset boundary.
 * Give every section heading its own breathing zone explicitly.
 */
.ah-contact-fieldset > legend {
  box-sizing: border-box;
  padding-block-start: clamp(22px, 2vw, 30px);
  padding-block-end: clamp(4px, 0.5vw, 8px);
}

/* First group also needs separation from the form-shell header line. */
.ah-contact-fieldset:first-of-type > legend {
  padding-block-start: clamp(18px, 1.7vw, 26px);
}

/* Preserve comfortable space before the first control/content block. */
.ah-contact-fieldset > legend + * {
  margin-block-start: clamp(22px, 2vw, 28px);
}

/* Existing components already set their own margin; avoid double spacing. */
.ah-contact-fieldset > legend + .ah-contact-services,
.ah-contact-fieldset > legend + .ah-contact-goals,
.ah-contact-fieldset > legend + .ah-contact-fields-grid,
.ah-contact-fieldset > legend + .ah-contact-stage,
.ah-contact-fieldset > legend + .ah-contact-field--message {
  margin-block-start: clamp(22px, 2vw, 28px);
}

/* Keep the last field visually separated from the submit area as well. */
.ah-contact-submit {
  border-block-start: 0;
  padding-block-start: clamp(34px, 4vw, 46px);
}

/* Slightly softer inset divider for the form shell header. */
.ah-contact-form-shell__head {
  position: relative;
  border-block-end: 0;
}

.ah-contact-form-shell__head::after {
  position: absolute;
  inset-inline: clamp(20px, 3vw, 34px);
  inset-block-end: 0;
  height: 1px;
  background: var(--ah-color-border);
  content: "";
}

/* Mobile keeps the same visual rhythm, with smaller insets. */
@media (max-width: 767px) {
  .ah-contact-fieldset::after {
    inset-inline: 20px;
  }

  .ah-contact-fieldset > legend {
    padding-block-start: 20px;
  }

  .ah-contact-fieldset:first-of-type > legend {
    padding-block-start: 18px;
  }

  .ah-contact-form-shell__head::after {
    inset-inline: 20px;
  }
}

/* AH Contact — Vitrine URL prefill context v1 */
.ah-contact-prefill-context {
  display: grid;
  gap: 0.35rem;
  margin: clamp(18px, 2vw, 26px) clamp(20px, 3vw, 34px) 0;
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid color-mix(in srgb, var(--ah-color-brand, #5657E6) 28%, var(--ah-color-border, #E1E7EE));
  border-radius: 16px;
  background: color-mix(in srgb, var(--ah-color-brand, #5657E6) 6%, var(--ah-color-surface, #FFFFFF));
  color: var(--ah-color-text, #0B1020);
}

.ah-contact-prefill-context__eyebrow {
  color: var(--ah-color-brand, #5657E6);
  font-family: var(--ah-font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ah-contact-prefill-context__value {
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.35;
}

.ah-contact-prefill-context__note {
  color: var(--ah-color-text-secondary, #5E6878);
  font-size: 0.84rem;
  line-height: 1.5;
}

[data-ah-theme="dark"] .ah-contact-prefill-context,
html[data-theme="dark"] .ah-contact-prefill-context,
body[data-theme="dark"] .ah-contact-prefill-context {
  border-color: color-mix(in srgb, #20C7D6 32%, #26324A);
  background: color-mix(in srgb, #5657E6 10%, #101629);
  color: #F8FAFC;
}

[data-ah-theme="dark"] .ah-contact-prefill-context__note,
html[data-theme="dark"] .ah-contact-prefill-context__note,
body[data-theme="dark"] .ah-contact-prefill-context__note {
  color: #B9C3D3;
}

@media (max-width: 560px) {
  .ah-contact-prefill-context {
    margin-inline: 20px;
    border-radius: 14px;
  }
}
