:root {
  color-scheme: light;
  --green: #16c64f;
  --forest: #146b3a;
  --forest-dark: #0f5730;
  --green-soft: #dff6e4;
  --paper: #fffdf7;
  --off-white: #f7f3e8;
  --ink: #16241f;
  --ink-soft: #526158;
  --line: #e4dfcf;
  --gold: #f4c95d;
  --shadow: 0 12px 32px rgba(11, 32, 22, 0.08);
  font-family: Inter, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(22, 198, 79, .1), transparent 34rem),
    var(--off-white);
  line-height: 1.55;
}

a { color: var(--forest); }

.page-width {
  width: min(100% - 40px, 1000px);
  margin-inline: auto;
}

.site-header {
  min-height: 68px;
  padding: 10px max(20px, calc((100vw - 1000px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(247, 243, 232, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
}

.brand span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--green);
  border-radius: 12px;
}

.hero { padding-block: 62px 44px; }

.eyebrow {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 5px 12px;
  color: var(--forest-dark);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 { line-height: 1.13; }

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2.35rem, 6vw, 4.2rem);
  letter-spacing: -.045em;
}

.hero-copy {
  max-width: 670px;
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.button {
  min-height: 46px;
  padding: 11px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

.button:hover { transform: translateY(-1px); }
.button-primary { color: #0b2016; background: var(--green); }
.button-primary:hover { background: #0fa843; }
.button-secondary { color: var(--forest-dark); background: var(--green-soft); }
.button-secondary:hover { background: #c9efcf; }

.section { padding-block: 36px 48px; }

.section-heading { max-width: 760px; margin-bottom: 24px; }

.section-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -.03em;
}

.section-heading > p:last-child { color: var(--ink-soft); }

.card, .formula-card, .result-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.category-card { margin-bottom: 16px; padding: 24px; }

.category-intro {
  display: flex;
  gap: 15px;
  margin-bottom: 22px;
}

.category-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  border-radius: 15px;
  font-size: 1.4rem;
}

.category-intro h3 { margin: 2px 0 5px; font-size: 1.35rem; }
.category-intro p { margin-bottom: 0; color: var(--ink-soft); }

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

.field-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: .9rem;
  font-weight: 700;
}

.field input, .field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfcbbb;
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
}

.field input:focus, .field select:focus, .check-field input:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(22, 198, 79, .45);
  outline-offset: 2px;
}

.field small, .group-hint { color: var(--ink-soft); font-size: .8rem; font-weight: 400; }
.field small { min-height: 2.4em; }

.subgroup {
  min-width: 0;
  margin: 24px 0 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.subgroup legend { padding: 0; font-size: 1rem; font-weight: 800; }
.group-hint { margin: 3px 0 12px; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check-field {
  min-height: 46px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #f8f6ef;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
}

.check-field input { width: 17px; height: 17px; accent-color: var(--forest); }

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 20px 2px 0;
}

.form-actions p { margin: 0; color: var(--ink-soft); font-size: .85rem; }

.formula-section {
  background: rgba(255, 253, 247, .66);
  border-block: 1px solid var(--line);
}

.accordion-list { display: grid; gap: 12px; }

.formula-card { overflow: hidden; box-shadow: none; }

.formula-card summary {
  min-height: 66px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.formula-card summary::-webkit-details-marker { display: none; }
.formula-card summary::after { content: "+"; color: var(--forest); font-size: 1.5rem; }
.formula-card[open] summary::after { content: "−"; }
.formula-card summary > span:first-child { font-size: 1.05rem; }
.summary-note { margin-left: auto; color: var(--ink-soft); font-size: .84rem; font-weight: 500; }

.formula-content { padding: 0 20px 20px; }
.formula-content p { margin-bottom: 12px; }
.source-note, .method-note { color: var(--ink-soft); font-size: .86rem; }
.method-note { margin: 18px 0 0; padding: 14px 16px; background: var(--green-soft); border-radius: 12px; }

.table-wrap { width: 100%; overflow-x: auto; margin: 14px 0; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; text-align: left; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--forest-dark); background: #f3f6ee; font-weight: 800; }

.result-section { padding-bottom: 64px; }
.result-card { padding: 24px; }
.result-total { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.result-label { width: 100%; color: var(--ink-soft); font-weight: 700; }
.result-total > strong { font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1; letter-spacing: -.04em; }
.result-total > strong span { font-size: 1rem; letter-spacing: 0; }

.status-badge { padding: 8px 12px; color: var(--forest-dark); background: var(--green-soft); border-radius: 999px; font-size: .86rem; font-weight: 800; }
.status-badge.is-over { color: #7d321d; background: #ffe3d7; }

.breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.breakdown > div {
  min-width: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #f8f6ef;
  border-radius: 12px;
}

.breakdown span { color: var(--ink-soft); font-size: .82rem; }
.breakdown strong { overflow-wrap: anywhere; font-size: .95rem; }
.threshold-message { margin: 18px 0 0; color: var(--ink-soft); font-size: .9rem; }
.threshold-message.is-over { color: #7d321d; font-weight: 750; }

.steps {
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.steps li {
  min-height: 68px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.step-number { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; color: var(--forest-dark); background: var(--green-soft); border-radius: 50%; font-weight: 850; }
.steps li > span:nth-child(2) { flex: 1; display: grid; }
.steps small { color: var(--ink-soft); }
.steps b { text-align: right; font-size: .9rem; }

.site-footer {
  padding: 22px max(20px, calc((100vw - 1000px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--ink);
  color: #fffdf7;
  font-size: .84rem;
}

.site-footer p { margin: 0; color: inherit; }
.site-footer a { flex: 0 0 auto; color: #8fe6a4; font-weight: 750; text-decoration: none; }

@media (max-width: 700px) {
  .field-grid-three, .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-card { padding: 19px; }
  .steps li { align-items: flex-start; flex-wrap: wrap; }
  .steps b { width: 100%; margin-left: 45px; text-align: left; }
}

@media (max-width: 480px) {
  .page-width { width: min(100% - 28px, 1000px); }
  .site-header { padding-inline: 14px; }
  .hero { padding-block: 42px 28px; }
  .field-grid, .field-grid-three, .check-grid { grid-template-columns: 1fr; }
  .category-intro { gap: 11px; }
  .category-icon { width: 42px; height: 42px; flex-basis: 42px; }
  .form-actions, .site-footer { align-items: flex-start; flex-direction: column; }
  .formula-card summary { padding-inline: 15px; }
  .summary-note { display: none; }
  .formula-content { padding-inline: 15px; }
  .result-card { padding: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

:root {
  --green: #d9e7ad;
  --forest: #142d21;
  --forest-dark: #142d21;
  --green-soft: #eaf0e2;
  --paper: #fffefa;
  --off-white: #f7f7f0;
  --ink: #16291f;
  --ink-soft: #566459;
  --line: #dce2d5;
  --gold: #d9e7ad;
  --shadow: 0 11px 26px rgba(35, 52, 35, .08);
  color: var(--ink);
  background: var(--off-white);
  font-family: Inter, "Aptos", Arial, sans-serif;
}

body {
  color: var(--ink);
  background: var(--off-white);
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  color: var(--ink);
  background: var(--paper);
  border-radius: 10px;
}

.skip-link:focus { transform: none; }

.site-header {
  width: min(1300px, calc(100% - 96px));
  min-height: 92px;
  margin-inline: auto;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  position: static;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.brand {
  gap: 10px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 760;
  letter-spacing: -.065em;
}

.brand .brand-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  background: #dce9c2;
  border-radius: 14px;
  font-size: 21px;
}

.brand .brand-icon svg {
  width: 25px;
  height: 25px;
}

.brand .brand-name {
  width: auto;
  height: auto;
  display: block;
  background: transparent;
  border-radius: 0;
}

.brand-name small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: .2em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-weight: 550;
}

.header-nav a {
  color: var(--ink);
  text-decoration: none;
}

.header-nav a:hover,
.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.site-header .login {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--forest);
  border-radius: 100px;
  font-weight: 650;
  text-decoration: none;
  transition: transform .18s, background .18s;
}

.site-header .login:hover {
  transform: translateY(-2px);
  background: #244632;
}

.site-header .login svg {
  width: 22px;
  height: 22px;
  display: block;
}

.page-width {
  width: min(1200px, calc(100% - 96px));
}

.hero {
  width: min(1420px, calc(100% - 40px));
  min-height: 460px;
  padding: 56px 7%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  color: #fff;
  background:
    linear-gradient(90deg, #0b1b13ed 0%, #10241ac2 43%, #10241a42 100%),
    url("../assets/hero-materiales.webp") center right / cover no-repeat,
    #142d21;
  border-radius: 28px;
}

.hero .eyebrow {
  padding: 0;
  color: var(--green);
  background: transparent;
  letter-spacing: .13em;
}

.hero h1 {
  max-width: 760px;
  color: #fff;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 610;
  letter-spacing: -.075em;
  line-height: .96;
}

.hero-copy {
  max-width: 620px;
  color: #f0f2e9;
}

.button-primary {
  color: #172a1b;
  background: var(--green);
}

.button-primary:hover { background: #eaf2cc; }
.button-secondary { color: var(--forest); background: var(--green-soft); }
.button-secondary:hover { background: #dce9c2; }

.section {
  padding-block: 68px;
  scroll-margin-top: 18px;
}

.section-heading h2 {
  color: var(--ink);
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  font-weight: 610;
  letter-spacing: -.065em;
  line-height: 1.04;
}

.section-heading > p:last-child { color: var(--ink-soft); }

.card,
.formula-card,
.result-card {
  background: var(--paper);
  border-color: var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.category-card { padding: 24px; }

.category-icon {
  color: #24402a;
  background: #eaf0e2;
  border-radius: 14px;
}

.field input,
.field select {
  color: var(--ink);
  background: var(--paper);
  border-color: #cbd5c4;
  border-radius: 12px;
}

.field input:focus,
.field select:focus,
.check-field input:focus-visible,
.button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #84994f;
  outline-offset: 3px;
}

.check-field,
.breakdown > div {
  background: #f7f8f2;
  border-color: var(--line);
}

.check-field input { accent-color: var(--forest); }

.formula-section {
  background: #eaf0e2;
  border-color: var(--line);
}

.formula-card { box-shadow: none; }
.formula-card summary::after { color: var(--olive, #657747); }
.method-note { background: #eaf0e2; }
th { color: var(--forest); background: #f1f4eb; }

.status-badge {
  color: var(--forest);
  background: #eaf0e2;
}

.status-badge.is-over {
  color: #7d321d;
  background: #ffe3d7;
}

.step-number {
  color: var(--forest);
  background: #eaf0e2;
}

.site-footer {
  padding: 28px max(20px, calc((100vw - 1200px) / 2));
  background: var(--forest);
  color: #fffefa;
}

.site-footer a { color: var(--green); }

@media (max-width: 970px) {
  .site-header,
  .page-width { width: calc(100% - 48px); }
  .header-nav { gap: 14px; }
}

@media (max-width: 700px) {
  .site-header {
    width: calc(100% - 32px);
    min-height: auto;
    padding-block: 13px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .header-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding: 2px 0 5px;
    white-space: nowrap;
    font-size: .9rem;
  }
  .hero {
    width: calc(100% - 24px);
    min-height: 430px;
    padding: 42px 6%;
    background-position: 70% center;
  }
  .page-width { width: calc(100% - 32px); }
  .section { padding-block: 43px; }
}

@media (max-width: 480px) {
  .site-header { width: calc(100% - 32px); padding-inline: 0; }
  .brand { font-size: 21px; }
  .site-header .login { min-height: 42px; padding-inline: 13px; font-size: .86rem; }
  .hero { width: calc(100% - 24px); }
  .page-width { width: calc(100% - 32px); }
  .site-footer { align-items: flex-start; flex-direction: column; }
}
