/* ==========================================================================
   /tools/baby-budget — калькулятор расходов на ребёнка
   Наследует hero/FAQ/share базу из maternity-bag.css.
   Стеклянный (glassmorphism) стиль плашек под общий вид сайта.
   ========================================================================== */
@import url("/assets/css/maternity-bag.css");
@import url("/assets/css/partners.css");

:root {
  --bb-gold: #c8a24a;
  --bb-green: #7bab6e;
  --bb-ink: #2c2a26;
  --bb-soft-bg: #faf8f2;
  --bb-border: #e7e0d2;
}

/* Стеклянный рецепт плашек */
.bb-glass {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.78) 0%, rgba(250, 246, 235, 0.55) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 8px 28px rgba(140, 110, 40, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ---------- Page & Hero ---------- */
.bb-page {
  background:
    radial-gradient(ellipse 52% 42% at 10% 6%, rgba(200, 162, 74, 0.12), transparent 60%),
    radial-gradient(ellipse 48% 44% at 92% 22%, rgba(123, 171, 110, 0.12), transparent 62%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(200, 162, 74, 0.07), transparent 65%),
    #faf9f4 !important;
}

.bb-hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58) 0%, rgba(236, 231, 214, 0.55) 100%),
    url("/assets/images/baby-budget-hero-bg.webp") center / cover no-repeat,
    linear-gradient(180deg, #ffffff 0%, #ece7d6 100%) !important;
  border-bottom-color: #e0d6bf !important;
}
.bb-hero .mb-hero-title span::after {
  background: linear-gradient(90deg, rgba(200, 162, 74, 0.55), rgba(123, 171, 110, 0.45));
}

/* ==========================================================================
   FORM
   ========================================================================== */
.bb-form-section { margin-bottom: 0 !important; }

.bb-form-card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.80) 0%, rgba(250, 246, 235, 0.58) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 32px 36px;
  margin: 0 0 12px;
  box-shadow:
    0 10px 32px rgba(140, 110, 40, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.bb-form-title {
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 22px !important;
  color: var(--main-bg-color);
}
.bb-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.bb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bb-field label {
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--bb-ink);
}
.bb-field input {
  width: 100%;
  padding: 12px 14px;
  font-family: "Nunito", sans-serif;
  font-size: 16px;
  color: var(--bb-ink);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.85), rgba(250, 246, 235, 0.6));
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(140, 110, 40, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.bb-field input:focus {
  outline: none;
  border-color: var(--bb-gold);
  box-shadow: 0 0 0 3px rgba(200, 162, 74, 0.15);
}
.bb-field input::placeholder { color: #b3ab99; }
.bb-field-hint {
  font-size: 12.5px;
  color: #9a9384;
  line-height: 1.4;
}

/* ---------- Кастомный стеклянный селект ---------- */
.bb-select { position: relative; }
.bb-select-native { display: none !important; }
.bb-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  font-family: "Nunito", sans-serif;
  font-size: 16px;
  color: var(--bb-ink);
  text-align: left;
  cursor: pointer;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.85), rgba(250, 246, 235, 0.6));
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(140, 110, 40, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: border-color .15s, box-shadow .15s;
}
.bb-select-trigger:hover { border-color: rgba(200, 162, 74, 0.5); }
.bb-select.is-open .bb-select-trigger {
  border-color: var(--bb-gold);
  box-shadow: 0 0 0 3px rgba(200, 162, 74, 0.15);
}
.bb-select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-select-chev { display: inline-flex; color: #9a9384; transition: transform .2s, color .2s; flex-shrink: 0; }
.bb-select-chev svg { width: 16px; height: 16px; }
.bb-select.is-open .bb-select-chev { transform: rotate(180deg); color: var(--bb-gold); }

.bb-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 40;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: linear-gradient(150deg, #ffffff 0%, #faf5ea 100%);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(220, 205, 165, 0.7);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(120, 95, 30, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.bb-select.is-open .bb-select-menu { display: flex; animation: bb-pop .16s ease; }
@keyframes bb-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.bb-select-option {
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  font-family: "Nunito", sans-serif;
  font-size: 15px;
  color: var(--bb-ink);
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s;
}
.bb-select-option:hover { background: rgba(200, 162, 74, 0.12); }
.bb-select-option.is-selected {
  background: linear-gradient(135deg, rgba(200, 162, 74, 0.24), rgba(200, 162, 74, 0.12));
  font-weight: 700;
  color: #8a6c1a;
}

/* ---------- Кнопка расчёта ---------- */
.bb-calc-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--bb-gold), #b98f36);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s;
  box-shadow: 0 6px 18px rgba(185, 143, 54, 0.28);
}
.bb-calc-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(185, 143, 54, 0.34); }
.bb-calc-btn:active { transform: translateY(0); }

.bb-share { margin: 0 0 24px; }

/* ==========================================================================
   RESULTS — KPI
   ========================================================================== */
.bb-results { margin-bottom: 8px; }

.bb-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.bb-kpi {
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.75) 0%, rgba(250, 246, 235, 0.5) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 22px rgba(140, 110, 40, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.bb-kpi-accent {
  background: linear-gradient(150deg, rgba(200, 162, 74, 0.24) 0%, rgba(123, 171, 110, 0.14) 100%);
  border-color: rgba(200, 162, 74, 0.45);
}
.bb-kpi-label {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #8c8575;
  letter-spacing: .01em;
}
.bb-kpi-label span { color: var(--bb-gold); font-weight: 700; }
.bb-kpi-value {
  font-family: "Montserrat", sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--bb-ink);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.bb-kpi-accent .bb-kpi-value { color: #9a6f14; }
.bb-kpi[hidden] { display: none; } /* атрибут hidden сильнее flex-раскладки */

/* ---------- Breakdown bars ---------- */
.bb-breakdown {
  border-radius: 18px;
  padding: 26px 28px;
  margin-bottom: 22px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.78) 0%, rgba(250, 246, 235, 0.55) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 28px rgba(140, 110, 40, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.bb-breakdown-title {
  font-family: "Montserrat", sans-serif;
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 20px !important;
  color: var(--bb-ink);
}
.bb-breakdown-title span { color: var(--bb-gold); }
.bb-bars { display: flex; flex-direction: column; gap: 16px; }

.bb-bar { --c: #b0a892; }
.bb-bar[data-cat="food"]      { --c: #e8a33d; }
.bb-bar[data-cat="hygiene"]   { --c: #6a9bc4; }
.bb-bar[data-cat="clothes"]   { --c: #c47ba8; }
.bb-bar[data-cat="health"]    { --c: #e06b6b; }
.bb-bar[data-cat="toys"]      { --c: #7bb36a; }
.bb-bar[data-cat="education"] { --c: #8a7bc4; }
.bb-bar[data-cat="other"]     { --c: #4fb0a4; }

.bb-bar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}
.bb-bar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, rgba(255, 255, 255, 0.6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.bb-bar-icon svg { width: 17px; height: 17px; }
.bb-bar-label {
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--bb-ink);
}
.bb-bar-sum {
  margin-left: auto;
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--bb-ink);
}
.bb-bar-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--c);
  min-width: 38px;
  text-align: right;
}
.bb-bar-track {
  height: 10px;
  background: rgba(120, 105, 70, 0.10);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(120, 105, 70, 0.10);
}
.bb-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 65%, #fff));
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Total 0–18 ---------- */
.bb-total-card {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(200, 162, 74, 0.20), transparent 55%),
    linear-gradient(135deg, rgba(44, 42, 38, 0.94), rgba(60, 56, 48, 0.92));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(200, 162, 74, 0.3);
  border-radius: 20px;
  padding: 30px 34px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 12px 34px rgba(44, 40, 30, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.bb-total-eyebrow {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #d9c99b;
  margin-bottom: 8px;
}
.bb-total-value {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.01em;
  background: linear-gradient(90deg, #f3d98a, #e9c463);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bb-total-note {
  max-width: 640px;
  margin: 12px auto 0 !important;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}
.bb-total-mini {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.bb-total-chip {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 7px 14px;
}
.bb-total-chip strong { color: #f3d98a; }
.bb-total-chip.is-active {
  background: rgba(200, 162, 74, 0.22);
  border-color: rgba(200, 162, 74, 0.5);
}

/* ==========================================================================
   STAGES TABLE
   ========================================================================== */
.bb-stages-section { margin: 8px 0 40px; }
.bb-stages-title {
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 18px !important;
  color: var(--main-bg-color);
}
.bb-stages-wrap {
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.80) 0%, rgba(250, 246, 235, 0.58) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 28px rgba(140, 110, 40, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.bb-stages-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Nunito", sans-serif;
}
.bb-stages-table th,
.bb-stages-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(200, 180, 130, 0.18);
  font-size: 15px;
  color: var(--bb-ink);
}
.bb-stages-table thead th {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #9a9384;
  background: rgba(250, 246, 235, 0.5);
}
.bb-stages-table tbody tr:last-child td { border-bottom: none; }
.bb-stages-table tbody tr.is-current {
  background: linear-gradient(90deg, rgba(200, 162, 74, 0.14), rgba(200, 162, 74, 0.03));
}
.bb-stages-table tbody tr.is-current td:first-child {
  box-shadow: inset 3px 0 0 var(--bb-gold);
}
.bb-stage-tag {
  display: block;
  font-family: "Nunito", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #a49c8a;
}
.bb-stages-note {
  margin: 14px 2px 0 !important;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.55);
  border-left: 3px solid var(--bb-gold);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #6c665a;
  font-style: italic;
}

/* ==========================================================================
   ИСТОЧНИКИ И МЕТОДИКА (стеклянный вариант)
   ========================================================================== */
.sr-sources-block {
  margin: 32px 0 8px;
  padding: 26px 30px 22px !important;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.80) 0%, rgba(250, 246, 235, 0.58) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 28px rgba(140, 110, 40, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.sr-sources-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px dashed rgba(200, 170, 90, 0.35);
}
.sr-sources-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #e0be6a, var(--bb-gold));
  color: #fff; border-radius: 10px; flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(200, 162, 74, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.sr-sources-head h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 20px !important; font-weight: 800 !important;
  margin: 0 !important; letter-spacing: -0.02em;
  color: var(--main-bg-color);
}
.sr-sources {
  counter-reset: sr-source;
  list-style: none !important; margin: 0 !important; padding: 0 !important;
  font-size: 13.5px !important; line-height: 1.6 !important;
  color: var(--main-bg-color);
}
.sr-sources li {
  position: relative; counter-increment: sr-source;
  padding: 10px 12px 10px 42px !important; margin: 0 !important;
  border-radius: 10px; transition: background 0.2s ease;
}
.sr-sources li:hover { background: rgba(200, 162, 74, 0.06); }
.sr-sources li::before {
  content: counter(sr-source);
  position: absolute; left: 8px; top: 9px;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.8); border: 1.5px solid rgba(200, 170, 90, 0.4); border-radius: 50%;
  font-family: "Montserrat", sans-serif;
  font-size: 11px; font-weight: 800; color: var(--bb-gold);
}
.sr-sources-authors { font-weight: 700; color: var(--main-bg-color); margin-right: 4px; }
.sr-sources cite { font-style: italic; color: var(--main-bg-color); }
.sr-sources a {
  color: var(--main-bg-color); text-decoration: underline;
  text-decoration-color: rgba(200, 162, 74, 0.5);
  text-decoration-thickness: 1.5px; text-underline-offset: 2px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
.sr-sources a:hover { color: #8a6c1a; text-decoration-color: var(--bb-gold); }
.sr-sources a[target="_blank"]::after {
  content: "\2197"; display: inline-block; margin-left: 3px;
  font-size: 0.85em; color: var(--bb-gold);
  text-decoration: none; vertical-align: middle;
}
.sr-sources-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  background: rgba(200, 162, 74, 0.14); color: #8a6c1a;
  border-radius: 999px;
  font-family: "Montserrat", sans-serif;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  vertical-align: middle; white-space: nowrap;
}
.sr-sources-note {
  margin: 16px 0 0 !important; padding: 10px 14px !important;
  background: rgba(255, 255, 255, 0.55);
  border-left: 3px solid var(--bb-gold);
  border-radius: 8px;
  font-size: 12.5px !important; line-height: 1.5 !important;
  color: #6c665a; font-style: italic;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .bb-form-grid { grid-template-columns: repeat(2, 1fr); }
  .bb-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .bb-form-card { padding: 24px 20px; }
  .bb-breakdown { padding: 22px 18px; }
  .bb-total-card { padding: 26px 20px; }
  .sr-sources-block { padding: 20px 18px 18px !important; border-radius: 14px; }

  /* таблица → карточки */
  .bb-stages-table thead { display: none; }
  .bb-stages-table,
  .bb-stages-table tbody,
  .bb-stages-table tr,
  .bb-stages-table td { display: block; width: 100%; }
  .bb-stages-table tr {
    border-bottom: 8px solid rgba(250, 246, 235, 0.6);
    padding: 6px 0;
  }
  .bb-stages-table td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 18px;
    border-bottom: 1px solid rgba(200, 180, 130, 0.16);
  }
  .bb-stages-table td::before {
    content: attr(data-label);
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #9a9384;
    flex-shrink: 0;
  }
  .bb-stages-table td:first-child { flex-direction: column; align-items: flex-start; gap: 2px; }
  .bb-stages-table td:first-child::before { content: ""; display: none; }
  .bb-stages-table tbody tr.is-current td:first-child { box-shadow: none; }
}
@media (max-width: 520px) {
  .bb-form-grid { grid-template-columns: 1fr; }
  .bb-kpis { grid-template-columns: 1fr 1fr; }
  .bb-kpi { padding: 14px 15px; }
  .bb-kpi-value { font-size: 21px; }
  .bb-bar-label { font-size: 14px; }
  .bb-bar-sum { font-size: 14px; }
}
