body {
  font-family: "Arial", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f3e5f5; /* Light purple background */
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  color: #333;
}

.container {
  background-color: #ffffff;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 35px;
  max-width: 1200px;
  width: 100%;
  text-align: center;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  color: #673ab7; /* Deep purple heading */
  margin-bottom: 25px;
  font-size: 2.5em;
  position: relative;
  padding-bottom: 10px;
}
h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: #9c27b0; /* Medium purple accent */
  border-radius: 2px;
}

/* How to Use Instructions */
.instructions {
  background-color: #ede7f6; /* Lighter purple for instructions */
  border: 1px solid #d1c4e9;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 25px;
  text-align: left;
  font-size: 0.9em;
  color: #4527a0; /* Darker purple text */
  line-height: 1.5;
}
.instructions h3 {
  margin-top: 0;
  color: #673ab7;
  font-size: 1.2em;
  margin-bottom: 10px;
}
.instructions ul {
  margin: 0;
  padding-left: 20px;
}
.instructions li {
  margin-bottom: 5px;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #555;
  font-size: 1em;
}

.input-group input[type="number"],
.input-group select,
.input-group input[type="radio"] + label {
  width: calc(100% - 20px);
  padding: 12px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1.1em;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group input[type="number"]:focus,
.input-group select:focus {
  border-color: #9c27b0;
  outline: none;
  box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.2);
}

.input-group .radio-group {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}
.input-group .radio-group input[type="radio"] {
  display: none; /* Hide default radio button */
}
.input-group .radio-group input[type="radio"] + label {
  flex: 1;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  background-color: #f9f9f9;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
  width: auto; /* Override default width */
}
.input-group .radio-group input[type="radio"]:checked + label {
  background-color: #9c27b0; /* Medium purple when checked */
  color: white;
  border-color: #9c27b0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.unit-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
  background-color: #f0f0f0;
  border-radius: 8px;
  padding: 5px;
}

.unit-toggle button {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  background-color: transparent;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  color: #555;
}

.unit-toggle button.active {
  background-color: #9c27b0; /* Medium purple when active */
  color: white;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.height-input-imperial {
  display: flex;
  gap: 10px;
  align-items: center;
}
.height-input-imperial input {
  flex: 1;
}
.height-input-imperial span {
  font-size: 0.9em;
  color: #777;
}

.btn-calculate {
  padding: 15px 30px;
  background-color: #673ab7; /* Deep purple button */
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.2em;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
  width: 100%;
  margin-top: 15px;
}

.btn-calculate:hover {
  background-color: #512da8; /* Even darker purple on hover */
  transform: translateY(-2px);
}

.result-output {
  margin-top: 30px;
  padding: 20px;
  background-color: #f3f0f7; /* Lighter background for results */
  border: 1px solid #d0b8e6; /* Light purple border */
  border-radius: 8px;
  text-align: center;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-output p {
  margin: 5px 0;
  font-size: 1.1em;
  color: #444;
}

.result-output #bmrValue {
  font-size: 2.2em;
  font-weight: bold;
  color: #673ab7; /* Deep purple for BMR value */
  margin-bottom: 10px;
}

.result-output #bmrFormulaNote {
  font-size: 0.9em;
  color: #777;
}

.result-output .error-message {
  font-size: 1.1em;
  color: #d32f2f; /* Red for error */
  font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .container {
    padding: 20px;
  }
  h1 {
    font-size: 2em;
  }
  .btn-calculate {
    font-size: 1.1em;
    padding: 12px 20px;
  }
  .result-output #bmrValue {
    font-size: 1.8em;
  }
  .input-group .radio-group {
    flex-direction: column;
    gap: 10px;
  }
}
