/* ==========================================================================
   Contact: details, call/email buttons and the enquiry form (contact.js → contact.php)
   ========================================================================== */
.contact {
  position: relative;
  padding-block: 48px;
}
.contact__card {
  position: relative;
  overflow: clip;
  border-radius: 32px;
  background: var(--surface-soft);
}

/* Figma background stage: rotated fan render, multiplied at 10% */
.contact__stage {
  position: absolute;
  top: -255.57px;
  left: -202.75px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1729.826px;
  height: 1729.826px;
  mix-blend-mode: multiply;
}
.contact__stage-rotate {
  flex: none;
  rotate: 4deg;
}
.contact__stage-img {
  position: relative;
  width: 1620.719px;
  height: 1620.719px;
  opacity: 0.1;
}
.contact__stage-img img {
  position: absolute;
  inset: 0;
  object-fit: cover;
}

.contact__grid {
  position: relative;
  display: grid;
  gap: 24px;
  padding: 12px;
}
@media (min-width: 640px) {
  .contact__grid {
    padding: 24px;
  }
}
@media (min-width: 1280px) {
  .contact__grid {
    grid-template-columns: minmax(0, 1fr) 599px;
  }
}

/* ---- Left column ---- */
.contact__info {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 32px 8px 16px;
}
@media (min-width: 640px) {
  .contact__info {
    padding-inline: 24px;
  }
}
@media (min-width: 768px) {
  .contact__info {
    gap: 60px;
  }
}
@media (min-width: 1280px) {
  .contact__info {
    max-width: 610px;
    padding-top: 48px;
    padding-left: 48px;
  }
}
.contact__heading {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact__title {
  font-weight: var(--fw-regular);
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--navy);
}
.contact__br {
  display: none;
}
@media (min-width: 640px) {
  .contact__br {
    display: block;
  }
}
@media (min-width: 768px) {
  .contact__title {
    font-size: 64px;
    line-height: 76px;
  }
}
.contact__text {
  max-width: 500px;
  font-weight: var(--fw-news);
  font-size: 16px;
  line-height: 20px;
  color: var(--muted);
}

.contact__details {
  display: grid;
  gap: 32px;
  max-width: 585px;
}
@media (min-width: 640px) {
  .contact__details {
    grid-template-columns: max-content minmax(0, 268px);
    row-gap: 40px;
  }
}
.contact__detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact__detail-label {
  font-weight: var(--fw-regular);
  font-size: 12px;
  line-height: 16px;
  color: var(--navy-60);
  text-transform: uppercase;
}
.contact__detail-lines {
  display: flex;
  flex-direction: column;
  font-weight: var(--fw-news);
  font-size: 16px;
  line-height: 20px;
  color: var(--ink);
}
.contact__link {
  width: fit-content;
  border-radius: 2px;
  text-underline-offset: 4px;
  transition: color 0.15s;
}
.contact__link:hover {
  color: var(--royal);
  text-decoration: underline;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.contact__email-btn {
  width: 124px;
  padding-inline: 0;
}

/* ---- Form card ---- */
.contact__form-wrap {
  min-width: 0;
}
.contact__form-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 20px;
  border-radius: 16px;
  background: var(--white);
}
@media (min-width: 768px) {
  .contact__form-card {
    padding: 26px;
  }
}
@media (min-width: 1024px) {
  .contact__form-card {
    min-height: 599px;
  }
}
.contact__form-title {
  font-weight: var(--fw-regular);
  font-size: 24px;
  line-height: 30px;
  letter-spacing: -0.03em;
  color: var(--crimson);
}
@media (min-width: 768px) {
  .contact__form-title {
    font-size: 28px;
    line-height: 34px;
    letter-spacing: -0.84px;
  }
}

.contact__form {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
}
.contact__form[hidden] {
  display: none;
}
.contact__form.is-entering {
  animation: contact-fade-in 0.3s;
}
.contact__fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact__row {
  display: grid;
  gap: 14px;
}
@media (min-width: 640px) {
  .contact__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
.contact__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.contact__label {
  font-weight: var(--fw-news);
  font-size: 14px;
  line-height: 18px;
  color: var(--muted);
}

.contact__input {
  width: 100%;
  height: 50px;
  padding-inline: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  font-weight: var(--fw-news);
  font-size: 16px;
  line-height: 20px;
  color: var(--ink);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.contact__input::placeholder {
  color: var(--muted);
}
.contact__input:hover {
  border-color: var(--navy-40);
}
/* After :hover so an invalid field stays red under the mouse; :focus below still wins while typing. */
.contact__input[aria-invalid="true"] {
  border-color: var(--crimson);
}
.contact__input:focus {
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(0, 131, 213, 0.15);
  outline: none;
}
.contact__input--textarea {
  height: 120px;
  padding-block: 12px;
  resize: none;
}
.contact__select {
  position: relative;
}
.contact__input--select {
  padding-right: 40px;
  appearance: none;
}
.contact__input--select.is-empty {
  color: var(--muted);
}
.contact__select-chevron {
  position: absolute;
  top: 25px;
  right: 12px;
  width: 24px;
  height: 24px;
  opacity: 0.6;
  pointer-events: none;
  translate: 0 -50%;
  rotate: 90deg;
  transition:
    rotate 0.3s var(--ease-smooth),
    opacity 0.3s var(--ease-smooth);
}

/* ---- Custom select (built by contact.js; the native select stays hidden as the form value) ---- */
.contact__select.is-enhanced > select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.contact-select__trigger {
  display: flex;
  align-items: center;
  padding-right: 44px;
  text-align: left;
  cursor: pointer;
}
.contact-select__value {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.contact-select__trigger.is-empty .contact-select__value {
  color: var(--muted);
}
.contact__select.is-open .contact-select__trigger {
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(0, 131, 213, 0.15);
}
.contact__select.is-open .contact__select-chevron {
  opacity: 1;
  rotate: -90deg;
}

/* Option list: same card language as the header's Company dropdown */
.contact-select__list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 5;
  max-height: 340px;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 12px 32px -12px rgba(32, 73, 137, 0.35);
  scrollbar-width: thin;
  scrollbar-color: var(--navy-40) transparent;
  opacity: 0;
  translate: 0 -6px;
  scale: 0.98;
  transform-origin: top center;
  transition:
    opacity 0.22s var(--ease-smooth),
    translate 0.22s var(--ease-smooth),
    scale 0.22s var(--ease-smooth);
}
.contact__select.is-above .contact-select__list {
  top: auto;
  bottom: calc(100% + 8px);
  translate: 0 6px;
  transform-origin: bottom center;
}
.contact__select.is-open .contact-select__list {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}
.contact-select__option {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 40px 10px 14px;
  border-radius: 10px;
  font-weight: var(--fw-news);
  font-size: 15px;
  line-height: 20px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s;
}
.contact-select__option.is-placeholder {
  color: var(--muted);
}
.contact-select__option.is-active {
  background: var(--surface-soft);
}
.contact-select__option[aria-selected="true"]:not(.is-placeholder) {
  color: var(--navy);
}
/* Royal check mark on the chosen option */
.contact-select__option[aria-selected="true"]:not(.is-placeholder)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 6px;
  height: 11px;
  margin-top: -7px;
  border-right: 2px solid var(--royal);
  border-bottom: 2px solid var(--royal);
  rotate: 45deg;
}

.contact__error {
  font-weight: var(--fw-news);
  font-size: 14px;
  line-height: 18px;
  color: var(--crimson);
  animation: contact-error-in 0.3s var(--ease-out-expo);
}
@keyframes contact-error-in {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 72px;
  }
}

/* Honeypot: off-screen, not focusable, hidden from assistive tech */
.contact__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact__submit-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact__alert {
  padding: 12px 16px;
  border: 1px solid rgba(137, 21, 56, 0.25);
  border-radius: 14px;
  background: rgba(137, 21, 56, 0.05);
  font-weight: var(--fw-news);
  font-size: 14px;
  line-height: 18px;
  color: var(--crimson);
  animation: contact-alert-in 0.3s var(--ease-out-expo);
}
@keyframes contact-alert-in {
  from {
    opacity: 0;
    translate: 0 -6px;
  }
}
.contact__submit {
  width: 100%;
  justify-content: space-between;
}
.contact__submit:disabled {
  cursor: wait;
  opacity: 0.8;
}
.contact__submit-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.contact__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: contact-spin 1s linear infinite;
}
.contact__form[aria-busy="true"] .contact__spinner {
  display: block;
}
@keyframes contact-spin {
  to {
    rotate: 360deg;
  }
}

/* ---- Success state ---- */
.contact__success {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-block: 64px;
  text-align: center;
  animation: contact-success-in 0.6s var(--ease-out-expo);
}
.contact__success[hidden] {
  display: none;
}
@keyframes contact-success-in {
  from {
    opacity: 0;
    translate: 0 16px;
    scale: 0.98;
  }
}
.contact__success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--sky-20);
  color: var(--navy);
  /* Spring-like pop (overshoots slightly) */
  animation: contact-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}
@keyframes contact-pop {
  from {
    scale: 0;
  }
}
.contact__success-icon svg {
  width: 32px;
  height: 32px;
}
.contact__success-icon path {
  stroke-dasharray: 1;
  animation: contact-draw 0.5s ease-out 0.3s backwards;
}
@keyframes contact-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
.contact__success-title {
  font-size: 20px;
  line-height: 28px;
  color: var(--navy);
}
.contact__success-text {
  max-width: 360px;
  font-weight: var(--fw-news);
  font-size: 16px;
  line-height: 20px;
  color: var(--muted);
}
.contact__again {
  margin-top: 16px;
}

@keyframes contact-fade-in {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .contact__success {
    animation-name: contact-fade-in;
  }
  .contact__success-icon,
  .contact__success-icon path {
    animation: none;
  }
}
