/* ============================================================
   Калькулятор юридических расходов — Professional slate blue
   ============================================================ */

:root {
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
}

.calculator-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding: 30px;
  font-family: 'Segoe UI', 'Roboto', sans-serif;
}

.calc-block {
  flex: 1;
  min-width: 300px;
  max-width: 520px;
}

.calc-block label {
  display: block;
  margin-top: 18px;
  font-weight: 600;
  font-size: 15px;
  color: var(--slate-800);
}

.calc-block input,
.calc-block select {
  width: 100%;
  padding: 10px 12px;
  margin-top: 7px;
  font-size: 16px;
  color: var(--slate-900);
  background: var(--slate-50);
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.calc-block input:focus,
.calc-block select:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px var(--blue-100);
  background: #fff;
}

.calc-block input::placeholder {
  color: var(--slate-400);
}

/* ---------- Нотариальные расходы (несколько позиций) ---------- */

.notary-section {
  margin-top: 18px;
  padding: 16px;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
}

.notary-section > label {
  margin-top: 0;
}

.notary-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.notary-row .notary-desc {
  flex: 1;
  min-width: 0;
}

.notary-row .notary-amount {
  flex: 0 0 130px;
}

.remove-notary {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--slate-500);
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.remove-notary:hover {
  color: #b91c1c;
  border-color: #fca5a5;
  background: #fef2f2;
}

.add-notary {
  margin-top: 12px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-700);
  background: #fff;
  border: 1px dashed var(--slate-400);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-notary:hover {
  border-color: var(--blue-600);
  border-style: solid;
  background: var(--blue-100);
}

/* ---------- Кнопка расчёта ---------- */

.calc-block button[type="button"],
.calc-block > button {
  margin-top: 25px;
  padding: 13px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--slate-800);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.calc-block > button:hover {
  background: var(--slate-900);
}

.calc-block > button:active {
  transform: translateY(1px);
}

/* ---------- Результаты ---------- */

.result-block {
  background: var(--slate-50);
  padding: 25px;
  border-top: 4px solid var(--blue-600);
  border-radius: 4px;
  flex: 1;
  min-width: 300px;
}

.result-block h2 {
  margin-top: 0;
  color: var(--slate-800);
  font-size: 20px;
}

.result-output p {
  margin: 12px 0;
  font-size: 16px;
  color: var(--slate-700);
}

/* Общая сумма */

.result-total {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  margin-bottom: 18px;
  background: var(--slate-800);
  border-radius: 10px;
}

.result-total-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--slate-300);
}

.result-total-value {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  word-break: break-word;
}

/* Диаграмма-«пончик» + легенда */

.donut-wrap {
  display: flex;
  gap: 22px;
  align-items: center;
  margin: 18px 0;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  flex-wrap: wrap;
}

.donut {
  position: relative;
  width: 140px;
  height: 140px;
  flex: 0 0 140px;
  border-radius: 50%;
}

.donut::after {
  content: '';
  position: absolute;
  inset: 30px;
  background: #fff;
  border-radius: 50%;
}

.donut-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  color: var(--slate-800);
}

.donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 180px;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 14px;
  color: var(--slate-700);
}

.donut-legend .dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 3px;
}

.donut-legend .legend-amount {
  margin-left: auto;
  font-weight: 600;
  color: var(--slate-800);
  white-space: nowrap;
}

/* Таблица разбивки */

.breakdown-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 14px;
}

.breakdown-table th {
  padding: 8px 10px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--slate-500);
  border-bottom: 2px solid var(--slate-300);
}

.breakdown-table th:first-child,
.breakdown-table td:first-child {
  text-align: left;
}

.breakdown-table td {
  padding: 9px 10px;
  text-align: right;
  color: var(--slate-700);
  border-bottom: 1px solid var(--slate-200);
}

.breakdown-table tbody tr:last-child td {
  border-bottom: none;
}

.breakdown-table .cell-amount {
  font-weight: 600;
  color: var(--slate-900);
  white-space: nowrap;
}

.breakdown-table .cell-share {
  color: var(--slate-500);
  white-space: nowrap;
}

.breakdown-table .sub-details {
  margin-top: 2px;
  font-size: 12px;
  color: var(--slate-400);
}

/* Примечание */

.result-note {
  margin-top: 16px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate-600);
  background: var(--blue-100);
  border-top: 3px solid var(--blue-600);
  border-radius: 4px;
}

.result-error {
  padding: 14px;
  font-size: 15px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}

/* ---------- Описание ---------- */

.calculator-description {
  max-width: 800px;
  margin: 50px auto;
  padding: 30px;
  background-color: var(--slate-100);
  border-top: 4px solid var(--blue-600);
  border-radius: 4px;
  line-height: 1.65;
  font-size: 16px;
  color: var(--slate-700);
}

.calculator-description h2,
.calculator-description h3 {
  color: var(--slate-800);
  margin-top: 22px;
}

.calculator-description h2 {
  font-size: 22px;
}

.calculator-description ul {
  margin: 10px 0 10px 20px;
}

/* ---------- Адаптивность ---------- */

@media (max-width: 640px) {
  .calculator-layout {
    padding: 20px 14px;
  }

  .donut-wrap {
    justify-content: center;
  }

  .donut-legend {
    width: 100%;
    min-width: 0;
  }

  .notary-row {
    flex-wrap: wrap;
  }

  .notary-row .notary-desc {
    flex: 1 1 100%;
  }

  .notary-row .notary-amount {
    flex: 1 1 120px;
  }

  .result-total-value {
    font-size: 26px;
  }
}
