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

:root {
  --blue: #527b5e;
  --blue-dark: #365e48;
  --blue-soft: #edf3e7;
  --navy: #294b3c;
  --text: #4d6257;
  --muted: #77877e;
  --line: #dce5d8;
  --surface: #ffffff;
  --background: #f6f3e9;
  --green: #27876b;
  --amber: #bd8e54;
  --orange: #d35a2a;
  --red: #c33b4a;
  --shadow: 0 24px 70px rgba(47, 83, 62, .13);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 16%, rgba(123, 158, 92, .14), transparent 27rem),
    var(--background);
  font-family: 'Manrope', Arial, sans-serif;
  line-height: 1.6;
}

a { color: inherit; }

button, input { font: inherit; }

button { cursor: pointer; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 108px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(19, 37, 58, .1);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--navy);
  text-decoration: none;
}

.brand-logo { position: relative; width: 215px; height: 100px; display: block; overflow: hidden; }
.brand-logo img { position: absolute; width: 210px; max-width: none; left: 0; top: -45px; }

.school-link {
  color: var(--blue);
  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 {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 74px 0 94px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 480px);
  gap: clamp(52px, 8vw, 108px);
  align-items: center;
}

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

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

h1, h2, p { overflow-wrap: break-word; }

h1 {
  margin: 0;
  color: var(--navy);
  font-family: 'Prata', Georgia, serif;
  font-size: clamp(43px, 5.4vw, 72px);
  font-weight: 400;
  line-height: 1.11;
  letter-spacing: -.045em;
}

h1 em { color: var(--blue); font-weight: inherit; }

.app-title {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: clamp(36px, 4.3vw, 58px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.app-title em { font-style: normal; }

.lead {
  max-width: 600px;
  margin: 27px 0 33px;
  color: #5f7067;
  font-size: 17px;
  line-height: 1.75;
}

.hero-support {
  max-width: 600px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(190px, .85fr);
  gap: 14px;
  align-items: stretch;
}

.measure-card {
  padding: 20px 22px;
  display: flex;
  gap: 17px;
  align-items: center;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(82,123,94,.2);
  border-radius: 16px;
}

.measure-card h2 { margin: 0 0 4px; color: var(--navy); font-size: 14px; }
.measure-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.measure-icon { flex: 0 0 55px; height: 55px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); }
.measure-icon svg { width: 38px; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.timik-card {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  background: #faf7ec;
  border: 1px solid rgba(82,123,94,.2);
  border-radius: 16px;
}

.timik-card img {
  position: absolute;
  width: auto;
  height: 100%;
  min-width: 100%;
  max-width: none;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.timik-card p {
  position: absolute;
  z-index: 1;
  left: 9px;
  right: 9px;
  bottom: 9px;
  margin: 0;
  padding: 8px 10px;
  color: var(--navy);
  background: rgba(255,255,255,.92);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(41,75,60,.12);
  font-size: 9px;
  line-height: 1.4;
}

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

.calculator-card {
  position: relative;
  padding: clamp(28px, 4vw, 43px);
  background: var(--surface);
  border: 1px solid rgba(82, 123, 94, .1);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.calculator-card::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 18px -18px -18px 18px;
  border: 1px solid rgba(82,123,94,.18);
  border-radius: inherit;
}

.card-heading { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 29px; }
.card-heading .step { flex: 0 0 42px; height: 42px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 50%; font-size: 12px; font-weight: 800; }
.card-heading h2 { margin: -2px 0 2px; color: var(--navy); font-family: 'Prata', Georgia, serif; font-size: 24px; font-weight: 400; }
.card-heading p { margin: 0; color: var(--muted); font-size: 11px; }

fieldset { margin: 0 0 23px; padding: 0; border: 0; }
legend, .field > span:first-child { display: block; margin-bottom: 9px; color: var(--navy); font-size: 12px; font-weight: 700; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #f1f5f9; border-radius: 11px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 43px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 600; transition: .2s ease; }
.segmented input:checked + span { color: var(--blue-dark); background: white; box-shadow: 0 2px 9px rgba(41,75,60,.1); }
.segmented input:focus-visible + span { outline: 3px solid rgba(82,123,94,.24); }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { min-width: 0; }
.input-wrap { position: relative; display: block; }
.input-wrap input {
  width: 100%;
  height: 54px;
  padding: 0 47px 0 15px;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  font-size: 15px;
  transition: .2s ease;
}
.input-wrap input::placeholder { color: #a5b1bd; font-size: 12px; }
.input-wrap input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(82,123,94,.12); }
.input-wrap input[aria-invalid="true"] { border-color: var(--red); }
.unit { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }
.error { min-height: 19px; display: block; padding: 3px 2px 0; color: var(--red); font-size: 10px; }

.primary-button {
  width: 100%;
  min-height: 57px;
  margin-top: 5px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(54,94,72,.22);
  transition: .2s ease;
}
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button:focus-visible, .text-button:focus-visible, a:focus-visible { outline: 3px solid rgba(82,123,94,.28); outline-offset: 3px; }
.primary-button span { font-size: 22px; font-weight: 400; }

.privacy-note { margin: 20px 0 -4px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #8a99a8; font-size: 10px; }
.privacy-note svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.result-section { padding: 10px 20px 90px; }
.result-panel { width: min(960px, 100%); margin: 0 auto; padding: clamp(28px, 5vw, 56px); background: white; border-radius: 24px; box-shadow: var(--shadow); }
.result-topline { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 30px; }
.result-topline .eyebrow { margin: 0; }
.text-button { padding: 6px; color: var(--blue); background: transparent; border: 0; font-size: 12px; font-weight: 700; }
.result-grid { display: grid; grid-template-columns: 210px 1fr; gap: 48px; align-items: center; }
.score-block { padding-right: 42px; 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(--navy); font-family: 'Prata', Georgia, serif; font-size: 58px; font-weight: 400; line-height: 1.15; }
.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 9px; color: var(--navy); font-family: 'Prata', Georgia, serif; font-size: clamp(25px, 4vw, 34px); font-weight: 400; }
.interpretation > p { margin: 0; color: var(--text); font-size: 14px; }
.next-step { margin-top: 18px; padding: 14px 16px; color: #40566d; background: #f5f9fd; border-left: 3px solid var(--status-color); border-radius: 0 9px 9px 0; font-size: 12px; }
.scale-wrap { margin-top: 43px; }
.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(--navy); }
.scale-marker b { padding: 3px 6px; color: white; background: var(--navy); border-radius: 5px; font-size: 9px; }

.explanation {
  padding: 83px max(20px, calc((100% - 1180px) / 2));
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 80px;
  color: #e0e9e2;
  background: #294b3c;
}
.explanation h2 { max-width: 440px; margin: 0; color: white; font-family: 'Prata', Georgia, serif; font-size: clamp(32px, 4.5vw, 51px); font-weight: 400; line-height: 1.25; }
.explanation-copy > p { margin: 3px 0 25px; font-size: 15px; line-height: 1.8; }
.explanation-copy .important { margin: 0; padding: 18px 21px; color: #c9d9e8; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; font-size: 12px; }
.explanation-copy strong { color: white; }

footer {
  min-height: 105px;
  padding: 30px max(20px, calc((100% - 1180px) / 2));
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: center;
  color: #a2b1a7;
  background: #203d31;
  font-size: 10px;
}
footer p { margin: 0; }
footer p:last-child { max-width: 600px; text-align: right; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 54px; }
  .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(520px, 100%); margin: 0 auto; }
  .explanation { grid-template-columns: 1fr; gap: 35px; }
  .explanation .eyebrow { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .site-header { width: calc(100% - 28px); min-height: 82px; }
  .school-link { font-size: 0; }
  .school-link::before { content: 'В школу'; font-size: 12px; }
  .school-link span { font-size: 12px; }
  .brand-logo { width: 160px; height: 76px; }
  .brand-logo img { width: 158px; top: -34px; }
  .hero { width: calc(100% - 28px); padding: 44px 0 72px; gap: 40px; }
  h1 { font-size: clamp(38px, 12vw, 51px); }
  .app-title { font-size: clamp(32px, 9.7vw, 42px); }
  .lead { font-size: 15px; }
  .measure-card { padding: 16px; align-items: flex-start; }
  .measure-icon { flex-basis: 46px; height: 46px; }
  .measure-icon svg { width: 31px; }
  .hero-support { grid-template-columns: 1fr; }
  .timik-card { min-height: 240px; }
  .timik-card img { width: auto; height: 100%; top: 50%; }
  .timik-card p { left: 14px; right: 14px; bottom: 13px; padding: 10px 12px; font-size: 10px; }
  .calculator-card { padding: 25px 19px; border-radius: 19px; }
  .calculator-card::before { display: none; }
  .fields { grid-template-columns: 1fr; gap: 4px; }
  .result-section { padding: 0 14px 70px; }
  .result-panel { padding: 27px 20px; border-radius: 18px; }
  .result-topline { align-items: flex-start; }
  .result-topline .eyebrow { justify-content: flex-start; }
  .text-button { max-width: 90px; padding-top: 0; text-align: right; }
  .result-grid { grid-template-columns: 1fr; gap: 25px; }
  .score-block { padding: 0 0 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .score-block > strong { font-size: 50px; }
  .scale-wrap { margin-top: 38px; }
  .explanation { padding-top: 64px; padding-bottom: 64px; }
  footer { display: block; text-align: center; }
  footer p:last-child { margin: 13px auto 0; text-align: center; }
}

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