/**
 * LeanCalc — shared calculator chrome (forms, results shell, SEO/footer band).
 * Per-page accent: set --shell-accent, --shell-accent-rgb, etc. in calc-*.css (defaults = BMI / lime).
 */
:root {
  --shell-accent: #c8f04a;
  --shell-accent-rgb: 200, 240, 74;
  --shell-h1-em: var(--shell-accent);
  --shell-logo: var(--accent);
  --shell-grid-rgb: 200, 240, 74;
  --shell-blob-rgb: 200, 240, 74;
  --shell-blob-alpha: 0.06;
  --shell-blob-top: -200px;
  --shell-blob-right: -200px;
  --shell-blob-bottom: auto;
  --shell-blob-left: auto;
  --shell-btn-fg: var(--bg);
  --shell-btn-shadow-alpha: 0.25;
  --shell-unit-active-fg: var(--bg);
  --shell-footer-link: var(--accent);
  --shell-faq-link: var(--shell-accent);
  --shell-tool-link-hover: var(--shell-accent);
  --shell-recalc-hover: var(--shell-accent);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--shell-grid-rgb), 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--shell-grid-rgb), 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.glow-blob {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(var(--shell-blob-rgb), var(--shell-blob-alpha)) 0%,
    transparent 70%
  );
  top: var(--shell-blob-top);
  right: var(--shell-blob-right);
  bottom: var(--shell-blob-bottom);
  left: var(--shell-blob-left);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

header {
  padding: 40px 0 20px;
  text-align: center;
}

.logo {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  display: inline-block;
  margin-bottom: 40px;
}

/* Beat UA :visited / :link colours so “LeanCalc” stays on-brand (green + white). */
a.logo:link,
a.logo:visited,
a.logo:hover,
a.logo:active {
  text-decoration: none;
  color: var(--shell-logo);
}

a.logo span {
  color: var(--text);
}

h1 {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 16px;
}

h1 em {
  font-style: normal;
  color: var(--shell-h1-em);
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 300;
  max-width: 520px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

.calc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.calc-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--shell-accent), transparent);
  opacity: 0.6;
}

.section-label {
  font-family: Syne, sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .calc-card {
    padding: 24px;
  }
}

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

.form-group.full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.3px;
}

input[type="number"],
select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 16px;
  border-radius: 10px;
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  appearance: none;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--shell-accent);
}

.unit-toggle {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
  width: fit-content;
}

.unit-btn {
  padding: 8px 20px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
  font-family: "DM Sans", sans-serif;
}

.unit-btn.active {
  background: var(--shell-accent);
  color: var(--shell-unit-active-fg);
}

.sex-toggle {
  display: flex;
  gap: 10px;
}

.sex-btn {
  flex: 1;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.sex-btn.active {
  border-color: var(--shell-accent);
  background: rgba(var(--shell-accent-rgb), 0.08);
  color: var(--shell-accent);
}

.error-banner {
  display: none;
  background: rgba(240, 74, 138, 0.08);
  border: 1px solid rgba(240, 74, 138, 0.28);
  color: #ffd8e6;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.calc-btn {
  width: 100%;
  padding: 18px;
  background: var(--shell-accent);
  color: var(--shell-btn-fg);
  border: none;
  border-radius: 12px;
  font-family: Syne, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.2s;
}

.calc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(var(--shell-accent-rgb), var(--shell-btn-shadow-alpha));
}

.calc-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.results {
  display: none;
}

.results.visible {
  display: block;
  animation: shell-fade-up 0.4s ease;
}

@keyframes shell-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ad-slot {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.recalc-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 12px 28px;
  border-radius: 10px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  display: block;
  margin: 0 auto 60px;
  transition: all 0.2s;
}

.recalc-btn:hover {
  border-color: var(--shell-recalc-hover);
  color: var(--shell-recalc-hover);
}

.seo-content {
  border-top: 1px solid var(--border);
  padding-top: 60px;
  margin-top: 20px;
}

.seo-section {
  max-width: 720px;
  margin: 0 auto 48px;
}

.seo-section h2 {
  font-family: Syne, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.seo-section p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.seo-section strong {
  color: var(--text);
}

.seo-section a {
  color: var(--shell-faq-link);
  text-decoration: none;
}

.faq-list {
  max-width: 720px;
  margin: 0 auto 48px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.faq-item h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  font-family: Syne, sans-serif;
}

.faq-item p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.94rem;
}

.faq-item a {
  color: var(--shell-faq-link);
  text-decoration: none;
}

.tools-nav {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
}

.tools-nav-label {
  font-family: Syne, sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.tools-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.tool-link {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tool-link:hover {
  border-color: var(--shell-tool-link-hover);
  color: var(--shell-tool-link-hover);
}

footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.8;
}

footer a {
  color: var(--shell-footer-link);
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

select option {
  background: var(--surface2);
}
