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

/* Единый шрифт (Unbounded, sans-serif) — перебиваем serif из inputs-style. */
#pens-calc, #pens-calc .calculator,
#pens-calc input, #pens-calc select, #pens-calc button, #pens-calc textarea,
#pens-calc .label-text, #pens-calc .tax-result span,
#pens-calc .tax-result .amount-group span, #pens-calc .amount-group span:first-child {
  font-family: "Unbounded", sans-serif;
}
#pens-calc .calculator { color: #000; }

/* ── Прогресс ─────────────────────────────────────────────── */
#pens-calc .pens-progress { margin-bottom: 16px; }
#pens-calc .pens-progress-track { height: 2px; background: #eee; border-radius: 2px; overflow: hidden; margin-bottom: 12px; }
#pens-calc .pens-progress-bar { height: 100%; width: 0; background: #000; transition: width .3s ease; }
#pens-calc .pens-dots { display: flex; gap: 4px; }
#pens-calc .pens-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: 10px; line-height: 1.2; color: #999; text-align: center;
}
#pens-calc .pens-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;
}
#pens-calc .pens-dot.cur { color: #000; }
#pens-calc .pens-dot.cur span { border-color: #000; color: #000; }
#pens-calc .pens-dot.done span { background: #000; border-color: #000; color: #fff; }

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

/* ── Radio-карточки ───────────────────────────────────────── */
#pens-calc .pens-radio-list { display: flex; gap: 8px; }
#pens-calc .pens-radio {
  flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid #ddd; border-radius: 14px; padding: 14px 16px; transition: .15s; background: #fff;
}
#pens-calc .pens-radio:hover { border-color: #bbb; }
#pens-calc .pens-radio:has(input:checked) { border-color: #000; box-shadow: inset 0 0 0 1px #000; }
#pens-calc .pens-radio span { font-size: 13px; line-height: 1.35; }

/* нативные radio/checkbox — сброс глобального инпут-стиля дизайн-системы */
#pens-calc input[type="radio"], #pens-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;
}

/* ── Поля ─────────────────────────────────────────────────── */
#pens-calc .form-group input[type="number"], #pens-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;
}
#pens-calc .form-group { margin-bottom: 12px; }
#pens-calc .form-group__wrapper { align-items: stretch; }
#pens-calc .form-group__wrapper > .form-group { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
#pens-calc .pens-select-wrap { position: relative; width: 100%; }
#pens-calc select.pens-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;
}

/* вкладки заработка / баллов — растянуть на всю ширину, текст не переносить */
#pens-calc .pens-earn-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
#pens-calc .pens-earn-tabs .tab-button {
  flex: 1 1 0; min-width: 0; white-space: nowrap; text-align: center;
  padding: 12px 14px; font-size: 13px; line-height: 1.2;
}

/* периоды работы (динамические строки) */
#pens-calc #pens-periods { margin-bottom: 8px; }
#pens-calc .pens-period { border: 1px solid #eee; border-radius: 14px; padding: 12px 12px 10px; margin-bottom: 8px; }
#pens-calc .pens-period .form-group__wrapper { margin-bottom: 0; }
#pens-calc .pens-p-remove {
  width: auto; margin: 8px 0 0; padding: 0; border: 0; background: none;
  font-family: "Unbounded", sans-serif; font-size: 11px; color: #b00020; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
#pens-calc .pens-p-remove:hover { background: none; opacity: .75; }
#pens-calc .pens-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;
}
#pens-calc .pens-add-period:hover { background: #f7f9fc; opacity: 1; }

/* чекбоксы-строки */
#pens-calc .pens-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;
}
#pens-calc .pens-check:has(input:checked) { border-color: #000; }

#pens-calc .pens-ret {
  margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: #000;
  background: #f7f9fc; border-radius: 12px; padding: 12px 14px;
}
#pens-calc .pens-hint { margin: 10px 0 0; font-size: 11px; line-height: 1.5; opacity: .6; }

/* расширенные параметры (север/село) */
#pens-calc .pens-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;
}
#pens-calc .pens-adv-toggle::after { content: "▾"; transition: transform .2s; }
#pens-calc .pens-adv-toggle.open::after { transform: rotate(180deg); }
#pens-calc .pens-adv { display: none; margin-top: 12px; }

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

/* ── Результат ────────────────────────────────────────────── */
#pens-calc .calculator__result { margin-top: 16px; }
#pens-calc .tax-result.pens-month span,
#pens-calc .tax-result.pens-month .amount-group span:first-child { font-weight: 700; }
#pens-calc .tax-result.pens-month .amount-group span:first-child { font-size: 22px; }

#pens-calc .pens-split { display: flex; gap: 8px; border: 0; padding: 0; margin-top: 4px; }
#pens-calc .pens-split > div {
  flex: 1; border: 1px solid #ddd; border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
#pens-calc .pens-split span { font-size: 11px; opacity: .6; line-height: 1.3; }
#pens-calc .pens-split b { font-size: 15px; }

#pens-calc .pens-status {
  margin-top: 10px; font-size: 12px; line-height: 1.5; border-radius: 12px; padding: 12px 14px;
}
#pens-calc .pens-status.ok { background: #f2f8f2; border: 1px solid #cfe6cf; }
#pens-calc .pens-status.no { background: #fdf6ec; border: 1px solid #f0dcae; }

#pens-calc .pens-how { border: 1px solid #ddd; border-radius: 12px; padding: 0; margin-top: 10px; }
#pens-calc .pens-how summary { cursor: pointer; padding: 12px 16px; font-size: 12px; list-style: none; user-select: none; }
#pens-calc .pens-how summary::-webkit-details-marker { display: none; }
#pens-calc .pens-how summary::before { content: "▸ "; }
#pens-calc .pens-how[open] summary::before { content: "▾ "; }
#pens-calc .pens-how ol { margin: 0; padding: 0 16px 16px 34px; }
#pens-calc .pens-how li { font-size: 12px; line-height: 1.6; color: #000; margin-bottom: 6px; }

/* ── Мобайл ───────────────────────────────────────────────── */
@media screen and (max-width: 767px) {
  #pens-calc .form-group__wrapper { flex-direction: column; gap: 0; }
  #pens-calc .form-group__wrapper .form-group { margin-bottom: 12px; }
  #pens-calc .pens-dot { font-size: 0; }
  #pens-calc .pens-dot span { font-size: 13px; }
  #pens-calc .pens-split { flex-direction: column; }
  #pens-calc .pens-nav button { padding: 14px 16px; }
}

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