/* ===========================================================
   StroyCalc — общие стили
   =========================================================== */

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #111827;
  --muted: #5f6b7a;
  --line: #e3e7ec;
  --accent: #0e7c66;
  --accent-dark: #0a5f4f;
  --accent-soft: #e6f4f0;
  --warn: #b45309;
  --warn-bg: #fdf4e3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.page { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- шапка ---------- */

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.logo:hover { text-decoration: none; }
.logo__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.nav { display: flex; gap: 16px; font-size: 14px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

@media (max-width: 720px) {
  .nav { display: none; }
}

/* ---------- типографика ---------- */

h1 {
  font-size: clamp(25px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 12px;
}

h2 { font-size: clamp(20px, 2.6vw, 25px); letter-spacing: -.01em; margin: 32px 0 12px; }
h3 { font-size: 17px; margin: 22px 0 8px; }

p { margin: 0 0 12px; }

.lead { font-size: 17px; color: var(--muted); max-width: 62ch; }

.prose { max-width: 72ch; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose > h2:first-child { margin-top: 8px; }

/* ---------- hero на главной ---------- */

.hero { padding: 40px 0 10px; }
.hero .lead { margin-bottom: 0; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.badges li {
  font-size: 13px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 99px;
  padding: 5px 12px;
}

/* ---------- карточки калькуляторов ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
  margin: 26px 0 40px;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: #cfd8e3; text-decoration: none; }
.card__title { font-weight: 650; font-size: 17px; color: var(--ink); }
.card__desc { color: var(--muted); font-size: 14px; flex: 1; margin: 0; }
.card__cta { font-size: 14px; font-weight: 600; color: var(--accent-dark); }

/* ---------- раскладка страницы калькулятора ---------- */

.breadcrumbs { font-size: 13px; color: var(--muted); padding: 18px 0 6px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { opacity: .6; margin: 0 6px; }

.calc-head { padding: 6px 0 18px; }
.calc-head h1 { margin-bottom: 10px; }

.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 8px;
}
@media (max-width: 900px) {
  .calc-layout { grid-template-columns: 1fr; }
}

.calc-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.calc-group { margin-bottom: 18px; }
.calc-group:last-child { margin-bottom: 0; }
.calc-group-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ---------- поля ---------- */

.field { margin-bottom: 14px; }
.field[hidden] { display: none; }
.field:last-child { margin-bottom: 0; }

.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }

.field-num,
.field-select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  appearance: none;
}
.field-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235f6b7a' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}
.field-num { padding-right: 52px; }

.field-input { position: relative; display: block; }
.field-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
}

.field-num:focus,
.field-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, .15);
}

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

/* ---------- результат ---------- */

.result { position: sticky; top: 74px; }
@media (max-width: 900px) { .result { position: static; } }

.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result-main {
  background: linear-gradient(160deg, #0e7c66, #0a5f4f);
  color: #fff;
  padding: 20px 22px;
}
.result-label { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; opacity: .82; }
.result-value { font-size: clamp(27px, 4.6vw, 36px); font-weight: 750; letter-spacing: -.02em; margin: 5px 0 3px; }
.result-sub { font-size: 14px; opacity: .9; }
.result-sub:empty { display: none; }

.result-rows { margin: 0; padding: 6px 22px 2px; }
.result-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
}
.result-row:last-child { border-bottom: 0; }
.result-row dt { color: var(--muted); }
.result-row dd { margin: 0; font-weight: 600; white-space: nowrap; text-align: right; }
.result-row--total dd { color: var(--accent-dark); }

.result-formula {
  margin: 6px 22px 16px;
  border: 1px dashed #d7dee7;
  border-radius: 10px;
  padding: 10px 13px;
  background: #fafbfc;
  font-size: 13px;
}
.result-formula summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.result-formula ul { margin: 9px 0 0; padding-left: 18px; }
.result-formula li {
  font-family: var(--mono);
  font-size: 12.5px;
  color: #374151;
  margin-bottom: 5px;
  word-break: break-word;
}

.result-notes { margin: 0 22px 16px; display: flex; flex-direction: column; gap: 8px; }
.note { font-size: 13px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); color: #0a5f4f; }
.note--warn { background: var(--warn-bg); color: #92400e; }

.result-actions { padding: 0 22px 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.btn:hover { border-color: #cfd8e3; background: #fbfcfd; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.copy-status { font-size: 13px; color: var(--accent-dark); }

.result-empty { padding: 28px 22px; color: var(--muted); font-size: 14px; }

/* ---------- контентные блоки ---------- */

.section { margin: 40px 0; }
.section--muted { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

.faq { margin: 0; padding: 0; }
.faq details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.faq details[open] summary { margin-bottom: 8px; }
.faq p { color: var(--muted); font-size: 14.5px; margin: 0; }

.related { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0 0; list-style: none; }
.related a {
  display: inline-block;
  font-size: 14px;
  padding: 7px 12px;
  border-radius: 99px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}
.related a:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }

/* ---------- сетка преимуществ ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.5;
}
.feature strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 5px;
}

/* ---------- подвал ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 48px;
  padding: 28px 0 36px;
  font-size: 13.5px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer__row { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 14px; }
.disclaimer { margin-top: 16px; font-size: 12.5px; opacity: .85; max-width: 80ch; }

/* ---------- мелочи ---------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
