/* General form style */
#dental-referral-form {
  max-width: 700px;
  margin: 0 auto;
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px #ccc;
}

#dental-referral-form h3 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

#dental-referral-form label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
  color: #34495e;
}

#dental-referral-form input[type="text"],
#dental-referral-form input[type="tel"],
#dental-referral-form select,
#dental-referral-form textarea {
  width: 100%;
  padding: 8px 10px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
  resize: vertical;
}

#dental-referral-form button {
  margin-top: 25px;
  background-color: #27ae60;
  color: white;
  font-size: 1.1rem;
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s ease;
}

#dental-referral-form button:hover {
  background-color: #219150;
}

#referral-response {
  margin-top: 15px;
  font-weight: bold;
  text-align: center;
}

/* Tooth chart styling */
#tooth-chart {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 15px;
  gap: 5px;
}

.jaw {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 10px 0;
}

.tooth {
  width: 40px;
  height: 50px;
  background: #ecf0f1;
  border: 1.5px solid #7f8c8d;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  font-weight: bold;
  color: #2c3e50;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  outline: none;
}

.tooth:hover,
.tooth:focus {
  background-color: #bdc3c7;
  border-color: #2980b9;
}

.tooth.selected {
  background-color: #27ae60;
  color: white;
  border-color: #1e8449;
}

/* Selected teeth inputs */
#selected-teeth-section {
  margin-top: 25px;
  border-top: 2px solid #27ae60;
  padding-top: 15px;
}

.tooth-treatment {
  background-color: #dff0d8;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 15px;
}

.tooth-treatment legend {
  font-weight: bold;
  color: #155724;
  padding: 0 5px;
}

/* Disabled inputs */
.tooth-treatment input[disabled],
.tooth-treatment input[readonly],
.tooth-treatment textarea[disabled] {
  background-color: #eee;
  color: #666;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 600px) {
  .tooth {
    width: 30px;
    height: 40px;
    font-size: 0.85rem;
  }
}
