/* Wrapper */
.tf-kalkulator-wrapper {
  font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 700px;
  margin: 0 auto;
}

/* Intro section above calculator */
.tf-kalkulator-intro {
  text-align: center;
  margin-bottom: 40px;
}

.tf-kalkulator-intro__label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #222222;
  margin-bottom: 12px;
}

.tf-kalkulator-intro__heading {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 16px 0;
  padding: 0;
}

.tf-kalkulator-intro__subtitle {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 8px 0;
  opacity: 0.75;
}

.tf-kalkulator-intro__instruction {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  opacity: 0.55;
}

/* Flip container */
.tf-kalkulator-flip {
  position: relative;
  width: 100%;
  perspective: 1200px;
}

.tf-kalkulator-flip__front,
.tf-kalkulator-flip__back {
  width: 100%;
  backface-visibility: hidden;
  transition: transform 0.6s ease, opacity 0.4s ease;
  transform-style: preserve-3d;
}

.tf-kalkulator-flip__front {
  transform: rotateY(0deg);
  opacity: 1;
}

.tf-kalkulator-flip__back {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotateY(180deg);
  opacity: 0;
  pointer-events: none;
}

/* Flipped state: front collapses, back takes over */
.tf-kalkulator-flip.is-flipped .tf-kalkulator-flip__front {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotateY(-180deg);
  opacity: 0;
  pointer-events: none;
}

.tf-kalkulator-flip.is-flipped .tf-kalkulator-flip__back {
  position: relative;
  transform: rotateY(0deg);
  opacity: 1;
  pointer-events: auto;
}

/* Calculator box */
.tf-kalkulator {
  font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 30px;
  background: linear-gradient(135deg, #003a7a 0%, #005fc1 100%);
  border-radius: 16px;
  color: #fff;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

.tf-kalkulator *,
.tf-kalkulator *::before,
.tf-kalkulator *::after {
  box-sizing: border-box;
}

/* Heading */
.tf-kalkulator__heading {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 35px 0;
  padding: 0;
  line-height: 1.3;
  color: #fff;
}

/* Label above slider */
.tf-kalkulator__label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 12px;
  opacity: 0.85;
}

/* Slider container */
.tf-kalkulator__slider {
  position: relative;
  width: 100%;
  padding: 25px 0 10px;
  touch-action: none;
}

/* Slider track */
.tf-kalkulator__track {
  width: 100%;
  height: 10px;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  position: relative;
}

/* Slider filled portion */
.tf-kalkulator__fill {
  height: 100%;
  border-radius: 5px;
  background-color: #fdb321;
  width: 50%;
  transition: width 0.05s ease;
}

/* Slider thumb wrapper (thumb + value label) */
.tf-kalkulator__thumb-wrapper {
  position: absolute;
  cursor: pointer;
  z-index: 10;
  top: 14px;
  transform: translateX(-50%);
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Circular thumb */
.tf-kalkulator__thumb {
  width: 32px;
  height: 32px;
  background-color: #fdb321;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.tf-kalkulator__thumb-wrapper:hover .tf-kalkulator__thumb,
.tf-kalkulator__thumb-wrapper:active .tf-kalkulator__thumb {
  transform: scale(1.1);
}

/* Current value label below thumb */
.tf-kalkulator__value {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-top: 8px;
  white-space: nowrap;
}

/* Min / max range labels */
.tf-kalkulator__range {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
  font-size: 13px;
  opacity: 0.7;
}

/* Comparison row: Nytt tak vs Takfornying */
.tf-kalkulator__compare {
  display: flex;
  gap: 16px;
  margin-top: 30px;
}

.tf-kalkulator__compare-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 18px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tf-kalkulator__compare-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.7;
}

.tf-kalkulator__compare-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

/* Nytt tak: strikethrough, muted */
.tf-kalkulator__compare-box--nytttak .tf-kalkulator__compare-value {
  opacity: 0.5;
}

.tf-kalkulator__compare-box--nytttak .tf-kalkulator__compare-value s {
  text-decoration: line-through;
}

/* Takfornying: highlighted in gold */
.tf-kalkulator__compare-box--takfornying .tf-kalkulator__compare-label {
  color: #fdb321;
  opacity: 1;
}

.tf-kalkulator__compare-box--takfornying .tf-kalkulator__compare-value {
  color: #fdb321;
  font-weight: 800;
}

/* Hero savings box */
.tf-kalkulator__savings-hero {
  margin-top: 20px;
  background: rgba(253, 179, 33, 0.15);
  border: 1px solid rgba(253, 179, 33, 0.35);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
}

.tf-kalkulator__savings-icon {
  font-size: 22px;
  color: #fdb321;
  margin-bottom: 4px;
}

.tf-kalkulator__savings-label {
  font-size: 32px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fdb321;
  margin-bottom: 6px;
}

.tf-kalkulator__savings-amount {
  font-size: 62px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 8px;
}

.tf-kalkulator__savings-percent {
  font-size: 18px;
  opacity: 0.7;
  line-height: 1.4;
}

/* Disclaimer */
.tf-kalkulator__disclaimer {
  text-align: center;
  font-size: 13px;
  margin-top: 20px;
  margin-bottom: 0;
  opacity: 0.7;
  line-height: 1.5;
}

/* CTA button */
.tf-kalkulator__cta {
  display: block;
  width: fit-content;
  margin: 25px auto 0;
  padding: 14px 36px;
  background-color: #fdb321;
  color: #003a7a;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.tf-kalkulator__cta:hover {
  background-color: #e9a31e;
  transform: translateY(-1px);
  color: #003a7a;
  text-decoration: none;
}

.tf-kalkulator__cta:active {
  transform: translateY(0);
}

/* Form side (back) */
.tf-kalkulator--form {
  -webkit-user-select: auto;
  user-select: auto;
}

.tf-kalkulator__form-heading {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px 0;
  padding: 0;
  color: #fff;
}

.tf-kalkulator__form-subtitle {
  font-size: 15px;
  text-align: center;
  margin: 0 0 25px 0;
  opacity: 0.7;
}

.tf-kalkulator__form-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 25px 20px;
  color: #333;
}

/* Style Fluent Form inputs inside container */
.tf-kalkulator__form-container input[type="text"],
.tf-kalkulator__form-container input[type="email"],
.tf-kalkulator__form-container input[type="tel"],
.tf-kalkulator__form-container textarea,
.tf-kalkulator__form-container select {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 15px;
  width: 100%;
  box-sizing: border-box;
}

.tf-kalkulator__form-container input:focus,
.tf-kalkulator__form-container textarea:focus,
.tf-kalkulator__form-container select:focus {
  border-color: #005fc1;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 95, 193, 0.2);
}

/* Back button */
.tf-kalkulator__back-btn {
  display: block;
  width: fit-content;
  margin: 20px auto 0;
  padding: 10px 24px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
}

.tf-kalkulator__back-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

/* Mobile */
@media (max-width: 600px) {
  .tf-kalkulator-intro {
    margin-bottom: 28px;
  }

  .tf-kalkulator-intro__heading {
    font-size: 26px;
  }

  .tf-kalkulator-intro__subtitle {
    font-size: 15px;
  }

  .tf-kalkulator {
    padding: 30px 20px;
    border-radius: 12px;
  }

  .tf-kalkulator__heading {
    font-size: 22px;
    margin-bottom: 25px;
  }

  .tf-kalkulator__compare {
    gap: 10px;
  }

  .tf-kalkulator__compare-value {
    font-size: 18px;
  }

  .tf-kalkulator__savings-amount {
    font-size: 32px;
  }

  .tf-kalkulator__cta {
    width: 100%;
  }
}
