@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@600;700;800&display=swap');

:root {
  --primary: #5d8d51;
  --primary-dark: #496f42;
  --accent: #a0e780;
  --ink: #073c6c;
  --text: #2f3732;
  --muted: #66746c;
  --line: #d8e4d4;
  --surface: #ffffff;
  --background: #fbf8f3;
  --secondary: #f4ede2;
  --soft-green: #eaf5e6;
  --red: #c33b4a;
  --shadow: 0 14px 42px rgba(46, 76, 42, .10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, rgba(160, 231, 128, .16), transparent 24rem),
    radial-gradient(circle at 92% 35%, rgba(244, 237, 226, .78), transparent 30rem),
    var(--background);
  font-family: 'Inter', Arial, sans-serif;
  line-height: 1.58;
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { overflow-wrap: break-word; }

.site-header {
  width: min(1080px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid rgba(7, 60, 108, .10);
}

.school-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.school-link span {
  display: inline-block;
  margin-left: 5px;
  transition: transform .2s ease;
}

.school-link:hover span { transform: translate(2px, -2px); }

main { overflow: hidden; }

.hero {
  position: relative;
  isolation: isolate;
  width: min(1080px, calc(100% - 40px));
  margin: 32px auto 48px;
  padding: clamp(32px, 5vw, 52px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: clamp(32px, 5vw, 58px);
  align-items: center;
  background: #f7f7f2 url('assets/background-soft.png') center / cover no-repeat;
  border: 1px solid rgba(93, 141, 81, .16);
  border-radius: 28px;
  box-shadow: 0 10px 34px rgba(46, 76, 42, .07);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(251, 248, 243, .24);
  border-radius: inherit;
}

.eyebrow {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 26px;
  height: 2px;
  background: currentColor;
}

h1, h2, h3 {
  color: var(--ink);
  font-family: 'Montserrat', 'Inter', sans-serif;
}

.app-title {
  max-width: 610px;
  margin: 0;
  font-size: clamp(34px, 4.2vw, 50px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.app-title em {
  display: block;
  margin-top: 6px;
  color: var(--primary);
  font-style: normal;
}

.lead {
  max-width: 590px;
  margin: 22px 0 25px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.68;
}

.hero-support {
  max-width: 600px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: stretch;
}

.measure-card {
  min-height: 150px;
  padding: 18px;
  display: flex;
  gap: 15px;
  align-items: center;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(93, 141, 81, .20);
  border-radius: 18px;
}

.measure-card h2 {
  margin: 0 0 5px;
  font-size: 14px;
}

.measure-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.52;
}

.measure-icon {
  flex: 0 0 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--primary);
  background: var(--soft-green);
}

.measure-icon svg {
  width: 33px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timik-card {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  background: #faf7ec;
  border: 1px solid rgba(93, 141, 81, .20);
  border-radius: 18px;
}

.timik-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 48%;
}

.timik-card p {
  position: absolute;
  z-index: 1;
  left: 8px;
  right: 8px;
  bottom: 8px;
  margin: 0;
  padding: 7px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, .94);
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(7, 60, 108, .10);
  font-size: 9px;
  line-height: 1.35;
}

.timik-card strong {
  display: block;
  color: var(--primary-dark);
}

.calculator-card {
  position: relative;
  padding: clamp(24px, 3.2vw, 34px);
  background: var(--surface);
  border: 1px solid rgba(93, 141, 81, .18);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 22px;
}

.card-heading .step {
  flex: 0 0 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--primary-dark);
  background: var(--soft-green);
  border-radius: 13px;
  font-size: 12px;
  font-weight: 800;
}

.card-heading h2 {
  margin: -2px 0 2px;
  font-size: 21px;
  font-weight: 700;
}

.card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

fieldset {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

legend,
.field > span:first-child {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: var(--soft-green);
  border-radius: 12px;
}

.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented span {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: .2s ease;
}

.segmented input:checked + span {
  color: var(--primary-dark);
  background: white;
  box-shadow: 0 2px 9px rgba(46, 76, 42, .10);
}

.segmented input:focus-visible + span {
  outline: 3px solid rgba(93, 141, 81, .26);
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.field { min-width: 0; }
.input-wrap { position: relative; display: block; }

.input-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 44px 0 14px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  font-size: 15px;
  transition: .2s ease;
}

.input-wrap input::placeholder {
  color: #98a69e;
  font-size: 12px;
}

.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(93, 141, 81, .14);
}

.input-wrap input[aria-invalid="true"] { border-color: var(--red); }

.unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
}

.error {
  min-height: 18px;
  display: block;
  padding: 3px 2px 0;
  color: var(--red);
  font-size: 10px;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  padding: 0 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--primary);
  border: 0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(93, 141, 81, .22);
  transition: .2s ease;
}

.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.text-button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(93, 141, 81, .32);
  outline-offset: 3px;
}

.primary-button span {
  font-size: 21px;
  font-weight: 400;
}

.privacy-note {
  margin: 16px 0 -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.privacy-note svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.result-section { padding: 0 20px 48px; }

.result-panel {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 42px);
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.result-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.result-topline .eyebrow { margin: 0; }

.text-button {
  min-height: 44px;
  padding: 8px;
  color: var(--primary);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
}

.result-grid {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 36px;
  align-items: center;
}

.score-block {
  padding-right: 32px;
  border-right: 1px solid var(--line);
}

.score-block > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.score-block > strong {
  display: block;
  margin: 4px 0 10px;
  color: var(--ink);
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.12;
}

.status-pill {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 20px;
  color: var(--status-color);
  background: color-mix(in srgb, var(--status-color) 12%, white);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.interpretation h2 {
  margin: 0 0 8px;
  font-size: clamp(23px, 3vw, 30px);
}

.interpretation > p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.next-step {
  margin-top: 16px;
  padding: 13px 15px;
  color: var(--text);
  background: var(--soft-green);
  border-left: 3px solid var(--status-color);
  border-radius: 0 10px 10px 0;
  font-size: 12px;
}

.scale-wrap { margin-top: 34px; }

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
}

.scale {
  position: relative;
  height: 8px;
  background: linear-gradient(90deg, #8bb9dd 0 18%, #58a98e 18% 42%, #dfb54f 42% 62%, #e27b4d 62% 80%, #cc4353 80%);
  border-radius: 10px;
}

.scale-marker {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  transition: left .5s ease;
}

.scale-marker i {
  display: block;
  width: 2px;
  height: 18px;
  margin: 0 auto 2px;
  background: var(--ink);
}

.scale-marker b {
  padding: 3px 6px;
  color: white;
  background: var(--ink);
  border-radius: 5px;
  font-size: 9px;
}

.explanation {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto 48px;
  padding: clamp(28px, 4vw, 42px);
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: clamp(34px, 6vw, 68px);
  color: var(--text);
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 32px rgba(46, 76, 42, .06);
}

.explanation h2 {
  max-width: 390px;
  margin: 0;
  font-size: clamp(27px, 3.6vw, 38px);
  line-height: 1.2;
}

.explanation-copy > p {
  margin: 3px 0 20px;
  font-size: 14px;
  line-height: 1.72;
}

.explanation-copy .important {
  margin: 0;
  padding: 16px 18px;
  color: var(--text);
  background: var(--secondary);
  border: 1px solid rgba(200, 164, 119, .24);
  border-radius: 14px;
  font-size: 12px;
}

.explanation-copy strong { color: var(--ink); }

footer {
  width: min(1080px, calc(100% - 40px));
  min-height: 88px;
  margin: 0 auto;
  padding: 24px 0 30px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 10px;
}

footer p { margin: 0; }

footer p:last-child {
  max-width: 620px;
  text-align: right;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    max-width: 720px;
  }

  .hero-copy { text-align: center; }
  .eyebrow { justify-content: center; }
  .lead, .hero-support { margin-left: auto; margin-right: auto; }
  .measure-card { text-align: left; }
  .calculator-card { width: min(500px, 100%); margin: 0 auto; }

  .explanation {
    max-width: 720px;
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .explanation .eyebrow { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .site-header {
    width: calc(100% - 28px);
    min-height: 58px;
  }

  .school-link { font-size: 0; }
  .school-link::before { content: 'В школу'; font-size: 12px; }
  .school-link span { font-size: 12px; }

  .hero {
    width: calc(100% - 24px);
    margin-top: 18px;
    padding: 27px 18px 22px;
    gap: 26px;
    border-radius: 22px;
  }

  .app-title { font-size: clamp(30px, 9.2vw, 40px); }
  .lead { margin-top: 18px; font-size: 14px; }

  .hero-support { grid-template-columns: 1fr; }

  .measure-card {
    min-height: auto;
    padding: 15px;
    align-items: flex-start;
  }

  .measure-icon {
    flex-basis: 44px;
    height: 44px;
  }

  .timik-card {
    min-height: 150px;
    display: grid;
    grid-template-columns: 132px 1fr;
    align-items: center;
    background: rgba(255, 255, 255, .86);
  }

  .timik-card img {
    height: 150px;
    object-position: center;
  }

  .timik-card p {
    position: static;
    margin: 12px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    font-size: 11px;
  }

  .calculator-card {
    padding: 22px 17px;
    border-radius: 18px;
  }

  .fields {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .result-section { padding: 0 12px 36px; }

  .result-panel {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .result-topline { align-items: flex-start; }
  .result-topline .eyebrow { justify-content: flex-start; }

  .text-button {
    max-width: 100px;
    padding-top: 0;
    text-align: right;
  }

  .result-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .score-block {
    padding: 0 0 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .score-block > strong { font-size: 46px; }
  .scale-wrap { margin-top: 34px; }

  .explanation {
    width: calc(100% - 24px);
    margin-bottom: 34px;
    padding: 25px 20px;
    border-radius: 18px;
  }

  footer {
    width: calc(100% - 28px);
    display: block;
    text-align: center;
  }

  footer p:last-child {
    margin: 12px auto 0;
    text-align: center;
  }
}

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