/* ══════════════════════════════
   contact-page.css
   Styling for Contact Form 7 to match the theme.
   ══════════════════════════════ */

/* ── Wrapper ── */
.wpcf7 {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* CF7 wraps each field in a <p>. Strip its default margin so our gap spacing is clean. */
.wpcf7-form > p {
  margin: 0;
}

/* CF7 hidden fields fieldset has no border in our theme — just remove the visual */
.wpcf7-form .hidden-fields-container {
  border: 0;
  padding: 0;
  margin: 0;
}

/* ══════════════════════════════
   Labels
   ══════════════════════════════ */
.wpcf7 label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 0;
}

/* CF7 puts label text + <br> + input inside a <label>. Add spacing between text and input. */
.wpcf7 label .wpcf7-form-control-wrap {
  display: block;
  margin-top: 6px;
}

/* ══════════════════════════════
   Inputs and textarea
   ══════════════════════════════ */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 textarea,
.wpcf7 select {
  width: 100%;
  padding: 12px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--text-strong);
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.wpcf7 textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.5;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 input[type="url"]:focus,
.wpcf7 input[type="number"]:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

/* ══════════════════════════════
   Name + Email side by side on desktop
   ══════════════════════════════ */
.wpcf7 .name-email-row > p {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

@media (min-width: 600px) {
  .wpcf7 .name-email-row > p {
    flex-direction: row;
    gap: 16px;
  }
  .wpcf7 .name-email-row > p > label {
    flex: 1;
  }
  /* Hide the <br> tags between name & email on desktop so they don't add stray space */
  .wpcf7 .name-email-row > p > br {
    display: none;
  }
}

/* ══════════════════════════════
   Submit button
   ══════════════════════════════ */
.wpcf7 input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(13,148,136,0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.wpcf7 input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(13,148,136,0.35);
}
.wpcf7 input[type="submit"]:active {
  transform: translateY(0);
}
.wpcf7 input[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ══════════════════════════════
   Spinner
   ══════════════════════════════ */
.wpcf7-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: transparent;
  border: 2px solid var(--accent-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin-left: 14px;
  vertical-align: middle;
  animation: cb-spinner-rotate 0.8s linear infinite;
  opacity: 0;
  transition: opacity 0.2s;
}
.wpcf7-spinner.is-active,
.wpcf7-form.submitting .wpcf7-spinner {
  opacity: 1;
}
@keyframes cb-spinner-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ══════════════════════════════
   Response output (success / error messages)
   ══════════════════════════════ */
.wpcf7-response-output {
  padding: 14px 16px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid;
}

/* Reset the default CF7 styles */
.wpcf7 form .wpcf7-response-output {
  border: 1px solid;
  margin: 0;
}

/* Success */
.wpcf7 form.sent .wpcf7-response-output {
  background: rgba(13,148,136,0.08);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Error */
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
  background: rgba(220,38,38,0.06);
  border-color: rgba(220,38,38,0.3);
  color: #b91c1c;
}

/* Inline field validation errors */
.wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #b91c1c;
}
.wpcf7-form-control.wpcf7-not-valid {
  border-color: rgba(220,38,38,0.5);
  background: rgba(220,38,38,0.04);
}
.wpcf7-form-control.wpcf7-not-valid:focus {
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}

/* Screen reader response */
.screen-reader-response {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
