﻿/* =========================================================
   CALCULATOR SECTION — Slider-based Premium UI
   ========================================================= */

.calculator {
  background: #f9fafb;
  padding: 80px 0 88px;
}

.calculator__container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

.calculator__header {
  text-align: center;
  margin-bottom: 48px;
}

/* ---- Outer wrapper card ---- */
.calculator__wrapper {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 12px 40px rgba(0, 0, 0, 0.09);
  display: grid;
  grid-template-columns: 1fr 300px;
  overflow: hidden;
}

/* =========================================================
   LEFT — Sliders
   ========================================================= */
.calculator__sliders {
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.calculator__sliders-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111111;
  letter-spacing: -0.01em;
  margin: 0 0 -8px;
}

/* ---- Insurance type tab row ---- */
.calculator__type-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calculator__type-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.calculator__type-tab {
  padding: 7px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #666666;
  background: #f8fafc;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease,
              color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.calculator__type-tab:hover {
  border-color: #2e7d32;
  color: #2e7d32;
  background: #f0fdf4;
  transform: scale(1.05);
}

.calculator__type-tab--active {
  border-color: #2e7d32;
  background: #2e7d32;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.28);
}

.calculator__type-tab--active:hover {
  background: #1b5e20;
  border-color: #1b5e20;
  color: #ffffff;
  transform: scale(1.05);
}

/* ---- Slider group ---- */
.calculator__slider-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calculator__slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calculator__slider-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #444444;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.calculator__slider-bubble {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2e7d32;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.15s ease;
}

.calculator__slider-bubble.updated {
  animation: bubblePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bubblePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ---- Range input ---- */
.calculator__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 50px;
  background: linear-gradient(to right, #2e7d32 0%, #2e7d32 var(--progress, 20%), #e2e8f0 var(--progress, 20%), #e2e8f0 100%);
  outline: none;
  cursor: pointer;
  transition: background 0.1s ease;
}

.calculator__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #2e7d32;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.25), 0 0 0 3px rgba(46, 125, 50, 0.08);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.calculator__range::-webkit-slider-thumb:hover {
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.38), 0 0 0 5px rgba(46, 125, 50, 0.12);
  transform: scale(1.12);
}

.calculator__range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #2e7d32;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.25);
  cursor: pointer;
}

.calculator__range:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(46, 125, 50, 0.18);
}

/* ---- Range min/max labels ---- */
.calculator__range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #aaaaaa;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: -4px;
}

/* =========================================================
   RIGHT — Result Card
   ========================================================= */
.calculator__result {
  display: flex;
  align-items: stretch;
}

.calculator__result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 28px;
  background: linear-gradient(160deg, #1a2e1a 0%, #2e7d32 55%, #1b5e20 100%);
  width: 100%;
  position: relative;
  overflow: hidden;
  gap: 0;
}

/* Decorative background circle */
.calculator__result-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  top: -60px;
  right: -60px;
  pointer-events: none;
}

.calculator__result-badge {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
}

.calculator__result-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 12px;
}

.calculator__result-amount {
  font-size: 2.8rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0 0 6px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.2s ease;
}

.calculator__result-amount.updating {
  animation: amountPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes amountPop {
  0%   { transform: scale(0.88); opacity: 0.5; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.calculator__result-note {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  margin: 0 0 28px;
}

/* ---- Breakdown rows ---- */
.calculator__result-breakdown {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.calculator__breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.65);
  padding: 0 4px;
}

.calculator__breakdown-row strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.78rem;
}

/* Divider */
.calculator__breakdown-row:first-child {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---- CTA button (pill) ---- */
.calculator__result-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  background: #ffffff;
  color: #1b5e20;
  font-size: 0.84rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: background 0.22s ease, transform 0.2s ease, box-shadow 0.22s ease;
  white-space: nowrap;
  width: 100%;
}

.calculator__result-cta:hover {
  background: #f0fdf4;
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.calculator__result-cta:active {
  transform: scale(0.97);
}

/* AI Advisor suggestion link below result card */
.calculator__ai-cta {
  display: block;
  margin-top: 11px;
  padding: 9px 16px;
  background: #f0faf0;
  border: 1.5px solid #a5d6a7;
  border-radius: 50px;
  font-size: .81rem;
  font-weight: 600;
  color: #2e7d32;
  text-decoration: none;
  text-align: center;
  transition: background .2s, box-shadow .2s;
}
.calculator__ai-cta:hover {
  background: #e8f5e9;
  box-shadow: 0 3px 10px rgba(46,125,50,.15);
}

/* ---- Dropdown selects (replace range sliders) ---- */
.calculator__select {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.87rem;
  font-weight: 500;
  color: #0f172a;
  background-color: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232e7d32' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 13px 13px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.calculator__select:hover {
  border-color: #a3c9a4;
  background-color: #f0fdf4;
}
.calculator__select:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, .12);
  background-color: #fff;
}

/* ---- Recommended plan strip ---- */
.calculator__recommended {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 12px;
  width: 100%;
}

.calculator__recommended-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

.calculator__recommended-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  transition: opacity 0.25s ease;
}

/* ---- Trust badge strip (inside the dark result card) ---- */
.calculator__trust {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.calculator__trust-badge {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, .6);
  font-weight: 500;
  letter-spacing: .01em;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .calculator__wrapper {
    grid-template-columns: 1fr;
  }

  .calculator__sliders {
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 32px 28px;
  }

  .calculator__result {
    border-radius: 0 0 20px 20px;
  }

  .calculator__result-card {
    padding: 32px 28px;
    border-radius: 0;
  }

  .calculator__result-amount {
    font-size: 2.4rem;
  }
}

@media (max-width: 540px) {
  .calculator {
    padding: 56px 0 64px;
  }

  .calculator__container {
    padding: 0 20px;
  }

  .calculator__sliders {
    gap: 24px;
    padding: 28px 20px;
  }

  .calculator__type-tabs {
    gap: 6px;
  }
}
