/* ==========================================================================
   EWD Site — "Let's Start a Project" contact form
   A deep violet panel over a huge, slowly-breathing ghost of the company
   mark (mouse-parallaxed, gated to fine pointers) with drifting ambient
   orbs behind it. HUD-style corner brackets and a slow scan sweep on the
   panel, plus a one-shot scan-line on each field's focus ring, push the
   "advanced technology" feel the client asked for.

   Submit flow is deliberately modeled on Contact Form 7's actual markup
   and behavior — the client plans to swap this static form for a real
   CF7 shortcode later, so the class names on the submission chrome
   (.wpcf7-form, .wpcf7-spinner, .wpcf7-response-output) and the pattern
   itself (spinner beside the button rather than inside it; a response
   message that appears below the form; the form staying visible and
   just clearing on success rather than being replaced by a separate
   panel) match CF7's real output so the eventual swap is close to
   drop-in. Field-level floating labels, live validation, and the
   focus/shake/HUD styling are custom chrome around that and stay
   regardless of what renders the fields.

   Self-contained; reuses the design tokens declared on :root in
   style.css (colors, easing, fonts).
   ========================================================================== */

.contact {
  position: relative;
  /* padding: 120px 0 20px; */
  padding: 100px 0 20px;
  /* background: var(--bg); */
  overflow: hidden;
}

.contact__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* overflow: hidden; */
}

.contact__logo-wrap {
  position: absolute;
  /* top: 50%; */
  top: 30%;
  left: -8vw;
  width: min(60vw, 720px);
  aspect-ratio: 50 / 52;
  transform: translateY(-50%);
  /* opacity: 0.16;
  filter: drop-shadow(0 0 90px rgba(80, 184, 72, 0.25)); */
  will-change: transform;
}

.contact__logo-svg {
  width: 100%;
  height: 100%;
  display: block;
  animation: contact-logo-breathe 12s ease-in-out infinite;
}

@keyframes contact-logo-breathe {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.045) rotate(1.4deg); }
}

.contact__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.contact__orb--a {
  top: -12%;
  right: 4%;
  width: 30vw;
  height: 30vw;
  background: radial-gradient(circle, rgba(155, 107, 255, 0.4), transparent 70%);
  animation: contact-drift-a 24s ease-in-out infinite;
}

.contact__orb--b {
  bottom: -18%;
  right: 22%;
  width: 26vw;
  height: 26vw;
  background: radial-gradient(circle, rgba(233, 107, 255, 0.28), transparent 70%);
  animation: contact-drift-b 20s ease-in-out infinite;
}

@keyframes contact-drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6%, 7%) scale(1.1); }
}

@keyframes contact-drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, -6%) scale(1.12); }
}

.contact__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr);
    align-items: end;
    /* gap: clamp(2rem, 5vw, 4rem); */
}

.contact__intro {
  /* padding-bottom: clamp(0.5rem, 2vw, 1.5rem); */
}

.contact__heading {
    font-family: var(--font-body);
    color: var(--text);
    font-size: 100px;
    font-weight: 800;
    line-height: 104px;
    letter-spacing: -4px;
    max-width: 341px;
}

.contact__info {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.contact__info-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.contact__info-label {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.contact__info-value {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ---------- Panel ---------- */

.contact__panel {
    position: relative;
    padding: 104px 80px 94px;
    overflow: hidden;
    border-radius: 15px;
    border: 1px solid #492E9F;
    background: rgba(19, 7, 60, 0.56);
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

.contact__panel-head {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 44px;
}

.contact__panel-title {
    position: relative;
    font-family: var(--font-third);
    color: var(--text);
    text-align: center;
    font-size: 52px;
    /* font-weight: 700; */
    font-weight: 600;
    line-height: 78px;
    letter-spacing: -2.08px;
    text-transform: capitalize;
}

.contact__panel-text {
    position: relative;
    color: #E8D1D1;
    font-family: var(--font-third);
    text-align: center;
    font-size: 20px;
    font-weight: 300;
    line-height: 36px;
}

/* ---------- Form ----------
   Markup here deliberately mirrors Contact Form 7's actual rendered
   output (row/col grid + form-group from the theme wrapper around the
   shortcode, .wpcf7-form-control-wrap/.wpcf7-form-control from CF7
   itself) so the client can drop in a real CF7 form later with the
   same structure and inherit this styling with no markup changes.
   Field-level required/validation messaging is intentionally NOT
   custom-built here — CF7 generates that itself once it's wired up. */

.contact__panel-form{
  margin-top: 25px;
}

.contact__form {
  position: relative;
}

.hidden-fields-container {
  display: none;
}

.contact__form .row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.contact__form .row > [class*="col-"] {
  flex: 0 0 100%;
  max-width: 100%;
}

@media (min-width: 992px) {
  .contact__form .row > .col-lg-6 {
    flex: 0 0 calc(50% - 0.55rem);
    max-width: calc(50% - 0.55rem);
  }
}

.contact__form .form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact__form .form-group > label {
    font-family: var(--font-heading);
    color: var(--text);
    font-size: 17px;
    font-weight: 500;
    line-height: 36px;
}

.contact__form .wpcf7-form-control-wrap {
  position: relative;
  display: block;
  border-radius: 6px;
  overflow: hidden;
}

.contact__form .wpcf7-form-control.form-control {
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1rem;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.92rem;
    cursor: text;
    transition: border-color 0.25s var(--ease-out), background-color 0.25s var(--ease-out);
    height: 59px;
    border-radius: 6px;
    border: 2px solid #BBB7CA;
    background: #140742;
    backdrop-filter: blur(12px);
}

/* Restores the native text caret over the site's custom cursor (see the
   text-input exclusion in hero.js initCustomCursor, which hides the
   ring/dot while over these fields). html.has-custom-cursor input sets
   cursor:none with higher specificity than the plain rule above (an
   extra type selector outweighs an extra class), so it needs an
   explicit, higher-specificity override here — without it neither
   cursor shows at all while typing. */
html.has-custom-cursor .contact__form .wpcf7-form-control.form-control {
  cursor: text;
}

.contact__form select.wpcf7-form-control.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
}

html.has-custom-cursor .contact__form select.wpcf7-form-control.form-control {
  cursor: pointer;
}

.contact__form textarea.wpcf7-form-control.form-control {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.contact__form .wpcf7-form-control.form-control:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.contact__form .wpcf7-form-control.form-control:focus {
  outline: none;
  border-color: rgba(80, 184, 72, 0.55);
  background: rgba(80, 184, 72, 0.045);
}

/* Custom dropdown arrow for the Inquiry Type select — sized/positioned
   to the control's own box (bottom: 0, full control height) so it stays
   aligned regardless of the label above it. */
.contact__form .select-drop-arrow {
  position: absolute;
  right: 1.15rem;
  bottom: 0;
  height: 2.95rem;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.contact__form .select-drop-arrow::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 1.5px solid var(--text-dim);
  border-bottom: 1.5px solid var(--text-dim);
  transform: rotate(45deg);
}

/* Animated focus ring + one-shot scan sweep, applied to the control
   wrap itself via :focus-within so no extra markup is needed inside
   the CF7-managed .wpcf7-form-control-wrap span. The wrap now clips
   (overflow: hidden, matching border-radius) so the sweep never spills
   past the field's own rounded box — the ring below sits flush with
   that same box (no outward bleed) rather than relying on overflow to
   hide an oversized halo. */
.contact__form .wpcf7-form-control-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(80, 184, 72, 0), 0 0 18px rgba(80, 184, 72, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.contact__form .wpcf7-form-control-wrap:focus-within::before {
  /* opacity: 1; */
  box-shadow: inset 0 0 0 1px rgba(80, 184, 72, 0.35), 0 0 18px rgba(80, 184, 72, 0.22);
}

.contact__form .wpcf7-form-control-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  left: -28%;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(140, 230, 130, 0.55), transparent);
  transform: translateX(-100%);
  pointer-events: none;
}

.contact__form .wpcf7-form-control-wrap:focus-within::after {
  animation: contact-field-scan 0.75s var(--ease-out);
}

.form-group.is-invalid .wpcf7-form-control-wrap:focus-within::after {
  background: linear-gradient(90deg, transparent, rgba(255, 129, 148, 0.55), transparent);
}

@keyframes contact-field-scan {
  from { transform: translateX(-100%); }
  to { transform: translateX(430%); }
}

.form-group.is-invalid .wpcf7-form-control.form-control {
  border-color: rgba(255, 107, 129, 0.6);
}

.form-group.is-invalid .wpcf7-form-control-wrap:focus-within::before {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 129, 0.4), 0 0 18px rgba(255, 107, 129, 0.2);
}

.form-group.is-shake {
  animation: form-field-shake 0.4s ease-in-out;
}

@keyframes form-field-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ---------- Submit row: button + CF7-style spinner ---------- */
/* Mirrors real Contact Form 7 markup: the spinner is a sibling of the
   submit input (shown/hidden, not swapped into it). */

.contact__form .solution-form-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    position: relative;
    width: fit-content;
    left: 50%;
    transform: translateX(-50%);
}

.contact__form input.wpcf7-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 130px;
    width: fit-content;
    color: var(--text);
    font-family: var(--font-heading);
    cursor: pointer;
    transition: 0.5s;
    border-radius: 9px;
    border: 1px solid #247E29;
    background: #274829;
    height: 65px;
    font-size: 20px;
    font-weight: 700;
    line-height: 39px;
    letter-spacing: 0.2px;
}

.contact__form input.wpcf7-submit:hover {
  background: #39b54b;
  border-color: #39b54b;
  box-shadow: 0px 0px 18px #39b54b;
}
.contact__form input.wpcf7-submit:disabled {
  cursor: default;
  opacity: 0.7;
}

.wpcf7-spinner {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.18) !important;
    border-top-color: rgb(120, 210, 110) !important;
    animation: contact-spin 0.7s linear infinite;
    position: absolute !important;
    right: 0;
}

.wpcf7-spinner[hidden] {
  display: none;
}

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

/* ---------- Response output (CF7-style: sits below the form, form   ---------- */
/* ---------- itself stays put and just clears on success)            ---------- */

.contact__form .wpcf7-response-output {
  position: relative;
  margin-top: 1.1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.55;
  border: 1px solid transparent;
}

.contact__form .wpcf7-response-output:empty {
  display: none;
}

.contact__form .wpcf7-response-output.is-success {
  color: rgb(160, 225, 150);
  background: rgba(80, 184, 72, 0.1);
  border-color: rgba(80, 184, 72, 0.35) !important;
  animation: contact-response-in 0.4s var(--ease-out);
  padding: 10px 15px;
  text-align: center;
  border-radius: 5px !important;
}

.contact__form .wpcf7-response-output.is-error {
    color: rgb(255, 160, 175);
    background: rgba(255, 107, 129, 0.08);
    border-color: rgba(255, 107, 129, 0.3) !important;
    animation: contact-response-in 0.4s var(--ease-out);
    padding: 10px 15px;
    text-align: center;
    border-radius: 5px !important;
}

@keyframes contact-response-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Field entrance stagger, driven by contact.js adding .is-visible per
   field as they scroll into view — independent of the shared
   [data-reveal-on-scroll] mechanism in style.css, which caps at 4
   direct children and this form has more moving parts than that. */
.contact__form [data-field] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.contact__form [data-field].is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 900px) {
  .contact__inner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .contact__intro {
    text-align: center;
    padding-bottom: 0;
  }

  .contact__heading br {
    display: none;
  }

  .contact__logo-wrap {
    left: 50%;
    top: 8%;
    width: min(90vw, 520px);
    transform: translate(-50%, 0);
    opacity: 0.12;
  }

  .contact__panel-head {
    flex-direction: column;
    gap: 0.6rem;
  }
}

@media (max-width: 640px) {
  .contact__form input.wpcf7-submit {
    width: 100%;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .contact__logo-svg,
  .contact__orb,
  .contact__panel-sweep {
    animation: none !important;
  }

  .form-group.is-shake {
    animation: none !important;
  }

  .contact__form .wpcf7-form-control-wrap::after {
    display: none;
  }

  .contact__form .wpcf7-response-output.is-success,
  .contact__form .wpcf7-response-output.is-error {
    animation: none !important;
  }

  .contact__form [data-field] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.wpcf7-not-valid-tip {
    font-size: 14px !important;
    margin-top: 7px;
    font-family: var(--font-body);
}