/* ==========================================================================
   Site Prep Pros — Contact Form 7 Custom Styles
   Matches the screenshot design exactly:
   - Off-white input backgrounds
   - Uppercase gray labels with orange accent letter
   - Square/near-square inputs with light gray borders
   - 2-column Phone + Email row
   - Full-width orange submit button
   
   HOW TO ADD THIS CSS:
   Option A (Recommended):
     Paste all this CSS into:
     WP Admin → Appearance → Customize → Additional CSS
   
   Option B:
     Add to wordpress-custom/assets/css/main.css
   
   Option C:
     Enqueue this file in functions.php via wp_enqueue_style()
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET — Strip Contact Form 7 default chrome
   -------------------------------------------------------------------------- */
.spp-cf7-wrap .wpcf7-form {
  margin: 0 !important;
  padding: 0 !important;
}

/* Remove CF7 default br line-breaks inside forms */
.spp-cf7-wrap br {
  display: none;
}

/* Remove CF7 default paragraph wrappers if any */
.spp-cf7-wrap p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   2. OUTER WRAPPER
   -------------------------------------------------------------------------- */
div.spp-cf7-wrap {
  background: #ffffff;
  border: 1px solid #e2e1de;
  padding: 1.75rem !important;
  box-shadow: 0 10px 30px -12px rgba(30, 33, 40, 0.10);
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .spp-cf7-wrap {
    padding: 2rem;
  }
}

@media (min-width: 768px) {
  .spp-cf7-wrap {
    padding: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   3. INDIVIDUAL FIELD WRAPPER
   -------------------------------------------------------------------------- */
.spp-cf7-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.125rem;
}

.spp-cf7-field:last-of-type {
  margin-bottom: 0;
}

/* CF7 injects a span around inputs — make it block */
.spp-cf7-field .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

/* --------------------------------------------------------------------------
   4. TWO-COLUMN ROW (Phone + Email)
   -------------------------------------------------------------------------- */
.spp-cf7-row {
  display: flex;
  gap: 0.875rem;
  margin-bottom: 1.125rem;
}

.spp-cf7-row .spp-cf7-field {
  flex: 1 1 0%;
  min-width: 0;
  margin-bottom: 0;
}

/* Stack on very small screens */
@media (max-width: 479px) {
  .spp-cf7-row {
    flex-direction: column;
    gap: 1.125rem;
  }
}

/* --------------------------------------------------------------------------
   5. LABELS
   -------------------------------------------------------------------------- */
.spp-cf7-label {
  display: block;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 0.5625rem;     /* ~9px */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #888a8f;
  margin-bottom: 0.4375rem;  /* ~7px gap between label and input */
  line-height: 1;
  cursor: default;
  user-select: none;
}

@media (min-width: 640px) {
  .spp-cf7-label {
    font-size: 0.625rem;    /* ~10px */
    letter-spacing: 0.15em;
  }
}

/* Orange accent letter (the last letter of each label word) */
.spp-cf7-accent {
  color: #e07820;           /* var(--primary) */
  font-style: normal;
}

/* --------------------------------------------------------------------------
   6. ALL INPUT TYPES (text, tel, email)
   -------------------------------------------------------------------------- */
.spp-cf7-wrap input.spp-cf7-input,
.spp-cf7-wrap .wpcf7-text,
.spp-cf7-wrap .wpcf7-tel,
.spp-cf7-wrap .wpcf7-email,
.spp-cf7-wrap input[type="text"],
.spp-cf7-wrap input[type="tel"],
.spp-cf7-wrap input[type="email"] {
  display: block;
  width: 100%;
  background: #faf9f7;      /* off-white, matches --input */
  border: 1px solid #dddcda;
  border-radius: 2px;
  padding: 0.6875rem 0.875rem;   /* ~11px 14px */
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 0.875rem;      /* 14px */
  color: #2d2f35;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .spp-cf7-wrap input.spp-cf7-input,
  .spp-cf7-wrap .wpcf7-text,
  .spp-cf7-wrap .wpcf7-tel,
  .spp-cf7-wrap .wpcf7-email,
  .spp-cf7-wrap input[type="text"],
  .spp-cf7-wrap input[type="tel"],
  .spp-cf7-wrap input[type="email"] {
    font-size: 0.9375rem;   /* 15px */
    padding: 0.75rem 0.9375rem;
  }
}

/* Placeholder */
.spp-cf7-wrap input.spp-cf7-input::placeholder,
.spp-cf7-wrap .wpcf7-text::placeholder,
.spp-cf7-wrap .wpcf7-tel::placeholder,
.spp-cf7-wrap .wpcf7-email::placeholder {
  color: #b0b3ba;
  font-weight: 400;
}

/* Focus */
.spp-cf7-wrap input.spp-cf7-input:focus,
.spp-cf7-wrap .wpcf7-text:focus,
.spp-cf7-wrap .wpcf7-tel:focus,
.spp-cf7-wrap .wpcf7-email:focus {
  border-color: #e07820;
  box-shadow: 0 0 0 3px rgba(224, 120, 32, 0.14);
  background: #ffffff;
}

/* --------------------------------------------------------------------------
   7. SELECT DROPDOWN (Service Needed)
   -------------------------------------------------------------------------- */
.spp-cf7-wrap select.spp-cf7-select,
.spp-cf7-wrap .wpcf7-select {
  display: block;
  width: 100%;
  background-color: #faf9f7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888a8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 15px 15px;
  border: 1px solid #dddcda;
  border-radius: 2px;
  padding: 0.6875rem 2.5rem 0.6875rem 0.875rem;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 0.875rem;
  color: #2d2f35;
  line-height: 1.5;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: none;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .spp-cf7-wrap select.spp-cf7-select,
  .spp-cf7-wrap .wpcf7-select {
    font-size: 0.9375rem;
    padding: 0.75rem 2.5rem 0.75rem 0.9375rem;
  }
}

.spp-cf7-wrap select.spp-cf7-select:focus,
.spp-cf7-wrap .wpcf7-select:focus {
  border-color: #e07820;
  box-shadow: 0 0 0 3px rgba(224, 120, 32, 0.14);
  background-color: #ffffff;
}

/* First option as prompt (if select uses default first option as placeholder) */
.spp-cf7-wrap select.spp-cf7-select option:first-child,
.spp-cf7-wrap .wpcf7-select option:first-child {
  color: #2d2f35;
}

/* --------------------------------------------------------------------------
   8. TEXTAREA (Project Details)
   -------------------------------------------------------------------------- */
.spp-cf7-wrap textarea.spp-cf7-textarea,
.spp-cf7-wrap .wpcf7-textarea {
  display: block;
  width: 100%;
  background: #faf9f7;
  border: 1px solid #dddcda;
  border-radius: 2px;
  padding: 0.6875rem 0.875rem;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 0.875rem;
  color: #2d2f35;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  min-height: 178px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .spp-cf7-wrap textarea.spp-cf7-textarea,
  .spp-cf7-wrap .wpcf7-textarea {
    font-size: 0.9375rem;
    padding: 0.75rem 0.9375rem;
    min-height: 188px;
  }
}

.spp-cf7-wrap textarea.spp-cf7-textarea::placeholder,
.spp-cf7-wrap .wpcf7-textarea::placeholder {
  color: #b0b3ba;
  font-weight: 400;
}

.spp-cf7-wrap textarea.spp-cf7-textarea:focus,
.spp-cf7-wrap .wpcf7-textarea:focus {
  border-color: #e07820;
  box-shadow: 0 0 0 3px rgba(224, 120, 32, 0.14);
  background: #ffffff;
}

/* --------------------------------------------------------------------------
   9. SUBMIT BUTTON
   -------------------------------------------------------------------------- */
.spp-cf7-submit-wrap {
  margin-top: 0.125rem;
}

/* CF7 wraps submit in a span — make it block */
.spp-cf7-submit-wrap .wpcf7-form-control-wrap,
.spp-cf7-submit-wrap span {
  display: block !important;
  width: 100% !important;
}

.spp-cf7-wrap input.spp-cf7-btn,
.spp-cf7-wrap .wpcf7-submit {
  display: block;
  width: 100%;

  /* Colors */
  background: #e07820;
  color: #ffffff;
  border: none;

  /* Typography */
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 0.6875rem;       /* ~11px */
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;

  /* Layout */
  padding: 1rem 1.5rem;
  text-align: center;
  cursor: pointer;

  /* Shape */
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;

  /* Animation */
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease, background 0.25s ease;
}

@media (min-width: 640px) {
  .spp-cf7-wrap input.spp-cf7-btn,
  .spp-cf7-wrap .wpcf7-submit {
    font-size: 0.75rem;        /* 12px */
    padding: 1.0625rem 1.5rem;
  }
}

/* Charcoal dark wipe animation on hover (matches cta-btn--primary) */
.spp-cf7-wrap input.spp-cf7-btn::before,
.spp-cf7-wrap .wpcf7-submit::before {
  /* input elements can't have ::before — handled with background transition below */
  display: none;
}

.spp-cf7-wrap input.spp-cf7-btn:hover,
.spp-cf7-wrap .wpcf7-submit:hover {
  background: #c06310;        /* slightly darker orange on hover */
  box-shadow: 0 0 40px -8px rgba(224, 120, 32, 0.55);
}

.spp-cf7-wrap input.spp-cf7-btn:active,
.spp-cf7-wrap .wpcf7-submit:active {
  background: #b05a0e;
  transform: translateY(1px);
}

/* Loading/disabled state */
.spp-cf7-wrap input.spp-cf7-btn:disabled,
.spp-cf7-wrap .wpcf7-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   10. CF7 VALIDATION ERRORS
   -------------------------------------------------------------------------- */

/* Red border on invalid fields */
.spp-cf7-wrap .wpcf7-not-valid {
  border-color: #d92d2d !important;
  box-shadow: 0 0 0 3px rgba(217, 45, 45, 0.12) !important;
}

/* Error tip below field */
.spp-cf7-wrap .wpcf7-not-valid-tip {
  display: block;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 0.6875rem;
  color: #d92d2d;
  margin-top: 0.3125rem;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   11. CF7 RESPONSE OUTPUT (success / error messages)
   -------------------------------------------------------------------------- */
.spp-cf7-wrap ~ .wpcf7-response-output,
.wpcf7 .wpcf7-response-output {
  display: block;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 0.8125rem;
  margin: 0.875rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 2px;
  border: none;
  line-height: 1.5;
}

/* Sent/success */
.wpcf7-mail-sent-ok,
.wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ok {
  background: #f0faf3;
  color: #1a6b32;
  border-left: 3px solid #22a34a;
}

/* Error */
.wpcf7-mail-sent-ng,
.wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ng,
.wpcf7-spam-blocked,
.wpcf7-validation-errors {
  background: #fff3f3;
  color: #8b1a1a;
  border-left: 3px solid #d92d2d;
}

/* --------------------------------------------------------------------------
   12. SPINNER (loading indicator while submitting)
   -------------------------------------------------------------------------- */
.wpcf7 .ajax-loader {
  display: none !important;  /* Hide default CF7 spinner */
}

/* Optional: custom submit loading state */
.spp-cf7-wrap input.spp-cf7-btn.loading,
.spp-cf7-wrap .wpcf7-submit.loading {
  opacity: 0.8;
  cursor: wait;
}

/* --------------------------------------------------------------------------
   13. RESPONSIVE ADJUSTMENTS
   -------------------------------------------------------------------------- */
@media (max-width: 359px) {
  .spp-cf7-wrap {
    padding: 1.25rem;
  }
  .spp-cf7-wrap input.spp-cf7-btn,
  .spp-cf7-wrap .wpcf7-submit {
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    padding: 0.875rem 1rem;
  }
}

/* --------------------------------------------------------------------------
   14. ACCESSIBILITY — focus-visible ring override
   -------------------------------------------------------------------------- */
.spp-cf7-wrap *:focus-visible {
  outline: 2px solid #e07820;
  outline-offset: 1px;
}
