:root {
  --bg: #f3f5fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #dbe3f1;
  --danger: #b91c1c;
  --warning: #b45309;
  --success: #15803d;
  --critical: #b91c1c;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 24px 50px rgba(30, 41, 59, 0.16);
  --radius: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  line-height: 1.65;
  font-size: 16px;
  color: var(--text);
  background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 30%, var(--bg) 100%);
}

.container {
  width: min(100% - 2rem, 980px);
  margin-inline: auto;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(248, 250, 255, 0.86);
  border-bottom: 1px solid rgba(219, 227, 241, 0.7);
}

.nav-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  text-decoration: none;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 1rem;
}

.nav-links a {
  text-decoration: none;
  color: #475569;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--primary);
}

.site-header {
  position: relative;
  overflow: hidden;
  padding: clamp(4.4rem, 8vw, 8.3rem) 0 clamp(3rem, 5vw, 4.6rem);
  text-align: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(147, 197, 253, 0.4), transparent 38%),
    radial-gradient(circle at 80% 20%, rgba(196, 181, 253, 0.45), transparent 40%),
    linear-gradient(180deg, #f8faff 0%, #eef2ff 70%, rgba(238, 242, 255, 0.3) 100%);
}

.hero-inner {
  min-height: 250px;
  display: grid;
  place-content: center;
  gap: 0.8rem;
  position: relative;
  z-index: 1;
}

.hero-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(40px);
  pointer-events: none;
}

.hero-glow-one {
  width: 230px;
  height: 230px;
  background: rgba(99, 102, 241, 0.24);
  top: -55px;
  left: 12%;
}

.hero-glow-two {
  width: 260px;
  height: 260px;
  background: rgba(59, 130, 246, 0.2);
  right: 8%;
  top: -70px;
}

.brand {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--primary);
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin-top: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}

.hero-text {
  margin: 0 auto;
  max-width: 710px;
  font-size: clamp(1rem, 1.9vw, 1.2rem);
  color: var(--muted);
}

.hero-cta {
  justify-self: center;
  margin-top: 0.7rem;
  display: inline-block;
  padding: 0.9rem 1.3rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 14px 28px rgba(59, 130, 246, 0.3);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(59, 130, 246, 0.34);
  filter: brightness(1.05);
}

.calculator-section {
  padding: 1.2rem 0 2.8rem;
}

.card {
  position: relative;
  isolation: isolate;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  box-shadow: var(--shadow-strong);
  padding: clamp(1.4rem, 2.5vw, 2.3rem);
  border: 1px solid rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.5), rgba(147, 197, 253, 0.12));
  z-index: -1;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.17);
}

.unit-row {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.field-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

legend {
  font-weight: 600;
  padding: 0 0.25rem;
}

.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  color: var(--muted);
}

.toggle-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

label {
  font-weight: 500;
}

input[type="number"] {
  width: 100%;
  padding: 0.86rem 0.95rem;
  border: 1px solid #d2dcf4;
  border-radius: 13px;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

input[type="number"]:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.8);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
  background-color: #fff;
}

.btn-primary {
  display: inline-block;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.82rem 1rem;
  font: inherit;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
}

.button-row {
  display: grid;
  gap: 0.65rem;
}

.btn-secondary {
  display: inline-block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.82rem 1rem;
  font: inherit;
  font-weight: 600;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #c7d2fe;
}

.error-message {
  min-height: 1.4rem;
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.95rem;
}

.result-card {
  margin-top: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  padding: 1.15rem;
  background: rgba(248, 250, 255, 0.9);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.result-value {
  margin: 0.2rem 0 0.35rem;
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.result-category {
  margin: 0;
  font-weight: 600;
}

.result-meter {
  margin-top: 0.9rem;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.result-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #84cc16);
  transition: width 0.55s ease;
}

.result-card.result-animated {
  animation: resultPop 0.45s ease;
}

.result-card.result-visible {
  animation: resultFade 0.35s ease;
}

.result-card.category-underweight .result-value,
.result-card.category-underweight #bmi-category {
  color: #0369a1;
}

.result-card.category-underweight .result-bar {
  background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.result-card.category-normal .result-value,
.result-card.category-normal #bmi-category {
  color: var(--success);
}

.result-card.category-normal .result-bar {
  background: linear-gradient(90deg, #22c55e, #15803d);
}

.result-card.category-overweight .result-value,
.result-card.category-overweight #bmi-category {
  color: var(--warning);
}

.result-card.category-overweight .result-bar {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.result-card.category-obese .result-value,
.result-card.category-obese #bmi-category {
  color: var(--critical);
}

.result-card.category-obese .result-bar {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.content-section {
  padding: 1.45rem 0;
}

.content-section p {
  color: #374151;
}

.category-list {
  margin: 0;
  padding-left: 1.15rem;
  color: #374151;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item h3 {
  margin-bottom: 0.4rem;
}

.faq-item p {
  margin: 0;
}

.trust-section {
  padding: 0.2rem 0 2.4rem;
}

.trust-grid {
  display: grid;
  gap: 0.75rem;
}

.trust-item {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(219, 227, 241, 0.8);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-weight: 500;
  color: #334155;
}

.trust-item span {
  color: var(--success);
  font-weight: 800;
  margin-right: 0.45rem;
}

.cta-section {
  padding: 1.4rem 0 2.8rem;
}

.cta-card {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  border-radius: 22px;
  padding: clamp(1.4rem, 2.8vw, 2.2rem);
  color: #e2e8f0;
  box-shadow: var(--shadow-strong);
  text-align: center;
}

.cta-card h2 {
  color: #fff;
}

.cta-card p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 1.03rem;
}

.cta-button {
  display: inline-block;
  padding: 0.95rem 1.35rem;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  background: linear-gradient(135deg, #22c55e, #06b6d4);
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(6, 182, 212, 0.3);
  filter: brightness(1.03);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
  padding: 1.4rem 0 2.2rem;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none;
}

@keyframes resultPop {
  0% {
    opacity: 0.2;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes resultFade {
  0% {
    opacity: 0.15;
  }
  100% {
    opacity: 1;
  }
}

@media (min-width: 760px) {
  .nav-links {
    display: flex;
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .unit-row {
    grid-template-columns: repeat(2, 1fr);
  }

  #height-ft-group {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .button-row {
    grid-template-columns: 1fr auto;
    align-items: stretch;
  }

  .btn-secondary {
    min-width: 130px;
  }
}
