/* CSS for Person Contact Form - matches new-contact-form design */
.balco-cf7 {
  --balco-blue-600: #2563eb; /* tailwind blue-600 */
  --balco-blue-400: #60a5fa; /* tailwind blue-400 */
  --balco-black: #111827;
  --balco-white: #ffffff;
  --balco-red-500: #ef4444; /* tailwind red-500 */
}

.inputs-col {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.inputs-col p {
  width: 100%;
}

.person-form-btn {
  display: flex;
  justify-content: end;
}

/* Grid layout for person form - single column layout */
.balco-cf7 .person-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Form container styling with flexbox ordering */
.balco-cf7 .person-form-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Position response messages at the bottom using absolute positioning */
.balco-cf7 .person-form-container {
  position: relative;
  padding-bottom: 10px; /* Space for response messages */
}

.balco-cf7 .person-form-container .wpcf7-response-output {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Barlow', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  z-index: 10;
}

/* Base input styles matching new-contact-form */
.balco-cf7 .person-form-container input[type="text"],
.balco-cf7 .person-form-container input[type="email"],
.balco-cf7 .person-form-container input[type="tel"],
.balco-cf7 .person-form-container textarea {
  width: 100%;
  background-color: var(--balco-white);
  color: var(--balco-black);
  padding: 0.75rem 1rem; /* py-3 px-4 */
  font-size: 1rem;
  font-weight: 500;
  line-height: 28px;
  font-family: 'Barlow', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  border-radius: 9999px; /* pill shape */
  outline: none;
  margin-bottom: 0 !important;
}



/* Textarea specific styling */
.balco-cf7 .person-form-container textarea {
  border-radius: 20px;
  height: 120px;
  resize: none;
  padding: 0.75rem 1rem;
}

/* Placeholder styling */
.balco-cf7 .person-form-container ::placeholder {
  font-style: italic;
  color: var(--balco-black);
  opacity: 1;
  font-family: 'Barlow', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-weight: 500;
  font-size: 15px;
}

/* Form field containers */
.balco-cf7 .person-form-container p {
  margin: 0 0 1rem 0;
  position: relative;
}

/* Submit button styling */
.balco-cf7 .person-form-container input[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 145px;
  height: 52px;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  background-color: #005674; /* matching new-contact-form button color */
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  font-family: 'Barlow Semi Condensed', 'Barlow', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  border: none;
  cursor: pointer;
  transition: opacity 150ms ease, transform 150ms ease;
  margin-top: 0.5rem;
}

.balco-cf7 .person-form-container input[type="submit"]:hover {
  background-color: #013e54;
  color: #fff;
  border: none;
  opacity: 0.95;
}

.balco-cf7 .person-form-container input[type="submit"]:active {
  transform: translateY(1px);
}

/* Error message styling */
.balco-cf7 .wpcf7-not-valid-tip {
  font-size: 12px !important;
  color: #f50303;
  font-style: italic;
  padding-left: 20px;
  font-family: 'Barlow', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  z-index: 10;
}

/* Form response messages */
.balco-cf7 .wpcf7-response-output {
  margin: 0 !important;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Barlow', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Error message styling */
.balco-cf7 .wpcf7-validation-errors,
.balco-cf7 .wpcf7-mail-sent-ng,
.balco-cf7 .wpcf7-spam-blocked,
.balco-cf7 .wpcf7-aborted {
  background-color: #fef2f2 !important; /* Light red background */
  border: 1px solid #fecaca !important; /* Light red border */
  color: #dc2626 !important; /* Red text */
  border-left: 4px solid #ef4444 !important; /* Red left border accent */
}

/* Success message styling */
.balco-cf7 .wpcf7-mail-sent-ok {
  background-color: #f0fdf4 !important; /* Light green background */
  border: 1px solid #22c55e !important; /* Green border */
  color: #16a34a !important; /* Green text */
  border-left: 4px solid #22c55e !important; /* Green left border accent */
}

/* Screen reader response styling */
.balco-cf7 .screen-reader-response {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  overflow: hidden !important;
  height: 1px !important;
  width: 1px !important;
}

/* Form field spacing */
.balco-cf7 .person-form-container #form-input {
  margin-bottom: 1rem;
}

.balco-cf7 .person-form-container #form-msg {
  margin-bottom: 1rem;
}

.balco-cf7 .person-form-container #form-submit {
  margin-bottom: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
  .balco-cf7 .person-form-container input[type="text"],
  .balco-cf7 .person-form-container input[type="email"],
  .balco-cf7 .person-form-container input[type="tel"],
  .balco-cf7 .person-form-container textarea {
    font-size: 14px;
  }
  
  .balco-cf7 .person-form-container ::placeholder {
    font-size: 14px;
  }
  
  .balco-cf7 .wpcf7-response-output {
    font-size: 12px !important;
  }
}

/* Tablet + mobile: stack fields, keep desktop design unchanged */
@media (max-width: 1024px) {
  .inputs-col {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .balco-cf7 .person-form-container p {
    margin: 0 0 0.75rem 0;
  }

  .person-form-btn {
    justify-content: stretch;
  }

  .balco-cf7 .person-form-container input[type="submit"] {
    width: 100%;
  }

  /* CF7 error tips: avoid overlapping inputs on stacked layout */
  .balco-cf7 .wpcf7-not-valid-tip {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    padding-left: 0;
    margin-top: 0.25rem !important;
  }
}

@media (max-width: 767px) {
  .balco-cf7 .person-form-container textarea {
    height: 140px;
  }
}
