/* =============================================================
   calc_res.css — калькулятор ресурса смолы/загрузки
   ============================================================= */

.cr-main { background: #F4F1EA; padding-top: 40px; padding-bottom: 40px; }
.cr-section:last-child { margin-bottom: 0; }

/* ── Хлебные крошки ──────────────────────────────────────────────── */
.cr-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: rgba(255,255,255,.5);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.cr-breadcrumb a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color .2s;
}
.cr-breadcrumb a:hover { color: #fff; }
.cr-breadcrumb span[aria-current] { color: rgba(255,255,255,.85); }

/* ── Хиро ──────────────────────────────────────────────────── */
.cr-hero {
  background: var(--dark);
  color: #fff;
  padding: 24px 0 48px;
}
.cr-hero__title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 16px;
}
.cr-hero__sub {
  font-size: var(--fs-lg);
  color: rgba(255,255,255,.7);
  margin: 0 0 24px;
}
.cr-hero__cta { display: inline-block; }

/* ── Блок формулы ────────────────────────────────────────────── */
.cr-section { margin-bottom: 40px; }
.cr-section__title {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 0 0 16px;
}
.cr-section__title--h3 {
  font-size: var(--fs-md);
  font-weight: 600;
}

.cr-text {
  font-size: var(--fs-base);
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 16px;
}
.cr-text:last-child { margin-bottom: 0; }

.cr-params {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cr-params li {
  font-size: var(--fs-base);
  line-height: 1.5;
  padding-left: 20px;
  position: relative;
}
.cr-params li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--muted);
}
.cr-params a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.cr-formula {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
@media (min-width: 640px) {
  .cr-formula { gap: 64px; }
}
.cr-formula__eq {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  font-family: 'Courier New', monospace;
  white-space: nowrap;
}
.cr-formula__vars {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cr-formula__vars li {
  font-size: var(--fs-base);
  color: var(--muted);
  line-height: 1.4;
}
.cr-formula__vars strong { color: var(--dark); }

.cr-note {
  background: #fff3cd;
  border-left: 3px solid #e6a817;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 12px 16px;
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── Калькулятор ─────────────────────────────────────────────── */
.cr-calc {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 40px;
}
.cr-calc__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--dark);
}
.cr-calc__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.cr-calc__field label {
  display: block;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}
.cr-calc__field select,
.cr-calc__field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--dark);
  background: #fff;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}
.cr-calc__field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.cr-calc__field select:focus,
.cr-calc__field input:focus { border-color: var(--blue); }
.cr-calc__hint {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 2px 0 6px;
  line-height: 1.4;
}

.cr-calc__result {
  background: var(--dark);
  border-radius: var(--r-md);
  padding: 20px;
  color: #fff;
}
.cr-calc__result-label {
  font-size: var(--fs-base);
  font-weight: 600;
  color: rgba(255,255,255,.65);
  margin: 0 0 6px;
}
.cr-calc__result-value {
  font-size: var(--fs-2xl);
  font-weight: 800;
  line-height: 1;
  margin: 0 0 8px;
  color: #fff;
}
.cr-calc__result-sub {
  font-size: var(--fs-base);
  color: rgba(255,255,255,.5);
  line-height: 1.5;
  margin: 0;
}

/* ── Диаграмма SVG ──────────────────────────────────────────── */
.cr-diagram {
  margin: 16px 0 24px;
}
.cr-diagram__caption {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-style: italic;
  margin-top: 8px;
}

/* ── Результат калькулятора (строки) ─────────────────────────── */
.cr-calc__result-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}
.cr-calc__result-row:last-of-type { margin-bottom: 0; }
.cr-calc__result-row--accent .cr-calc__result-label { color: rgba(255,255,255,.85); }
.cr-calc__result-row--accent .cr-calc__result-value { color: #fff; }

/* Поля калькулятора Б: перенос на мобиле, строка на десктопе */
.cr-calc__fields--wrap { flex-wrap: wrap; }
@media (min-width: 640px) {
  .cr-calc__fields--wrap .cr-calc__field { min-width: 0; }
}

/* ── FAQ аккордеон ───────────────────────────────────────────── */
.cr-faq { display: flex; flex-direction: column; }
.cr-faq__item {
  border-bottom: 1px solid var(--border);
}
.cr-faq__item:first-child { border-top: 1px solid var(--border); }
.cr-faq__q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 16px 0;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  text-align: left;
  gap: 16px;
}
.cr-faq__q:hover { color: var(--blue); }
.cr-faq__chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px);
  transition: transform .2s;
}
.cr-faq__item.is-open .cr-faq__chevron {
  transform: rotate(-135deg) translateY(-3px);
}
.cr-faq__a {
  display: none;
  padding-bottom: 16px;
}
.cr-faq__item.is-open .cr-faq__a { display: block; }
.cr-faq__a p {
  font-size: var(--fs-base);
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ── Причины погрешности ─────────────────────────────────────── */
.cr-reasons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 0;
}
.cr-reason {
  padding: 20px 24px;
  border-left: 3px solid var(--blue);
}
.cr-reason__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  margin: 0 0 6px;
}
.cr-reason__text {
  font-size: var(--fs-base);
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
@media (max-width: 639px) {
  .cr-reasons { grid-template-columns: 1fr; }
}

/* ── Таблица сравнения ───────────────────────────────────────── */
.cr-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
}
.cr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}
.cr-table thead th {
  padding: 10px 16px;
  background: #F4F1EA;
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--dark);
  white-space: nowrap;
  border-bottom: 1.5px solid var(--border);
  text-align: left;
}
.cr-table thead th:last-child { text-align: right !important; }
.cr-table__cap-th { text-align: right !important; }
.cr-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid #edeae4;
  vertical-align: middle;
}
.cr-table tbody tr:last-child td { border-bottom: none; }
.cr-table tbody tr:nth-child(even) td { background: #faf9f6; }
.cr-table tbody td:first-child { font-weight: 600; color: var(--dark); }
.cr-table tbody td.cr-table__group {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: #f0ede7;
  padding: 8px 16px;
}
.cr-table__capacity {
  text-align: right;
  font-weight: 600;
  color: var(--dark);
}
.cr-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cr-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--blue);
  flex-shrink: 0;
}

/* ── CTA ──────────────────────────────────────────────────────── */
.cr-cta {
  background: var(--dark);
  padding-block: 36px 24px;
  color: #fff;
}
.cr-cta__title {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 0 0 12px;
}
.cr-cta__sub {
  font-size: var(--fs-base);
  color: rgba(255,255,255,.7);
  margin: 0 0 20px;
}
.cr-cta__field {
  display: flex;
  gap: 12px;
  align-items: center;
}
.cr-cta__inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cr-cta__inputs input {
  width: 188px;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: var(--fs-base);
  padding: 12px 16px;
  outline: none;
  transition: border-color .2s;
}
.cr-cta__inputs input::placeholder { color: rgba(255,255,255,.45); }
.cr-cta__inputs input:focus { border-color: rgba(255,255,255,.7); }
.cr-cta__btn { align-self: center; height: 48px; padding-inline: 16px; }
.cr-cta__error { margin-top: 6px; font-size: var(--fs-xs); color: #ff8080; }
.cr-cta__success { margin-top: 6px; font-size: var(--fs-sm); color: #a3e8b0; }

/* ── Адаптив ─────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .cr-hero { padding: 64px 0 56px; }
  .cr-calc__fields { flex-direction: row; flex-wrap: nowrap; align-items: stretch; }
  .cr-calc__fields .cr-calc__field { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .cr-calc__fields .cr-calc__field select,
  .cr-calc__fields .cr-calc__field input { margin-top: auto; }
  .cr-cta__inputs { flex-direction: row; }
  /* не жёсткие 260px: на 640–700px два поля + кнопка не влезали
     и давали горизонтальный скролл страницы */
  .cr-cta__inputs input { flex: 1 1 0; min-width: 0; max-width: 260px; }
  .cr-cta__btn { height: 48px; align-self: stretch; padding-inline: 16px; }
}

@media (min-width: 1024px) {
  .cr-calc { scroll-margin-top: calc(var(--header-h) + 16px); }
  .cr-cta__btn { padding-inline: 24px; }
}
