.custom-contact-form-container {
  max-width: 900px;
  margin: 40px auto;
  font-family: inherit;
}

.calidra-form {
  width: 100%;
}

.calidra-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px 30px;
  margin-bottom: 25px; /* Added margin match below the grid */
}

.calidra-form .form-group {
  display: flex;
  flex-direction: column;
  /* Removed bottom margin from individual groups inside grid, handled by grid gap and parent margin now */
}

.calidra-form .form-group.full-width {
  grid-column: 1 / -1;
  margin-bottom: 25px; /* Re-applied for full width items outside/inside grid */
}

.calidra-form input[type="text"],
.calidra-form input[type="email"],
.calidra-form select,
.calidra-form textarea {
  width: 100%;
  padding: 14px 20px; /* Adjusted padding to avoid cutting text */
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  font-size: 16px; /* Increased font size */
  color: #444; /* Darker color for better readability */
  background-color: #fff;
  outline: none;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
  font-family: inherit;
  height: 56px; /* Explicit taller height */
  line-height: normal; /* Fix for theme line-height cutting text */
}

.calidra-form textarea {
  height: auto;
  min-height: 140px;
}

.calidra-form input::placeholder,
.calidra-form textarea::placeholder {
  color: #999;
  opacity: 1;
}

.calidra-form select {
  color: #444; /* Dark text for selected options */
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' 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 16px center; /* Adjusted icon position */
  background-size: 16px;
  cursor: pointer;
}

/* 
 * Gray out the select if empty (placeholder behavior)
 * Required empty selects have standard placeholder color
 */
.calidra-form select:invalid, 
.calidra-form select option[value=""] {
  color: #999;
}

/* Ensure options have proper color when opened */
.calidra-form select option {
  color: #444;
}

.calidra-form input:focus,
.calidra-form select:focus,
.calidra-form textarea:focus,
.calidra-form input:hover,
.calidra-form select:hover,
.calidra-form textarea:hover {
  border-color: #e31837; /* Calidra Red on focus and hover */
}

/* Validation styles */
.calidra-form .input-error {
  border-color: #e31837 !important;
}

.calidra-form .error-message {
  color: #e31837;
  font-size: 13px;
  margin-top: 5px;
}

/* Privacy Checkbox */
.privacy-checkbox-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 30px !important;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
  color: #555;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.custom-checkbox {
  height: 18px;
  width: 18px;
  background-color: #fff;
  border: 1px solid #d1d1d1;
  border-radius: 3px;
  margin-right: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
}

.checkbox-label input:checked ~ .custom-checkbox {
  background-color: #e31837;
  border-color: #e31837;
}

.checkbox-label input:checked ~ .custom-checkbox:after {
  content: "";
  display: block;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* Submit Button */
.form-submit-container {
  text-align: center;
}

.calidra-btn-red {
  background-color: #e31837;
  color: #fff;
  border: none;
  padding: 14px 32px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background-color 0.3s ease;
  letter-spacing: 0.5px;
}

.calidra-btn-red:hover {
  background-color: #ab1028;
}

.calidra-btn-red:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.form-feedback {
  margin-top: 20px;
  padding: 12px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.form-feedback.success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.form-feedback.error {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .custom-contact-form-container {
    padding: 0 20px;
  }
  .calidra-form .form-grid {
    grid-template-columns: 1fr;
    gap: 25px; /* Added 25px gap to prevent stacked inputs on mobile */
  }

  .privacy-checkbox-container {
    align-items: flex-start;
  }
}
