* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 40px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

h1 {
  font-size: 1.8rem;
  color: #fff;
  text-align: center;
  margin-bottom: 4px;
}

.subtitle {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  font-size: 0.85rem;
  color: #aaa;
  font-weight: 500;
  margin-bottom: -4px;
}

input[type="number"] {
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 1rem;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

input[type="number"]:focus {
  border-color: #6c63ff;
}

input[type="number"]::placeholder {
  color: #555;
}

button {
  margin-top: 8px;
  padding: 14px;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button:hover {
  background: #5a52d5;
}

button:active {
  transform: scale(0.98);
}

.result {
  margin-top: 32px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.result.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.bmi-value {
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 8px;
}

.bmi-category {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 20px;
}

.bmi-category.underweight { background: #2196f3; color: #fff; }
.bmi-category.normal { background: #4caf50; color: #fff; }
.bmi-category.overweight { background: #ff9800; color: #fff; }
.bmi-category.obese { background: #f44336; color: #fff; }

.bmi-bar {
  position: relative;
  margin: 0 auto 16px;
  max-width: 360px;
}

.bar-track {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  height: 28px;
}

.bar-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.bar-section.underweight { background: #2196f3; }
.bar-section.normal { background: #4caf50; }
.bar-section.overweight { background: #ff9800; }
.bar-section.obese { background: #f44336; }

.bar-indicator {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 40px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
  transition: left 0.5s ease;
}

.bmi-info {
  color: #888;
  font-size: 0.82rem;
  line-height: 1.5;
}

.error {
  color: #f44336;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 12px;
}
