/* === Base === */
html, body { margin: 0; padding: 0; }
body {
  overflow-x: hidden;
  background-color: #f9f9fb;
  color: #1c1c1c;
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.6;
}

:root {
  --header-desktop-h: 64px;
  --banner-h-min: 78px;
  --banner-h-ideal: 23vw;
  --banner-h-max: 104px;
}

.content-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

section {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  margin: 30px 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

/* === Header === */
header {
  background: #10316B;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.logo-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 20px;
  box-sizing: border-box;
}
.site-logo { height: 34px; width: auto; display: block; margin-right: 16px; }
.menu-toggle {
  display: none;
  font-size: 26px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}
nav { display: flex; flex-wrap: wrap; gap: 10px; }
nav a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: 0.2s;
}
nav a:hover { color: #f5d42a; }

/* === Header Banner === */
.header-banner {
  background: #10316B;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.header-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}
.header-banner__link,
.header-banner picture,
.header-banner img { display: block; width: 100%; }
.header-banner img {
  height: auto;
  object-fit: contain;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* === CTA under banner === */
.header-cta {
  background: #10316B;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.header-cta__wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
}
.header-cta__text {
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.35;
}
.header-cta__text strong { font-size: 18px; letter-spacing: .2px; }
.header-cta__text span { font-size: 14px; opacity: .95; }
.header-cta .btn-cta {
  display: inline-block;
  white-space: nowrap;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00b960, #02a0f2);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  margin-left: auto;
}
.header-cta .btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
  filter: saturate(1.1);
}

/* === Calculator Offer (под калькулятором) === */
.calc-offer {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #c5e3c5;
  background: #f3fbf3;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 16px;
  color: #114421;
  overflow: hidden;
}
.calc-offer__btn {
  display: inline-block;
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00b960, #02a0f2);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  transition: all 0.25s ease;
}
.calc-offer__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.20);
  filter: saturate(1.1);
}

/* === Mobile === */
@media (max-width: 768px) {
  header {
    position: static;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    box-shadow: none;
    border-bottom: none;
  }
  .logo-nav { max-width: none; padding: 10px 16px; }
  .menu-toggle { display: block; }
  nav {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #10316B;
    margin-top: 10px;
  }
  nav a { padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
  nav.active { display: flex; }

  .header-banner {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-bottom: 1px solid rgba(255,255,255,0.12);
  }
  .header-banner img {
    width: 100vw;
    height: clamp(var(--banner-h-min), var(--banner-h-ideal), var(--banner-h-max));
    object-fit: cover;
    object-position: center;
    background: #10316B;
    border-radius: 0;
    box-shadow: none;
  }

  .header-cta {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    overflow: hidden;
  }
  .header-cta__wrap {
    max-width: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px 16px;
  }
  .header-cta__text { text-align: center; }
  .header-cta .btn-cta {
    width: 100%;
    border-radius: 14px;
    padding: 14px 18px;
    margin-left: 0;
  }

  .calc-offer {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 12px;
  }
  .calc-offer__btn {
    width: 100%;
    margin-top: 8px;
    border-radius: 14px;
    padding: 14px 18px;
  }
}

/* === Desktop: баннер плотно под меню, без щели === */
@media (min-width: 769px) {
  header { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
  .header-banner {
    position: relative;
    top: 0;
    margin-top: -8px;   /* если снова появится тонкая щель — увеличь до -10…-12px */
    z-index: 1;
  }
  .header-banner__inner { margin-top: 0; }
  .header-banner img { border-radius: 0 0 10px 10px; display: block; }
}

/* === Safe defaults for media / buttons === */
img, .header-cta .btn-cta, .calc-offer__btn {
  max-width: 100%;
  box-sizing: border-box;
}
img { height: auto; display: block; }

/* ==== Kalkulátor — чистый скин ==== */

/* Карточка */
#kalkulator .calculator{
  background:#fff;
  border:1px solid #E6ECF3;
  border-radius:14px;
  padding:20px 20px 24px;
  box-shadow:0 4px 16px rgba(16,49,107,.06);
}

/* Сетка полей */
#kalkulator .calculator .input-row{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:14px;
  margin-bottom:14px;
}
@media (max-width: 960px){
  #kalkulator .calculator .input-row{ grid-template-columns:repeat(3,1fr); }
}
@media (max-width: 720px){
  #kalkulator .calculator .input-row{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 440px){
  #kalkulator .calculator .input-row{ grid-template-columns:1fr; }
}

/* Подписи */
#kalkulator .calculator label{
  display:flex;
  flex-direction:column;
  gap:8px;
  font-weight:600;
  font-size:14px;
  color:#10316B;
  margin:0;
}

/* Поля ввода */
#kalkulator .calculator input[type="number"]{
  height:46px;
  padding:10px 12px;
  font-size:16px;
  border:1.5px solid #D6DEE8;
  border-radius:10px;
  background:#FBFDFF;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
  width:100%;
  box-sizing:border-box;
}
#kalkulator .calculator input[type="number"]:focus{
  border-color:#2E86FF;
  box-shadow:0 0 0 3px rgba(46,134,255,.15);
  background:#fff;
}
#kalkulator .calculator input::placeholder{ color:#99A6B7; }
/* убрать стрелки у number */
#kalkulator input[type=number]::-webkit-outer-spin-button,
#kalkulator input[type=number]::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
#kalkulator input[type=number]{ -moz-appearance:textfield; }

/* «Tét / kombináció» — на всю ширину */
#kalkulator .calculator .input-row + .input-row label{ grid-column:1 / -1; }

/* Кнопка */
#kalkulator button[type="submit"]{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding:12px 24px; height:48px;
  border:none; border-radius:999px;
  background:linear-gradient(90deg,#00b960,#02a0f2);
  color:#fff; font-weight:700; font-size:16px;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(0,0,0,.12);
  transition:transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
#kalkulator button[type="submit"]:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 24px rgba(0,0,0,.16);
  filter:saturate(1.08);
}
@media (max-width: 520px){
  #kalkulator button[type="submit"]{ width:100%; }
}

/* Результат */
#kalkulator .result{
  margin-top:16px;
  padding:16px 18px;
  background:#F1FAF3;
  border:1px solid #CFE9D6;
  color:#103B23;
  border-radius:12px;
  font-size:18px; line-height:1.5;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
}
#kalkulator .result.is-error{
  background:#FFF6F6;
  border-color:#F3C4C4;
  color:#822;
}

/* Блок «Как пользоваться» */
#kalkulator .instructions{
  margin-top:22px;
  padding:16px 18px;
  border:1px solid #F3D9A4;
  background:#FFF9EC;
  border-radius:12px;
}
#kalkulator .instructions h3{ margin:0 0 8px; font-size:18px; }
#kalkulator .instructions ol{ margin:10px 0 0; padding-left:18px; }

.full-width-banner { width: 100%; margin: 30px 0; }
.full-width-banner img {
  width: 100%;
  height: auto;
  display: block;  
}

#diagram .diagram-image {
  display: flex;
  justify-content: center;
}
#diagram .diagram-image img {
  margin: 0 auto;
  max-width: min(720px, 100%);
  display: block;
}

@media (max-width: 768px) {
  .header-cta .btn-cta {
    text-align: center;
    justify-content: center;
  }
}