/* =========================================================
   Teilverkauf Rechner 2026 – Styles (FINAL)
   ========================================================= */

/* Layout */
section.main-calculator {
  display: flex;
  flex-wrap: wrap;
}

.main-calculator-left,
.main-calculator-right {
  max-width: 50%;
  flex: 0 0 50%;
  padding: 0 15px;
}

.main-calculator-right {
  padding: 50px 70px;
}

/* Inputs */
.main-calculator-right input[type="text"],
.total-sale input[type="text"] {
  border: none;
  padding: 0;
  height: auto;
  margin-bottom: 15px;
  box-shadow: none;
  font-weight: 700;
  color: rgb(0, 140, 60);
}

.main-calculator-right label,
.total-sale label {
  font-weight: 500;
}

/* =========================================================
   House / Overlay
   ========================================================= */

.calculator-wrapper .house {
  max-width: 260px;
  margin: 0 auto 35px auto;
  position: relative;
}

.calculator-wrapper #house-image {
  width: 100% !important;
  height: auto !important;
  display: block;
  filter: brightness(1.05) contrast(0.95);
}

/* filigranere Außenlinien (SVG) */
.calculator-wrapper #house-image path,
.calculator-wrapper #house-image polygon,
.calculator-wrapper #house-image rect,
.calculator-wrapper #house-image line {
  stroke-width: 0.6 !important;
  stroke: rgba(0, 0, 0, 0.45);
}

#fill {
  position: absolute;
  z-index: 8;
  top: 0; left: 0; right: 0; bottom: 0;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.house .overlay {
  content: "";
  position: absolute;
  right: 0;
  left: 0;                 /* Startwert, JS setzt left dynamisch */
  top: 0;
  bottom: 0;
  background-color: #fff;
  transition: left 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* =========================================================
   Donuts / Prozentkarten (klein, sauber, nicht abgeschnitten)
   ========================================================= */

.calculator-wrapper .main-calculator-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 240px;
  overflow: visible;
  text-align: center;
}

.card .percent {
  position: relative;
}

.card svg {
  position: relative;
  width: 210px;
  height: 210px;
  transform: rotate(-90deg) scale(0.78); /* kleiner, aber Kreis bleibt vollständig */
  transform-origin: center;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

.card svg circle {
  fill: none;
  stroke: #f0f0f0;
  stroke-width: 10;
  stroke-linecap: round;
}

.card svg circle:last-of-type {
  stroke: rgb(0, 140, 60);
  stroke-dasharray: 625px;
  stroke-dashoffset: calc(625px - (625px * var(--percent)) / 100);
}

.card .number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(0, 140, 60);
}

.card .number h3 {
  font-size: 2.7rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-style: normal;
  line-height: 1;
}

.card .number h3 span {
  font-size: 1.6rem;
}

.card > span {
  margin-top: 10px;
  font-size: 14px;
}

/* =========================================================
   Vollverkauf / Summary
   ========================================================= */

.pre-summary {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.property-value {
  display: flex;
  justify-content: space-between;
}

.property-value-label,
.property-value-label-value {
  flex: 1;
  padding: 10px 5px;
}

.property-value-label-value {
  text-align: right;
  color: #008c3c;
}

.header-value {
  border-bottom: 1px solid #ddd;
}

.total-value {
  border-top: 1px solid #ddd;
}

/* =========================================================
   Zusammenfassung Ihrer Auszahlungen (Desktop: Dreieck / Wrap)
   ========================================================= */

.total-value-balance {
  padding: 70px 0;
}

.calculator-wrapper .total-value-balance h2 {
  text-align: center !important;
}

.total-value-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.total-value-col {
  flex: 0 1 280px;
  max-width: 280px;
  text-align: center;
}

.total-value-count {
  width: 170px;
  height: 170px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  background-color: rgb(0 140 60 / 25%);
  border-radius: 50%;
  font-weight: 700;
  color: #008c3c;
}

.gesamterlos {
  background-color: #008c3c;
  color: #ffffff;
}

.total-value-col h4 {
  margin: 20px 0 0 0;
  font-size: 15px;
  text-align: center;
  color: #008c3c;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
}

/* =========================================================
   Tooltip
   ========================================================= */

.help-tip {
  position: absolute;
  left: 50%;
  text-align: center;
  background-color: #008c3c;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  line-height: 26px;
  cursor: default;
  transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
  transform: translate(-90px, 12px);
}

.help-tip:before {
  content: '?';
  font-weight: 700;
  color: #fff;
}

.help-tip p {
  visibility: hidden;
  opacity: 0;
  text-align: left;
  background-color: #008c3c;
  padding: 20px;
  width: 300px;
  position: absolute;
  border-radius: 4px;
  right: -4px;
  color: #fff;
  font-size: 13px;
  line-height: normal;
  transform: scale(0.7);
  transform-origin: 100% 0%;
  transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
}

.help-tip:hover p {
  visibility: visible;
  opacity: 1;
  transform: scale(1.0);
}

/* =========================================================
   noUiSlider Styling (sichtbar + Handle sauber)
   ========================================================= */

.noUi-target {
  border: 1px solid rgb(159 182 203 / 35%);
  background-color: rgb(159 182 203 / 35%);
  border-radius: 20px;
  margin-bottom: 15px;
  padding: 14px 12px;
}

.calculator-wrapper .noUi-horizontal {
  height: 10px !important;
}

.calculator-wrapper .noUi-base,
.calculator-wrapper .noUi-connects {
  height: 10px !important;
}

.noUi-handle {
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: default;
  box-shadow: none;
}

.noUi-horizontal .noUi-handle {
  right: -10px;
  top: -14px;
  border: 1px solid #008c3c;
  background: #008c3c;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  box-shadow: none;
}

.noUi-handle:before,
.noUi-handle:after {
  content: "";
  display: block;
  position: absolute;
  height: 11px;
  width: 1px;
  background: #3b4249;
  top: 8px;
}

.noUi-handle:before { left: 13px; }
.noUi-handle:after  { left: 16px; }

#total-sale .noUi-handle.noUi-handle-lower {
  right: -25px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 991px) {
  .card-wrapper { flex-wrap: wrap; }
}

@media (max-width: 767px) {

  .main-calculator-left,
  .main-calculator-right {
    max-width: 100%;
    flex: 0 0 100%;
  }

  .main-calculator-right {
    padding: 40px 15px;
  }

  .calculator-wrapper {
    margin-left: -40px;
    margin-right: -40px;
  }

  .calculator-wrapper .house {
    max-width: 220px;
    margin-bottom: 25px;
  }

  /* Auszahlungen untereinander auf Mobile */
  .total-value-row {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  .total-value-col {
    max-width: 320px;
    flex: 0 0 auto;
  }

  .total-value-count {
    width: 160px;
    height: 160px;
  }

  .property-value-label,
  .property-value-label-value {
    font-size: 14px;
  }

  .help-tip {
    transform: translate(10px, 12px);
  }
}
