/* Калькулятор больничного листа — пошаговый мастер. Scoped под #bl-calc. */

/* Единый шрифт по всему калькулятору и результату — как в дизайне сайта (Unbounded, sans-serif).
   ID-специфичность перебивает inputs-style, где инпуты/числа заданы serif. */
#bl-calc, #bl-calc .calculator,
#bl-calc input, #bl-calc select, #bl-calc button, #bl-calc textarea,
#bl-calc .label-text, #bl-calc .tax-result span,
#bl-calc .tax-result .amount-group span, #bl-calc .amount-group span:first-child {
  font-family: "Unbounded", sans-serif;
}

#bl-calc .calculator { color: #000; }

/* ── Прогресс ─────────────────────────────────────────────── */
#bl-calc .bl-progress { margin-bottom: 16px; }
#bl-calc .bl-progress-track {
  height: 2px; background: #eee; border-radius: 2px; overflow: hidden; margin-bottom: 12px;
}
#bl-calc .bl-progress-bar { height: 100%; width: 0; background: #000; transition: width .3s ease; }
#bl-calc .bl-dots { display: flex; gap: 4px; }
#bl-calc .bl-dot {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: "Unbounded", sans-serif; font-size: 12px; line-height: 1.2; color: #999; text-align: center;
}
#bl-calc .bl-dot span {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1px solid #ddd; font-size: 12px; background: #fff; color: #999; transition: .2s;
}
#bl-calc .bl-dot.cur { color: #000; }
#bl-calc .bl-dot.cur span { border-color: #000; color: #000; }
#bl-calc .bl-dot.done span { background: #000; border-color: #000; color: #fff; }

/* ── Шаги ─────────────────────────────────────────────────── */
#bl-calc .bl-step { display: none; animation: blfade .25s ease; }
#bl-calc .bl-step.active { display: block; }
@keyframes blfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#bl-calc .bl-step > .label-text { font-size: 13px; opacity: 1; margin-bottom: 12px; font-weight: 600; }

/* ── Список выбора (radio-карточки) ───────────────────────── */
#bl-calc .bl-radio-list { display: flex; flex-direction: column; gap: 8px; }
#bl-calc .bl-radio {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1px solid #ddd; border-radius: 14px; padding: 14px 16px; transition: .15s; background: #fff;
}
#bl-calc .bl-radio:hover { border-color: #bbb; }
#bl-calc .bl-radio:has(input:checked) { border-color: #000; box-shadow: inset 0 0 0 1px #000; }
#bl-calc .bl-radio span { font-size: 13px; line-height: 1.35; }
#bl-calc .bl-radio span small { display: block; font-size: 12px; opacity: .55; margin-top: 2px; }

/* нативные radio/checkbox — сброс глобального инпут-стиля дизайн-системы */
#bl-calc input[type="radio"], #bl-calc input[type="checkbox"] {
  appearance: auto; -webkit-appearance: auto;
  width: 20px; height: 20px; min-width: 20px; flex: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: none;
  display: inline-block; accent-color: #000; cursor: pointer;
}

/* ── Поля ─────────────────────────────────────────────────── */
#bl-calc .form-group input[type="number"], #bl-calc .form-group input[type="text"] {
  height: 64px; padding: 24px 16px 8px; font-size: 15px;
  text-align: left; justify-content: flex-start; display: block; margin-bottom: 0;
}
#bl-calc .form-group { margin-bottom: 12px; }
/* два поля в строке — равные половины (иначе селект НДФЛ не заполняет колонку) */
#bl-calc .form-group__wrapper { align-items: stretch; }
#bl-calc .form-group__wrapper > .form-group { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
#bl-calc .bl-select-wrap { position: relative; width: 100%; }
#bl-calc select.bl-select {
  width: 100%; height: 64px; padding: 22px 40px 8px 16px; margin: 0;
  border: 1px solid #ddd; border-radius: 16px; background: #fff; color: #000;
  font-family: "Unbounded", sans-serif; font-size: 15px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M7 10l5 5l5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* чекбокс «нет заработка» */
#bl-calc .bl-check {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid #ddd; border-radius: 14px; padding: 12px 16px; margin-top: 8px; font-size: 12px;
}
#bl-calc .bl-check:has(input:checked) { border-color: #000; }

/* вкладки заработка + периоды «по зарплате» */
#bl-calc .bl-earn-tabs { margin-bottom: 12px; }
#bl-calc .bl-period {
  border: 1px solid #eee; border-radius: 14px; padding: 12px 12px 10px; margin-bottom: 8px;
}
#bl-calc .bl-period .form-group__wrapper { margin-bottom: 0; }
#bl-calc .bl-p-remove {
  width: auto; margin: 8px 0 0; padding: 0; border: 0; background: none;
  font-family: "Unbounded", sans-serif; font-size: 12px; color: #b00020; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
#bl-calc .bl-p-remove:hover { background: none; opacity: .75; }
#bl-calc .bl-add-period {
  width: auto; margin: 2px 0 4px; padding: 10px 16px; border: 1px dashed #bbb; border-radius: 12px;
  background: #fff; font-family: "Unbounded", sans-serif; font-size: 12px; color: #000; cursor: pointer;
}
#bl-calc .bl-add-period:hover { background: #f7f9fc; opacity: 1; }

#bl-calc .bl-preview {
  margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: #000;
  background: #f7f9fc; border-radius: 12px; padding: 12px 14px;
}
#bl-calc .bl-hint { margin: 10px 0 0; font-size: 12px; line-height: 1.5; opacity: .6; }
#bl-calc .bl-cap { font-size: 12px; color: #b00020; }

/* расширенные параметры */
#bl-calc .bl-adv-toggle {
  width: auto; margin: 12px 0 0; padding: 0; border: 0; background: none;
  font-family: "Unbounded", sans-serif; font-size: 12px; color: #000; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-underline-offset: 3px;
}
#bl-calc .bl-adv-toggle::after { content: "▾"; transition: transform .2s; }
#bl-calc .bl-adv-toggle.open::after { transform: rotate(180deg); }
#bl-calc .bl-adv { display: none; margin-top: 12px; }

/* ── Навигация ────────────────────────────────────────────── */
#bl-calc .bl-nav { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
#bl-calc .bl-nav button { width: auto; flex: 0 0 auto; padding: 14px 22px; }
#bl-calc .bl-nav #bl-next { background: #000; color: #fff; }
#bl-calc .bl-nav #bl-next:hover { background: #000; opacity: .85; }
#bl-calc .bl-nav #bl-back { background: #fff; }
#bl-calc .bl-nav #bl-back:disabled { opacity: .35; cursor: default; }
#bl-calc .bl-step-label { flex: 1; text-align: center; font-size: 12px; opacity: .55; }

/* ── Результат ────────────────────────────────────────────── */
#bl-calc .calculator__result { margin-top: 16px; }
#bl-calc .tax-result.bl-net span, #bl-calc .tax-result.bl-net .amount-group span:first-child { font-weight: 700; }
#bl-calc .tax-result.bl-net .amount-group span:first-child { font-size: 20px; }
#bl-calc .bl-split { display: flex; gap: 8px; border: 0; padding: 0; }
#bl-calc .bl-split > div {
  flex: 1; border: 1px solid #ddd; border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
#bl-calc .bl-split span { font-size: 12px; opacity: .6; line-height: 1.3; }
#bl-calc .bl-split b { font-size: 15px; }
#bl-calc .bl-how { border: 1px solid #ddd; border-radius: 12px; padding: 0; }
#bl-calc .bl-how summary {
  cursor: pointer; padding: 12px 16px; font-size: 12px; list-style: none; user-select: none;
}
#bl-calc .bl-how summary::-webkit-details-marker { display: none; }
#bl-calc .bl-how summary::before { content: "▸ "; }
#bl-calc .bl-how[open] summary::before { content: "▾ "; }
#bl-calc .bl-how ol { margin: 0; padding: 0 16px 16px 34px; }
#bl-calc .bl-how li { font-size: 12px; line-height: 1.6; color: #000; margin-bottom: 6px; }

/* ── Мобайл ───────────────────────────────────────────────── */
@media screen and (max-width: 767px) {
  #bl-calc .form-group__wrapper { flex-direction: column; gap: 0; }
  #bl-calc .form-group__wrapper .form-group { margin-bottom: 12px; }
  #bl-calc .bl-dot { font-size: 0; }              /* прячем подписи, оставляем номера */
  #bl-calc .bl-dot span { font-size: 13px; }
  #bl-calc .bl-split { flex-direction: column; }
  #bl-calc .bl-nav button { padding: 14px 16px; }
}

/* ── Таблицы в тексте ─────────────────────────────────────── */
.bl-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 14px; }
.bl-table th, .bl-table td { border: 1px solid #e5e7eb; padding: 8px 10px; text-align: left; vertical-align: top; }
.bl-table th { background: #f7f9fc; font-weight: 600; }
.bl-table td:first-child { font-weight: 600; }
