.form-field {
  position: relative;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.form-control {
  appearance: none;
  background: #fff;
  border-radius: 2px;
  width: 100%;
  padding: 16px 17px 6px;
  font-size: 1.2rem;
  font-weight: 500;
  box-shadow: none;
  color: #032d44;
  border: 1px solid #ccc;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
  outline: none;
}

.form-control:focus {
  border-color: #032d44;
  box-shadow: 0 0 0 2px rgba(247, 212, 65, 0.2);
}

.control-label {
  position: absolute;
  top: 12px;
  left: 17px;
  font-size: 14px;
  color: #777;
  pointer-events: none;
  transition: all 0.2s ease-in-out;
  background: #fff;
  padding: 0 4px;
  z-index: 1;
}

.form-control:focus + .control-label,
.form-control:not(:placeholder-shown) + .control-label,
.form-control.has-value + .control-label {
  top: -8px;
  left: 17px;
  font-size: 0.75rem;
  color: #032d44;
  font-weight: 600;
}

.form-field.support .form-control {
  height: 46px;
  padding: 10px 12px 0px 20px;
  font-size: 14px;
}

.form-field.support .control-label {
  top: 11px;
}

.form-field.support .form-control:focus + .control-label,
.form-field.support .form-control:not(:placeholder-shown) + .control-label,
.form-field.support .form-control.has-value + .control-label {
  top: 6px;
  left: 17px;
  color: #a9a9a9;
}

.form-field.support textarea.form-control {
  min-height: 120px;
  resize: vertical;
  padding: 10px 12px 20px 20px;
  font-size: 14px;
}

.form-field.support textarea.form-control + .control-label {
  top: 11px;
  left: 17px;
}

.form-field.support textarea.form-control:focus + .control-label,
.form-field.support
  textarea.form-control:not(:placeholder-shown)
  + .control-label,
.form-field.support textarea.form-control.has-value + .control-label {
  top: 6px;
  left: 17px;
  color: #a9a9a9;
}

.error-message {
  color: #e74c3c;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

.is-invalid input, .is-invalid textarea, .is-invalid select {
    border: 1px solid #e74c3c;
}

/* Default placeholder style */
textarea.form-control::placeholder {
  color: #777;
  transition: all 0.2s ease-in-out;
  padding-left: 0; /* start at left edge */
}

/* When focused but still empty (placeholder-shown) */
textarea.form-control:focus:placeholder-shown::placeholder {
  padding-left: 10px; /* shift to the right */
  color: #777;
}

/* When user types something (not placeholder-shown) */
textarea.form-control:not(:placeholder-shown)::placeholder {
  padding-left: 0; /* back to original */
}

/* Container for radios */
.form-field.radios {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Each option */
.radio-option {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: #032d44;
  cursor: pointer;
}

.radio-option .label {
  cursor: pointer;
  user-select: none;
  font-size: var(--font-size-md, 14px);
}

/* Hide the native radio */
.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Custom circle */
.custom-radio {
  width: 20px;
  height: 20px;
  border: 1px solid #ccc;
  border-radius: 50%;
  margin-right: 10px;
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Focus effect (same as .form-control:focus) */
.radio-option input[type="radio"]:focus + .custom-radio {
  border-color: #032d44;
  box-shadow: 0 0 0 2px rgba(247, 212, 65, 0.2);
}

/* Checked state */
.radio-option input[type="radio"]:checked + .custom-radio {
  border-color: #032d44;
  background: radial-gradient(circle at center, #032d44 4px, transparent 1%);
}


/* Container for checkboxes */
.form-field.checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Each option */
.checkbox-option {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: #032d44;
  cursor: pointer;
}

/* Hide the native checkbox */
.checkbox-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Custom square box */
.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 4px; /* square with slight rounding */
  margin-right: 10px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Focus ring (consistent with your .form-control) */
.checkbox-option input[type="checkbox"]:focus + .custom-checkbox {
  border-color: #032d44;
  box-shadow: 0 0 0 2px rgba(247, 212, 65, 0.25);
}

/* Checked state — green background + white tick */
.checkbox-option input[type="checkbox"]:checked + .custom-checkbox {
  border-color: #4CAF50;
  background-color: #4CAF50;
}

/* Checkmark */
.custom-checkbox::after {
  content: '';
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.checkbox-option input[type="checkbox"]:checked + .custom-checkbox::after {
  opacity: 1;
}

/* Label text */
.checkbox-option .label {
  cursor: pointer;
  user-select: none;
  font-size: var(--font-size-md, 14px);
}

/* Select Dropdown Styling */
.select-wrapper {
  position: relative;
  display: block;
}

.select-wrapper.focused .select-dropdown {
  border-color: #032d44;
  box-shadow: 0 0 0 2px rgba(247, 212, 65, 0.2);
}

.select-dropdown {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 16px 40px 16px 17px;
  font-size: 1.2rem;
  font-weight: 500;
  color: #032d44;
  width: 100%;
  cursor: pointer;
  transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
  outline: none;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  background-image: none;
}

.select-dropdown:focus {
  border-color: #032d44;
  box-shadow: 0 0 0 2px rgba(247, 212, 65, 0.2);
}

.select-dropdown:hover {
  border-color: #999;
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #666;
  transition: color 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.select-wrapper:hover .select-arrow {
  color: #333;
}

.select-dropdown:focus + .select-arrow,
.select-wrapper.focused .select-arrow {
  color: #032d44;
}

/* Rotate arrow when dropdown is focused/active */
.select-dropdown:focus + .select-arrow svg,
.select-wrapper.focused .select-arrow svg {
  transform: rotate(180deg);
}

/* Option styling */
.select-dropdown option {
  padding: 8px 12px;
  font-size: 1rem;
  color: #032d44;
  background-color: #fff;
}

.select-dropdown option:hover {
  background-color: #f5f5f5;
}

.select-dropdown option:checked {
  background-color: #032d44;
  color: #fff;
}

/* Disabled state */
.select-dropdown:disabled {
  background-color: #f9f9f9;
  color: #999;
  cursor: not-allowed;
}

.select-dropdown:disabled + .select-arrow {
  color: #ccc;
}

/* Previous answer styling for dropdowns */
.select-dropdown.border-blue-300 {
  border-color: #a4c4d4;
  background-color: #f0f8ff;
}

.select-dropdown.bg-blue-50 {
  background-color: #f0f8ff;
}

.unit-btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.unit-btn.active {
  background: #032d44;
  color: #fff;
  border-color: #032d44;
}

.unit-btn:hover:not(.active) {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.bmi-calculator .hidden {
  display: none;
}

.previous-answer-indicator {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 12px;
  border-radius: 6px;
}

.question-title {
  color: #032d44;
}

/* BMI Display Styling */
#bmi-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1e40af;
}

#bmi-category {
  font-size: 0.875rem;
  font-weight: 500;
}

input[required]:not([type="radio"]):focus,
textarea[required]:focus,
select[required]:focus {
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2) !important;
}