/* ==========================================================================
   Contact page — single "Reach Out" section: centered intro + glass-panel
   form on the left, a premium branded map frame on the right. Short,
   hero-family section (dark background, same visual language as the home
   hero and about-hero) but intentionally NOT full hero height — this page
   has one job, so it doesn't need one.
   ========================================================================== */

.contact-hero {
  position: relative;
  /* Trimmed from +space-2/space-4 — the form + map now need to fit
     inside one viewport on load, so the hero can't spend as much
     padding on top/bottom breathing room as a full hero section would. */
  padding-top: calc(var(--header-h) + 10px);
  padding-bottom: var(--space-3);
  background: var(--navy-900);
  overflow: hidden;
  color: var(--text-on-dark);
}

@media (max-width: 640px) {
  .contact-hero {
    padding-top: calc(var(--header-h) + 10px);
    padding-bottom: var(--space-2);
  }
}

/* Same family as home/about hero backgrounds, recentered so the glow sits
   behind the map column rather than mirroring an existing page exactly. */
.contact-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(50% 55% at 82% 15%, rgba(0, 163, 255, 0.18) 0%, rgba(0, 163, 255, 0) 62%),
    radial-gradient(45% 45% at 8% 95%, rgba(38, 56, 128, 0.4) 0%, rgba(38, 56, 128, 0) 65%),
    linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 45%, var(--navy-900) 100%);
}

.contact-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(60% 65% at 50% 0%, black 0%, transparent 78%);
}

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

/* ---------- Grid: intro + form on the left, map on the right ---------- */
.contact-grid-hero {
  display: grid;
  /* Form column now gets the larger share and the map the smaller —
     the map was reading wider than the fixed-width form/card content
     actually needed, which pushed the whole section too wide and,
     via align-items: stretch, too tall. */
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-4);
  align-items: stretch;
}

@media (max-width: 960px) {
  .contact-grid-hero {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

.contact-col--form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Intro: heading + two-line address, centered ---------- */
.contact-intro {
  width: 100%;
  max-width: 460px;
  text-align: center;
  margin-bottom: 16px;
}

.contact-heading {
  font-family: var(--font-display);
  /* Deliberately NOT the site's default 700 heading weight — the brief
     calls for something quieter/lighter here, so this overrides
     base.css's h1 rule directly rather than inheriting it. Size is
     fs-h3, scaled down further still — this section has one job, so
     the heading doesn't need hero-level presence, and the smaller
     size also buys back vertical space so the form + map fit in one
     viewport on load. */
  font-weight: 400;
  font-size: calc(var(--fs-h3) * 0.82);
  letter-spacing: var(--ls-tight);
  /* Softened from solid white to an ash grey so it reads as quiet
     rather than shouting — blended from the same white/mist pairing
     already used across this section, with a plain fallback colour
     for browsers without color-mix(). */
  color: #C7CBD3;
  color: color-mix(in srgb, var(--white) 60%, var(--mist) 40%);
  margin-bottom: 10px;
}

/* The em dash reads as a quiet typographic flourish, not a second
   headline — sized and coloured down relative to the heading text
   rather than inheriting its full weight. */
.contact-heading .dash {
  display: inline-block;
  font-size: 0.6em;
  font-weight: 400;
  color: var(--mist);
  margin-left: 4px;
  vertical-align: 0.08em;
}

.contact-address {
  font-size: var(--fs-body-sm);
  color: var(--mist);
  line-height: var(--lh-normal);
}

.contact-address-line {
  display: block;
  margin: 0;
}

.contact-address-line + .contact-address-line {
  margin-top: 4px;
}

.contact-address a {
  color: var(--mist);
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease-out);
}

.contact-address a:hover,
.contact-address a:focus-visible {
  color: var(--electric-2);
}

.contact-address .divider {
  color: var(--mist-dim);
  margin: 0 8px;
}

/* ---------- Form card (glass panel) ---------- */
.contact-form-card {
  width: 100%;
  max-width: 460px;
  background: var(--glass-fill);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}

@media (max-width: 480px) {
  .contact-form-card {
    padding: var(--space-2);
  }
}

.contact-form .form-field {
  /* Tightened further below the space-2 (16px) token — the form has
     six fields and needs to fit in one viewport alongside the map,
     not just look shorter than it. */
  margin-bottom: 10px;
}

/* Direct-child combinator on purpose — .ms-option below is also a
   <label> (for its checkbox), several levels deeper inside
   .form-field, and must not inherit this field-label treatment. */
.contact-form .form-field > label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 4px;
}

.contact-form .form-field input,
.contact-form .form-field select,
.contact-form .form-field textarea {
  width: 100%;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border-dark-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  color: var(--white);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.contact-form .form-field textarea {
  resize: vertical;
  min-height: 50px;
}

.contact-form .form-field input::placeholder,
.contact-form .form-field textarea::placeholder {
  color: var(--mist-dim);
}

.contact-form .form-field input:hover,
.contact-form .form-field select:hover,
.contact-form .form-field textarea:hover {
  border-color: var(--border-dark-strong);
  background: rgba(255, 255, 255, 0.07);
}

.contact-form .form-field input:focus,
.contact-form .form-field select:focus,
.contact-form .form-field textarea:focus {
  outline: none;
  border-color: var(--electric-2);
  background: rgba(255, 255, 255, 0.08);
}

.contact-form .form-field input:invalid:not(:placeholder-shown) {
  border-color: #E0685F;
}

/* Custom select chevron (native <select> restyled to match the dark
   glass inputs — appearance:none + a positioned SVG icon). */
.select-wrap {
  position: relative;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  cursor: pointer;
}

/* The <select> itself is styled fine, but the native popup list of
   <option>s ignores the dark input background and falls back to the
   browser/OS default (usually white) — leaving white-on-white text
   until a row is hovered. Setting colors on the options directly
   fixes that in every browser that renders a themeable popup. */
.select-wrap select option {
  background-color: var(--navy-800);
  color: var(--white);
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--mist);
  pointer-events: none;
}

/* ---------- Product multi-select (custom, checkbox-based) ----------
   A native <select multiple> can't show a friendly "3 products
   selected" summary and reads poorly on a touch device, so this is a
   small accessible dropdown: a trigger styled exactly like the other
   inputs, and a checkbox listbox panel beneath it. */
.ms-select {
  position: relative;
}

.ms-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border-dark-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  color: var(--white);
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.ms-trigger:hover {
  background: rgba(255, 255, 255, 0.07);
}

.ms-select.is-open .ms-trigger,
.ms-trigger:focus-visible {
  outline: none;
  border-color: var(--electric-2);
  background: rgba(255, 255, 255, 0.08);
}

.ms-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--mist);
}

.ms-trigger-text.has-value {
  color: var(--white);
}

.ms-trigger svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--mist);
  transition: transform var(--dur-fast) var(--ease-out);
}

.ms-select.is-open .ms-trigger svg {
  transform: rotate(180deg);
}

.ms-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: var(--z-elevated);
  display: flex;
  flex-direction: column;
  /* Capped noticeably shorter than before, and now made of a
     scrollable option list plus a pinned Done button — so the panel
     can never grow tall enough to bury the rest of the form, and
     there's always an obvious, explicit way to close it besides
     clicking elsewhere. */
  max-height: 210px;
  background: var(--navy-800);
  border: 1px solid var(--border-dark-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}

/* display:flex above ties in specificity with the browser's built-in
   [hidden] { display: none } rule and wins on cascade order, which
   would otherwise leave the panel visibly open even once JS sets the
   hidden attribute. Restore the hide explicitly. */
.ms-panel[hidden] {
  display: none;
}

.ms-options {
  overflow-y: auto;
  flex: 1 1 auto;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: 400;
  letter-spacing: var(--ls-normal);
  text-transform: none;
  color: var(--mist);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.ms-option:hover {
  background: var(--glass-fill-strong);
  color: var(--white);
}

.ms-option input[type='checkbox'] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--electric);
  cursor: pointer;
}

.ms-option.is-selected {
  color: var(--white);
  background: rgba(0, 163, 255, 0.1);
}

.ms-done {
  flex-shrink: 0;
  width: 100%;
  margin-top: 6px;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(0, 163, 255, 0.14);
  color: var(--electric-2);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.ms-done:hover,
.ms-done:focus-visible {
  background: rgba(0, 163, 255, 0.22);
  outline: none;
}

/* ---------- Submit ---------- */
.contact-submit-row {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.contact-submit-row .btn {
  min-width: 148px;
}

.contact-form .form-status {
  text-align: center;
  margin-top: 4px;
  font-size: var(--fs-body-sm);
  min-height: 1.2em;
}

.contact-form .form-status[data-state='success'] {
  color: #5FE3A6;
}

.contact-form .form-status[data-state='error'] {
  color: #F09088;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Map column ---------- */
.contact-col--map {
  /* Grid align-items:stretch makes this match the form card's height
     on desktop — this is just a sensible floor, brought down again
     (320px → 260px) so the map's own minimum can't force the section
     taller than the trimmed-down form actually needs. */
  min-height: 260px;
}

.contact-map-frame {
  position: relative;
  height: 100%;
  min-height: 260px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-dark-strong);
  box-shadow: var(--shadow-lg), var(--shadow-glow-soft);
}

.contact-map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  /* Subtle desaturation so the stock map reads as part of the brand
     rather than a plain embedded widget. */
  filter: grayscale(0.35) saturate(1.15) brightness(0.92) contrast(1.05);
}

/* Blue tint laid over the map — pointer-events:none so the map beneath
   stays fully interactive (pan/zoom/click) despite the overlay. */
.contact-map-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(38, 56, 128, 0.22) 0%, rgba(0, 163, 255, 0.08) 55%, rgba(7, 11, 21, 0.28) 100%);
  mix-blend-mode: color;
}

.contact-map-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(7, 11, 21, 0.55);
}

/* Floating locator card, bottom-left of the map frame. */
.map-badge {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  z-index: 2;
  max-width: min(280px, calc(100% - var(--space-5)));
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(10, 15, 30, 0.72);
  border: 1px solid var(--border-dark-strong);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
}

.map-badge__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-pin-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--status-green);
}

.map-pin-dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: var(--status-green);
  opacity: 0.35;
  animation: map-pin-pulse 2.2s ease-out infinite;
}

@keyframes map-pin-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.45;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-pin-dot::after {
    animation: none;
    opacity: 0;
  }
}

.map-badge__head strong {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
}

.map-badge p {
  font-size: 0.8125rem;
  color: var(--mist);
  line-height: var(--lh-snug);
}

.map-badge__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--electric-2);
  transition: gap var(--dur-fast) var(--ease-out);
}

.map-badge__link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform var(--dur-base) var(--ease-out);
}

.map-badge__link:hover svg,
.map-badge__link:focus-visible svg {
  transform: translateX(3px);
}

@media (max-width: 960px) {
  .contact-col--map {
    min-height: 260px;
  }
  .contact-map-frame {
    min-height: 260px;
  }
}
