/* ==========================================================================
   EVX contact form — premium editorial style, matching the homepage idiom.
   Scope: .evx-contact-section only (plus the article it widens).
   ========================================================================== */

/* Widen the contact-page article so the form has room for a compact 3-up
   project grid instead of a tall single column. The contact information
   below the form uses the same column and stays readable. */
body main article.node-contact-page {
  max-width: 1120px !important;
  padding: 28px 24px 56px !important;
}

/* Hide the Mercury page-title block ("联系我们") on the contact page; the
   enlarged intro line below replaces it as the heading. */
body main .layout-content:has(.node-contact-page) #block-mercury-page-title {
  display: none !important;
}

.evx-contact-section {
  max-width: 1120px;
  margin: 24px auto 20px;
  padding: 0;
  box-sizing: border-box;
}

/* Card shell */
.evx-contact-section .evx-contact-form {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 26px;
  margin-top: 0;
  padding: 36px 38px 34px;
  background: #ffffff;
  border: 1px solid #e6e9ef;
  border-radius: 22px;
  box-shadow: 0 30px 70px -40px rgba(6, 30, 55, .35);
  box-sizing: border-box;
  overflow: hidden;
}

/* Navy accent band across the top of the card */
.evx-contact-section .evx-contact-form::before {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #004899 0%, #005fbe 55%, #2f9bff 100%);
  content: "";
}

/* Full-width rows */
.evx-contact-section .evx-contact-intro,
.evx-contact-section .evx-contact-privacy,
.evx-contact-section .form-item-message,
.evx-contact-section .form-actions,
.evx-contact-section .evx-contact-hp,
.evx-contact-section .form-item-consent {
  grid-column: 1 / -1;
}

.evx-contact-section .evx-contact-intro {
  margin: 0 0 4px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eef0f3;
  color: #0f2b4d !important;
  font-size: 24px !important;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.35 !important;
}

.evx-contact-section .form-item {
  margin: 0;
  min-width: 0;
}

.evx-contact-section label {
  display: block;
  margin-bottom: 7px;
  color: #0b2a4a;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .01em;
}

.evx-contact-section .form-required::after {
  content: " *";
  color: #d92d20;
}

.evx-contact-section input[type="text"],
.evx-contact-section input[type="email"],
.evx-contact-section input[type="tel"],
.evx-contact-section select,
.evx-contact-section textarea {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid #cdd7e2;
  border-radius: 10px;
  background: #fbfdff;
  color: #0f172a;
  font: inherit;
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.evx-contact-section input:hover,
.evx-contact-section select:hover,
.evx-contact-section textarea:hover {
  border-color: #9fb6cc;
}

.evx-contact-section input:focus,
.evx-contact-section select:focus,
.evx-contact-section textarea:focus {
  outline: none;
  border-color: #005fbe;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 95, 190, .13);
}

.evx-contact-section textarea {
  min-height: 96px;
  resize: vertical;
}

.evx-contact-section input::placeholder,
.evx-contact-section textarea::placeholder {
  color: #a6b0ba;
  opacity: 1;
}

.evx-contact-section .description {
  margin-top: 6px;
  color: #7c8791;
  font-size: 12px;
  line-height: 1.5;
}

/* Submit button */
.evx-contact-section .form-actions {
  margin: 4px 0 0;
}

.evx-contact-section .form-actions .button {
  min-width: 180px;
  padding: 14px 30px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, #005fbe 0%, #004899 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(0, 79, 170, .7);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.evx-contact-section .form-actions .button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 16px 28px -12px rgba(0, 79, 170, .8);
}

.evx-contact-section .evx-contact-privacy {
  margin: 2px 0 0;
  color: #8a939c;
  font-size: 12px;
  line-height: 1.6;
}

.evx-contact-section .evx-contact-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

/* ---- Project details fieldset: 3-up grid on desktop to cut height ---- */
.evx-contact-section .evx-contact-project {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  padding: 22px 22px 24px;
  border: 1px solid #e3e8ee;
  border-radius: 14px;
  background: #f7f9fc;
}

/* Drupal wraps fieldset children in .fieldset-wrapper, so the grid must be
   applied there (not to the fieldset element itself). */
.evx-contact-section .evx-contact-project > .fieldset-wrapper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 22px;
}

.evx-contact-section .evx-contact-project > legend {
  padding: 0 10px;
  color: #0b2a4a;
  font-size: 14.5px;
  font-weight: 700;
}

.evx-contact-section .evx-contact-project > .description {
  margin: -6px 0 2px;
}

/* Consent + honeypot */
.evx-contact-section .form-item-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.evx-contact-section .form-item-consent label {
  display: inline;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.evx-contact-section .form-item-consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: #005fbe;
}

/* ---- Responsive ---- */

@media (max-width: 980px) {
  .evx-contact-section .evx-contact-project > .fieldset-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .evx-contact-section {
    margin: 32px auto 14px;
    padding: 0 16px;
  }

  .evx-contact-section .evx-contact-form {
    grid-template-columns: 1fr;
    padding: 28px 20px 24px;
    gap: 16px;
    border-radius: 18px;
  }

  .evx-contact-section .evx-contact-privacy,
  .evx-contact-section .form-item-message,
  .evx-contact-section .form-actions,
  .evx-contact-section .form-item-consent {
    grid-column: 1;
  }

  .evx-contact-section .evx-contact-project {
    padding: 16px;
  }

  .evx-contact-section .evx-contact-project > .fieldset-wrapper {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .evx-contact-section .form-actions .button {
    width: 100%;
  }
}
