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

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

.calc-block label {
  display: block;
  margin-top: 20px;
  font-weight: 600;
  color: #333;
}

.calc-block input {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.calc-block input:focus {
  outline: none;
  border-color: #0077cc;
  box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.15);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #777;
}

.calc-block button {
  margin-top: 25px;
  padding: 12px 24px;
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}

.calc-block button:hover {
  background-color: #005fa3;
}

.result-block {
  background: #f9f9f9;
  padding: 25px;
  border-top: 4px solid #0077cc;
  border-radius: 6px;
  flex: 1;
  min-width: 280px;
}

.result-block h2 {
  margin-top: 0;
  color: #0077cc;
}

.result-output p {
  margin: 12px 0;
  font-size: 17px;
  color: #222;
}

.result-output strong {
  color: #0077cc;
}

/* Шкала DTI */
.dti-score {
  font-size: 38px;
  font-weight: 700;
  text-align: center;
  margin: 10px 0 5px;
}

.rating-good { color: #1a7f37; }
.rating-caution { color: #b76e00; }
.rating-danger { color: #c0392b; }

.dti-bar {
  height: 16px;
  background: #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0 6px;
}

.dti-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 8px;
  transition: width 0.5s ease, background-color 0.3s ease;
}

.dti-bar-fill.rating-good { background: #2da44e; }
.dti-bar-fill.rating-caution { background: #e8a33d; }
.dti-bar-fill.rating-danger { background: #d64545; }

.bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #999;
  margin-bottom: 10px;
}

.rating-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  margin-top: 8px;
}

.rating-badge.rating-good { background: #2da44e; }
.rating-badge.rating-caution { background: #e8a33d; }
.rating-badge.rating-danger { background: #d64545; }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}

.result-grid-item {
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
}

.result-grid-item .value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #222;
}

.result-grid-item .label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 3px;
}

.calculator-description {
  max-width: 800px;
  margin: 50px auto;
  padding: 30px;
  background-color: #f2f6fa;
  border-top: 4px solid #0077cc;
  border-radius: 6px;
  line-height: 1.6;
  font-size: 16px;
}

.calculator-description h2,
.calculator-description h3 {
  color: #0077cc;
  margin-top: 20px;
}
