
:root {
  --green: #176b46;
  --green-dark: #10482f;
  --green-light: #e8f5ec;
  --bg: #f5f8f5;
  --text: #20372b;
  --muted: #728076;
  --border: #dfe8e1;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
}

button:hover {
  transform: translateY(-1px);
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  min-height: 70px;
  padding: 14px max(20px, calc((100% - 1100px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 750;
  font-size: 17px;
}

.brand-icon {
  font-size: 25px;
}

.header-tag, .eyebrow {
  font-size: 11px;
  letter-spacing: 1.7px;
  font-weight: 750;
  color: var(--green);
}

.header-tag {
  background: var(--green-light);
  border-radius: 30px;
  padding: 7px 12px;
}

main {
  max-width: 1100px;
  margin: auto;
  padding: 28px 20px 50px;
}

.page {
  animation: pageIn .45s ease both;
}

.hidden {
  display: none !important;
}

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

.hero {
  background: linear-gradient(130deg, #e2f4e6, #f8fcf8);
  border: 1px solid #d8ebdc;
  border-radius: 22px;
  padding: 42px;
  margin-bottom: 23px;
}

.hero h1, .results-heading h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -1.2px;
  margin: 12px 0;
}

.hero p {
  max-width: 620px;
  color: #52675a;
  margin-bottom: 0;
}

.steps {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.step {
  background: white;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 10px 16px;
  font-size: 13px;
}

.step.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px #1b4a2c05;
}

.panel h2, .download-panel h2 {
  font-size: 20px;
  margin: 0 0 5px;
  letter-spacing: -.3px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin: 22px 0;
}

.mode-option {
  cursor: pointer;
  position: relative;
}

.mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 18px;
  transition: .2s;
}

.mode-option input:checked + .mode-card {
  border: 2px solid var(--green);
  background: #f1faf3;
  padding: 17px;
}

.mode-option input:focus-visible + .mode-card {
  outline: 3px solid #8dc7a2;
}

.mode-icon {
  font-size: 25px;
}

.mode-card strong {
  font-size: 16px;
}

.mode-card small, .field small {
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.field label {
  display: block;
  font-weight: 650;
  font-size: 13px;
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  min-width: 0;
  border: 1px solid #d5e1d8;
  border-radius: 9px;
  padding: 12px 13px;
  background: white;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #176b4615;
}

.field > input {
  margin-bottom: 5px;
}

.input-unit {
  display: flex;
  border: 1px solid #d5e1d8;
  border-radius: 9px;
  overflow: hidden;
  background: white;
}

.input-unit:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #176b4615;
}

.input-unit input {
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
}

.input-unit span {
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  background: #f5f8f5;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.privacy-note {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: #edf5ef;
  border-radius: 10px;
  color: #496453;
  font-size: 12px;
  margin: 20px 0;
}

.primary-btn, .outline-btn {
  border-radius: 10px;
  padding: 13px 19px;
  font-weight: 700;
  font-size: 14px;
}

.primary-btn {
  background: var(--green);
  color: white;
  border: 1px solid var(--green);
}

.primary-btn:hover {
  background: var(--green-dark);
  box-shadow: 0 5px 15px #176b4620;
}

#carbonForm > .primary-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
}

.outline-btn {
  background: white;
  border: 1px solid var(--border);
  color: var(--green);
}

.loading-card {
  text-align: center;
  max-width: 580px;
  margin: 50px auto;
  padding: 40px 25px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
}

.loading-card h1 {
  font-size: 27px;
  margin: 15px 0 8px;
}

.loading-card p {
  color: var(--muted);
}

.leaf-scene {
  height: 165px;
  max-width: 240px;
  margin: 0 auto 20px;
  position: relative;
  overflow: hidden;
}

.soil {
  position: absolute;
  width: 95px;
  height: 8px;
  background: #bd9a6a;
  border-radius: 50%;
  bottom: 12px;
  left: calc(50% - 47px);
}

.stem {
  position: absolute;
  bottom: 18px;
  left: calc(50% - 2px);
  width: 4px;
  height: 0;
  background: #36945b;
  border-radius: 10px;
  animation: growStem 2.5s ease-in-out infinite;
}

.leaf {
  position: absolute;
  font-size: 0;
  bottom: 45px;
  left: 50%;
  transform-origin: bottom center;
  animation: growLeaf 2.5s ease-in-out infinite;
}

.leaf-left {
  margin-left: -42px;
  animation-delay: .15s;
}

.leaf-right {
  margin-left: 2px;
  animation-delay: .45s;
}

@keyframes growStem {
  0%, 100% { height: 35px; }
  50% { height: 88px; }
}

@keyframes growLeaf {
  0%, 100% { font-size: 25px; transform: rotate(-25deg) scale(.65); }
  50% { font-size: 58px; transform: rotate(-8deg) scale(1); }
}

.progress-track {
  height: 8px;
  background: #e8f0e9;
  border-radius: 20px;
  overflow: hidden;
  margin: 25px 0;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3a9c62, #9bcf79);
  border-radius: 20px;
  transition: width .2s linear;
}

.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 23px;
}

.results-heading h1 {
  margin-bottom: 6px;
}

.result-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(125deg, #13583a, #218353);
  color: white;
  border-radius: 18px;
  padding: 30px;
  margin-bottom: 20px;
}

.result-label {
  font-size: 12px;
  letter-spacing: 1.3px;
  color: #d8f0df;
  font-weight: 650;
}

.big-number {
  font-size: clamp(38px, 7vw, 58px);
  line-height: 1.25;
  font-weight: 750;
  margin: 12px 0 6px;
  letter-spacing: -1.5px;
}

.big-unit {
  font-size: 22px;
  margin-left: 9px;
  font-weight: 500;
}

.result-description {
  font-size: 12px;
  color: #d8f0df;
}

.result-symbol {
  font-size: 70px;
  animation: floatEarth 3s ease-in-out infinite;
}

@keyframes floatEarth {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.stat-icon {
  font-size: 22px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.stat-card strong {
  font-size: 19px;
  color: var(--green);
  overflow-wrap: anywhere;
}

.stat-card small {
  color: var(--muted);
  font-size: 11px;
}

.chart-bars {
  margin-top: 24px;
}

.chart-row {
  margin: 17px 0;
}

.chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 7px;
}

.chart-track {
  height: 13px;
  background: #edf2ee;
  border-radius: 20px;
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  background: linear-gradient(90deg, #176b46, #79be81);
  border-radius: 20px;
  transition: width .7s ease;
}

.history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding: 18px 0;
}

.history-summary > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.history-summary strong {
  font-size: 22px;
  color: var(--green);
}

.table-wrap {
  overflow-x: auto;
  width: 100%;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th, td {
  padding: 13px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f1f7f2;
  color: #41614c;
  font-weight: 700;
}

td {
  color: #425448;
}

.formula-details {
  background: #f5f8f5;
  border-radius: 10px;
  padding: 15px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.formula-line {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.formula-line:last-child {
  border-bottom: 0;
}

.disclaimer {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin: 16px 0 0;
}

.download-panel {
  background: #e9f5ec;
  border: 1px solid #d6eadb;
  border-radius: 15px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.download-panel p {
  font-size: 13px;
  color: #587060;
  margin-bottom: 0;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 15px;
  background: white;
}

@media (max-width: 700px) {
  .topbar { padding: 13px 16px; }
  .brand { font-size: 14px; }
  .header-tag { font-size: 9px; letter-spacing: .5px; }
  main { padding: 18px 13px 35px; }
  .hero { padding: 27px 22px; }
  .steps { overflow-x: auto; }
  .step { white-space: nowrap; font-size: 11px; padding: 9px 12px; }
  .panel { padding: 19px; }
  .form-grid { gap: 17px 12px; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-hero { padding: 23px 19px; }
  .result-symbol { font-size: 45px; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .download-panel { flex-direction: column; align-items: stretch; }
  .download-actions { flex-direction: column; }
  .actions-row > button { flex: 1 1 100%; }
}

@media (max-width: 420px) {
  .header-tag { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .mode-grid { gap: 9px; }
  .mode-card { padding: 12px; }
  .mode-option input:checked + .mode-card { padding: 11px; }
  .result-symbol { display: none; }
  .result-hero { padding: 22px 18px; }
}
