/* Kalkulátor Bázis – Lakásvásárlási Döntési mód v2 */

.decision-home-v2 {
  display: grid;
  gap: 20px;
}

.home-v2-fieldsets {
  display: grid;
  gap: 14px;
}

.home-v2-fieldset {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface, #fff) 96%, var(--kb-season-accent-soft, #f2dfc3));
}

.home-v2-fieldset legend {
  padding: 0 7px;
  color: var(--text, #17202a);
  font-weight: 850;
}

.home-v2-fieldset-copy {
  margin: -2px 0 14px;
  color: var(--muted, #667085);
  font-size: .86rem;
  line-height: 1.55;
}

.home-v2-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-v2-grid.is-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-v2-grid label {
  display: grid;
  gap: 7px;
  color: var(--text, #17202a);
  font-size: .86rem;
  font-weight: 750;
}

.home-v2-grid label small {
  color: var(--muted, #667085);
  font-size: .73rem;
  font-weight: 500;
  line-height: 1.35;
}

.home-v2-grid input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #17202a);
  font: inherit;
}

.home-v2-grid input:focus {
  border-color: var(--kb-season-accent, #b86d3c);
  outline: 3px solid color-mix(in srgb, var(--kb-season-accent, #b86d3c) 16%, transparent);
}

.home-v2-form-note {
  margin: -4px 0 0;
  color: var(--muted, #667085);
  font-size: .82rem;
  line-height: 1.55;
}

.home-v2-result {
  display: grid;
  gap: 20px;
}

.home-v2-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.home-v2-result-head h3 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 2.7vw, 2.05rem);
}

.home-v2-grade {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 850;
  background: #eef0f2;
  color: #2c3440;
}

.home-v2-result[data-grade="comfortable"] .home-v2-grade {
  background: #deefe5;
  color: #245d3a;
}

.home-v2-result[data-grade="tight"] .home-v2-grade {
  background: #fff0ce;
  color: #765311;
}

.home-v2-result[data-grade="risk"] .home-v2-grade {
  background: #f9dfdc;
  color: #8a3029;
}

.home-v2-grade-copy {
  margin: -6px 0 0;
  padding: 14px 16px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--kb-season-accent-soft, #f2dfc3) 52%, transparent);
  line-height: 1.62;
}

.home-v2-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-v2-metric {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface, #fff) 95%, var(--kb-season-accent-soft, #f2dfc3));
}

.home-v2-metric span {
  color: var(--muted, #667085);
  font-size: .76rem;
}

.home-v2-metric strong {
  font-size: clamp(.98rem, 1.8vw, 1.26rem);
  overflow-wrap: anywhere;
}

.home-v2-metric small {
  color: var(--muted, #667085);
  line-height: 1.35;
}

.home-v2-scenarios,
.home-v2-factors {
  padding: 18px;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 18px;
  background: var(--surface, #fff);
}

.home-v2-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .65fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.home-v2-section-head h4,
.home-v2-factors h4 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.home-v2-section-head p {
  margin: 0;
  color: var(--muted, #667085);
  font-size: .84rem;
  line-height: 1.5;
}

.home-v2-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.home-v2-scenario-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: .85rem;
}

.home-v2-scenario-table th,
.home-v2-scenario-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border, #dfe3e8);
  text-align: right;
  white-space: nowrap;
}

.home-v2-scenario-table th:first-child,
.home-v2-scenario-table td:first-child {
  text-align: left;
}

.home-v2-scenario-table tbody th {
  display: table-cell;
  font-weight: 800;
}

.home-v2-scenario-table tbody th small {
  display: block;
  margin-top: 2px;
  color: var(--muted, #667085);
  font-weight: 500;
}

.home-v2-scenario-table tbody tr:first-child {
  background: color-mix(in srgb, var(--kb-season-accent-soft, #f2dfc3) 42%, transparent);
}

.home-v2-factors {
  display: grid;
  grid-template-columns: minmax(220px, .65fr) minmax(0, 1fr);
  gap: 22px;
}

.home-v2-factors ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: factor;
}

.home-v2-factors li {
  counter-increment: factor;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, var(--kb-season-accent-soft, #f2dfc3));
}

.home-v2-factors li::before {
  content: counter(factor, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--kb-season-accent, #b86d3c);
  color: #fff;
  font-size: .74rem;
  font-weight: 850;
}

.home-v2-factors li span {
  color: var(--muted, #667085);
  font-size: .82rem;
  text-align: right;
}

.home-v2-guidance {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--kb-season-accent, #b86d3c) 24%, var(--border, #dfe3e8));
  border-radius: 12px;
  background: color-mix(in srgb, var(--kb-season-accent-soft, #f2dfc3) 35%, transparent);
  font-size: .82rem;
  line-height: 1.55;
}

.home-v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.home-v2-actions button,
.home-v2-actions a {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 11px;
  background: var(--surface, #fff);
  color: var(--text, #17202a);
  font: inherit;
  font-size: .84rem;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.home-v2-actions button:hover,
.home-v2-actions button:focus-visible,
.home-v2-actions a:hover,
.home-v2-actions a:focus-visible {
  border-color: var(--kb-season-accent, #b86d3c);
  outline: none;
}

.home-v2-status {
  min-height: 1.2em;
  margin: -10px 0 0;
  color: var(--muted, #667085);
  font-size: .8rem;
}

.home-v2-validation {
  padding: 16px 18px;
  border: 1px solid #d99891;
  border-radius: 14px;
  background: #fff0ee;
  color: #772c26;
}

.home-v2-validation ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

html[data-theme="dark"] .home-v2-fieldset,
html[data-theme="dark"] .home-v2-scenarios,
html[data-theme="dark"] .home-v2-factors,
html[data-theme="dark"] .home-v2-metric {
  background: color-mix(in srgb, #17191c 94%, var(--kb-season-accent, #d59158));
}

html[data-theme="dark"] .home-v2-grid input,
html[data-theme="dark"] .home-v2-actions button,
html[data-theme="dark"] .home-v2-actions a {
  background: #121416;
  color: var(--text, #f5f5f5);
}

html[data-theme="dark"] .home-v2-validation {
  background: #2c1917;
  border-color: #8b4d47;
  color: #ffd8d4;
}

@media (max-width: 1050px) {
  .home-v2-grid.is-4,
  .home-v2-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .home-v2-grid,
  .home-v2-section-head,
  .home-v2-factors {
    grid-template-columns: 1fr;
  }

  .home-v2-factors li {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .home-v2-factors li span {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .home-v2-fieldset {
    padding: 14px;
  }

  .home-v2-grid,
  .home-v2-grid.is-4,
  .home-v2-metrics {
    grid-template-columns: 1fr;
  }

  .home-v2-result-head {
    display: grid;
  }

  .home-v2-grade {
    justify-self: start;
  }

  .home-v2-guidance {
    grid-template-columns: 1fr;
  }
}
