/* ===== Contact Form Container ===== */
.contact-form-container {
  max-width: 860px;
  margin: 2rem auto 4rem;
  padding: 2.5rem 2rem 3rem;
  background-color: #ffffff;
  border-radius: 14px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  /* box-shadow: 0 10px 30px rgba(0,0,0,0.1); */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Title */
.contact-form-container h1 {
  font-size: 2.4rem;
  margin-bottom: 2rem;
  font-weight: 700;
  color: #222;
}

/* ===== FORM Layout ===== */
form {
  display: flex;
  flex-direction: column;
  gap: 2rem; /* space between rows */
}

/* Rows with two fields */
.form-row {
  display: flex;
  gap: 2rem; /* horizontal gap between inputs */
  flex-wrap: wrap;
}

/* Each input group */
.form-group {
  flex: 1;
  min-width: 280px;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem; /* gap between label, input, error */
  position: relative;
}

/* ===== Inputs, Select, Textarea ===== */
.floating-input {
  width: 100%;
  padding: 1.1rem 1rem 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  color: #333;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-family: inherit;
  resize: vertical; /* textarea respects this */
  box-sizing: border-box;
}

.floating-input:focus {
  border-color: #4a90e2;
  outline: none;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

/* For textarea specific height */
textarea.floating-input {
  min-height: 140px;
  padding-top: 1.2rem;
  padding-bottom: 0.8rem;
}

/* ===== Floating Labels ===== */
.form-group label {
  position: absolute;
  left: 1rem;
  top: 1.2rem;
  background-color: #fff;
  padding: 0 0.25rem;
  font-size: 1rem;
  color: #777;
  pointer-events: none;
  transition: 0.2s ease all;
  user-select: none;
}

/* Label floats up when input is focused or has value (via .focused class) */
.floating-input.focused + label {
  top: -0.6rem;
  left: 0.9rem;
  font-size: 0.75rem;
  color: #4a90e2;
  font-weight: 600;
}

/* ===== Character Count ===== */
.char-count {
  font-size: 0.8rem;
  color: #666;
  text-align: right;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ===== Error Messages ===== */
.error-msg {
  font-size: 0.85rem;
  color: #e74c3c;
  font-weight: 600;
  margin-top: 0.4rem;
  margin-bottom: 0.6rem;
}

/* ===== Form Success Message ===== */
.form-success {
  background-color: #e6f9e8;
  color: #217a26;
  padding: 1.1rem 1.3rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(33, 122, 38, 0.3);
  text-align: center;
  font-size: 1.1rem;
}

/* ===== Submit Button ===== */
.btn.subdued {
  background-color: #5a6a78;
  color: #f0f0f0;
  padding: 0.85rem 2.2rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(90, 106, 120, 0.3);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
  align-self: flex-start;
}

.btn.subdued:hover,
.btn.subdued:focus {
  background-color: #44515a;
  box-shadow: 0 6px 12px rgba(68, 81, 90, 0.5);
  transform: translateY(-2px);
  outline: none;
}

/* ===== Responsive ===== */
/* === MOBILE FIX for #referral select floating label === */
@media (max-width: 650px) {
  .form-group {
    position: relative;
  }

  /* Style the select box */
  select#referral.floating-input {
    padding: 1.35rem 1rem 0.6rem; /* Enough space at top for label */
    font-size: 1rem;
    line-height: 1.4;
    appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 1rem;
    box-sizing: border-box;
    border-radius: 8px;
  }

  /* Default label position */
  select#referral.floating-input + label {
    position: absolute;
    top: 1.35rem; /* Adjusted lower for visual alignment */
    left: 1rem;
    font-size: 1rem;
    color: #777;
    background: white;
    padding: 0 0.25rem;
    pointer-events: none;
    transition: 0.2s ease all;
    user-select: none;
    z-index: 2;
  }

  /* Floated label (when .focused class is present) */
  select#referral.floating-input.focused + label {
    top: -0.4rem; /* Slightly lower than before for balance */
    left: 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a90e2;
    z-index: 2;
  }
}






/* 
@media (max-width: 650px) {
  .form-row {
    flex-direction: column;
  }
  .form-group {
    min-width: 100%;
  }
}
*/