/* === RESET & BASE === */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{min-height:100vh;background:linear-gradient(180deg,#f0f3f6 0%,#e6eaef 100%);font-family:'Libre Franklin',sans-serif;color:#0f2030;line-height:1.5;-webkit-font-smoothing:antialiased}

/* === RANGE INPUT RESET === */
input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:32px;background:transparent;cursor:pointer;margin:0;position:absolute;left:0;right:0;z-index:2}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:22px;height:22px;border-radius:50%;background:#fff;border:3px solid #0b5e3a;box-shadow:0 2px 8px rgba(11,94,58,.25);cursor:pointer}
input[type=range]::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:#fff;border:3px solid #0b5e3a;box-shadow:0 2px 8px rgba(11,94,58,.25);cursor:pointer;outline:none}
input[type=range]:focus{outline:none}
input[type=range]:focus::-webkit-slider-thumb{box-shadow:0 0 0 4px rgba(11,94,58,.15),0 2px 8px rgba(11,94,58,.25)}

/* === HEADER === */
.hp-header{background:linear-gradient(140deg,#081e14 0%,#0b3a24 40%,#0d5535 100%);padding:36px 20px 52px;text-align:center;position:relative;overflow:hidden}
.hp-header__bg1{position:absolute;top:-80px;right:-80px;width:240px;height:240px;border-radius:50%;background:rgba(255,255,255,.02)}
.hp-header__bg2{position:absolute;bottom:-50px;left:20%;width:180px;height:180px;border-radius:50%;background:rgba(255,255,255,.015)}
.hp-header__inner{position:relative;z-index:1}
.hp-header__brand{display:inline-flex;align-items:center;gap:8px;margin-bottom:10px}
.hp-header__icon{font-size:22px}
.hp-header__domain{font-size:12.5px;font-weight:600;color:rgba(255,255,255,.55);letter-spacing:.1em;text-transform:uppercase}
.hp-header__title{font-size:clamp(24px,5vw,36px);font-weight:800;color:#fff;font-family:'Source Serif 4',serif;line-height:1.2;margin-bottom:8px}
.hp-header__subtitle{font-size:clamp(13px,2.2vw,15px);color:rgba(255,255,255,.55);max-width:500px;margin:0 auto;line-height:1.5}

/* === MAIN LAYOUT === */
.hp-main{max-width:1020px;margin:-30px auto 0;padding:0 14px 60px;position:relative;z-index:2}
.hp-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:18px;align-items:start}
.hp-col-inputs,.hp-col-results{display:flex;flex-direction:column;gap:18px}

/* === CARDS === */
.hp-card{background:#fff;border-radius:18px;padding:clamp(18px,3.5vw,28px);box-shadow:0 2px 16px rgba(0,0,0,.05),0 .5px 2px rgba(0,0,0,.03);animation:fadeUp .45s ease both}
.hp-card__title{font-size:15px;font-weight:700;color:#0f2030;font-family:'Source Serif 4',serif;margin-bottom:18px;display:flex;align-items:center;flex-wrap:wrap;gap:4px}

@keyframes fadeUp{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}

/* === LABELS === */
.hp-label{font-size:12px;font-weight:600;color:#5e7080;letter-spacing:.04em;text-transform:uppercase;font-family:'Libre Franklin',sans-serif;display:flex;align-items:center;gap:4px;flex-wrap:wrap}

/* === PILL SELECTORS === */
.hp-pills-group{margin-bottom:22px}
.hp-pills-group .hp-label{margin-bottom:8px}
.hp-pills{display:flex;gap:6px;flex-wrap:wrap}
.hp-pill{padding:8px 14px;border-radius:10px;border:2px solid #dde4ea;background:#fff;color:#5e7080;font-weight:700;font-size:13px;cursor:pointer;font-family:'Libre Franklin',sans-serif;transition:all .12s;white-space:nowrap;line-height:1.3}
.hp-pill:hover{border-color:#b0c4d0}
.hp-pill--active{border-color:#0b5e3a;background:#eaf5ef;color:#0b5e3a}

/* === SLIDERS === */
.hp-slider-group{margin-bottom:22px}
.hp-slider-header{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:6px;flex-wrap:wrap;gap:4px}
.hp-slider-value{font-size:20px;font-weight:700;color:#0f2030;font-family:'Source Serif 4',serif;letter-spacing:-.02em}
.hp-slider-track{position:relative;height:32px;display:flex;align-items:center}
.hp-slider-track::before{content:'';position:absolute;left:0;right:0;height:5px;border-radius:3px;background:#e2e8f0}
.hp-slider-fill{position:absolute;left:0;height:5px;border-radius:3px;background:linear-gradient(90deg,#0b5e3a,#18a760);transition:width .08s;pointer-events:none}
.hp-slider-minmax{display:flex;justify-content:space-between;margin-top:3px;font-size:10.5px;color:#9aabb8}

/* === LOAN BANNER === */
.hp-loan-banner{background:linear-gradient(135deg,#081e14,#0b5e3a);border-radius:14px;padding:18px 22px;color:#fff;margin-top:4px}
.hp-loan-banner__label{font-size:11px;font-weight:600;opacity:.6;text-transform:uppercase;letter-spacing:.05em;margin-bottom:2px}
.hp-loan-banner__amount{font-size:clamp(22px,4.5vw,30px);font-weight:800;font-family:'Source Serif 4',serif}

/* === TABS === */
.hp-tabs{display:flex;gap:4px;background:#e8ecf1;border-radius:14px;padding:4px;margin-bottom:0;overflow-x:auto}
.hp-tab{flex:1 0 auto;padding:10px 16px;border-radius:11px;border:none;background:transparent;color:#5e7080;font-weight:700;font-size:13px;cursor:pointer;font-family:'Libre Franklin',sans-serif;transition:all .15s;white-space:nowrap}
.hp-tab--active{background:#fff;color:#0b5e3a;box-shadow:0 2px 8px rgba(0,0,0,.08)}
.hp-tab-content{display:none;flex-direction:column;gap:18px}
.hp-tab-content--active{display:flex}

/* === MONTHLY PAYMENT CARD === */
.hp-card--result{text-align:center}
.hp-monthly-label{font-size:11px;font-weight:600;color:#5e7080;text-transform:uppercase;letter-spacing:.05em;margin-bottom:6px}
.hp-monthly-value{font-size:clamp(30px,6vw,44px);font-weight:800;font-family:'Source Serif 4',serif;color:#0b5e3a;letter-spacing:-.02em;line-height:1.1}
.hp-monthly-sub{font-size:12px;color:#5e7080;margin-top:6px}
.hp-monthly-rpsn{font-size:12px;color:#9aabb8;margin-top:4px}

/* === DONUT / COSTS === */
.hp-costs-wrap{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:20px}
.hp-donut-wrap{flex-shrink:0}
.hp-costs-legend{min-width:150px;font-size:13px}
.hp-costs-legend__item{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.hp-costs-legend__dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}
.hp-costs-legend__label{color:#5e7080;flex:1}
.hp-costs-legend__val{font-weight:700;color:#0f2030;font-family:'Source Serif 4',serif}
.hp-costs-legend__total{border-top:1px solid #eef1f5;padding-top:10px;margin-top:6px}
.hp-costs-legend__total-label{font-size:11px;color:#5e7080;margin-bottom:2px}
.hp-costs-legend__total-val{font-size:18px;font-weight:800;color:#0f2030;font-family:'Source Serif 4',serif}

/* === SUMMARY TABLE === */
.hp-summary-row{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid #f0f3f6;font-size:13px}
.hp-summary-row:last-child{border-bottom:none}
.hp-summary-row__label{color:#5e7080}
.hp-summary-row__value{font-weight:700;color:#0f2030}

/* === VERDICT CARD === */
.hp-card--verdict{text-align:center;border:2px solid transparent;transition:border-color .3s,background .3s}
.hp-verdict-label{font-size:17px;font-weight:800;font-family:'Source Serif 4',serif;margin-bottom:4px}
.hp-verdict-sub{font-size:12px;color:#5e7080}
#verdict-icon{font-size:30px;margin-bottom:4px}

/* === GAUGE === */
.hp-gauge-wrap{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}
.hp-gauge-details{min-width:160px;font-size:13px}
.hp-gauge-detail{margin-bottom:10px}
.hp-gauge-detail__label{color:#5e7080;font-size:11px;margin-bottom:2px}
.hp-gauge-detail__value{font-weight:700;color:#0f2030}
.hp-gauge-detail--total{border-top:1px solid #eef1f5;padding-top:8px}
.hp-gauge-detail--total .hp-gauge-detail__value{font-size:16px;font-family:'Source Serif 4',serif}
.hp-gauge-legend{display:flex;justify-content:space-between;margin-top:14px;font-size:10.5px;color:#9aabb8;padding:0 8px}

/* === SEMAPHORE === */
.hp-sem-item{border-radius:12px;padding:12px 16px;margin-bottom:10px}
.hp-sem-item:last-child{margin-bottom:0}
.hp-sem-header{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.hp-sem-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}
.hp-sem-label{font-size:13px;font-weight:700;color:#0f2030;display:flex;align-items:center;gap:4px}
.hp-sem-value{margin-left:auto;font-size:14px;font-weight:700;font-family:'Source Serif 4',serif}
.hp-sem-desc{font-size:11.5px;color:#5e7080;line-height:1.45;padding-left:18px}

/* === LTV DETAIL === */
.hp-ltv-bar-wrap{margin-bottom:8px}
.hp-ltv-bar-header{display:flex;justify-content:space-between;font-size:13px;margin-bottom:6px}
.hp-ltv-bar-header__label{color:#5e7080}
.hp-ltv-bar-header__value{font-weight:700}
.hp-ltv-bar{position:relative;height:16px;border-radius:8px;background:#e8ecf1;overflow:hidden}
.hp-ltv-bar__fill{height:100%;border-radius:8px;transition:width .3s}
.hp-ltv-bar__limit{position:absolute;top:0;bottom:0;width:2px;background:#d64545;z-index:2}
.hp-ltv-bar-minmax{display:flex;justify-content:space-between;font-size:10.5px;color:#9aabb8;margin-top:3px}
.hp-ltv-bar-minmax__limit{color:#d64545}
.hp-ltv-info{font-size:12px;color:#5e7080;line-height:1.5;margin-top:8px}

/* === TABLES === */
.hp-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.hp-table{width:100%;border-collapse:collapse;font-size:13px;font-family:'Libre Franklin',sans-serif}
.hp-table th{text-align:left;padding:8px 10px;font-size:11px;color:#5e7080;font-weight:600;text-transform:uppercase;letter-spacing:.04em;border-bottom:2px solid #e2e8f0}
.hp-table th:not(:first-child){text-align:right}
.hp-table td{padding:10px;border-bottom:1px solid #f0f3f6}
.hp-table td:not(:first-child){text-align:right}
.hp-table tr.hp-table-row--highlight{background:#f7faf8}
.hp-table .hp-diff-positive{color:#d64545;font-weight:700}
.hp-table .hp-diff-negative{color:#18a760;font-weight:700}
.hp-table .hp-diff-zero{color:#5e7080}
.hp-table .hp-value-bold{font-weight:700;font-family:'Source Serif 4',serif;color:#0f2030}
.hp-badge{display:inline-block;padding:3px 10px;border-radius:8px;font-weight:700;font-size:11px}

/* === TEXT BLOCKS === */
.hp-text-muted{font-size:13px;color:#5e7080;line-height:1.5;margin-bottom:16px}
.hp-text-block{font-size:13px;color:#5e7080;line-height:1.65}
.hp-text-block p{margin-bottom:10px}
.hp-text-block p:last-child{margin-bottom:0}

/* === TOOLTIP === */
.hp-tip{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:#e2e8f0;color:#4a6275;font-size:11px;font-weight:700;cursor:pointer;user-select:none;font-family:'Source Serif 4',serif;line-height:1;flex-shrink:0;font-style:normal}
.hp-tip:hover{background:#d0dae4}
.hp-tooltip-overlay{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center;padding:20px}
.hp-tooltip-box{background:#1a2b3c;color:#e2ecf5;padding:20px 24px;border-radius:16px;max-width:360px;width:100%;font-size:13px;line-height:1.6;box-shadow:0 12px 48px rgba(0,0,0,.3);position:relative;animation:fadeUp .2s ease}

/* === FOOTER === */
.hp-footer{text-align:center;margin-top:44px;padding:22px 0;border-top:1px solid #dde4ea}
.hp-footer__disclaimer{font-size:11.5px;color:#9aabb8;line-height:1.6;max-width:620px;margin:0 auto}
.hp-footer__copy{font-size:10.5px;color:#bcc5ce;margin-top:10px}

/* === RESPONSIVE === */
@media(max-width:480px){
    .hp-header{padding:28px 16px 44px}
    .hp-main{margin-top:-24px;padding:0 10px 40px}
    .hp-card{padding:16px;border-radius:14px}
    .hp-pill{padding:7px 10px;font-size:12px}
    .hp-slider-value{font-size:17px}
    .hp-monthly-value{font-size:28px}
    .hp-tab{padding:8px 12px;font-size:12px}
    .hp-table{font-size:12px}
    .hp-table th,.hp-table td{padding:8px 6px}
    .hp-tooltip-box{padding:16px 18px;font-size:12.5px;margin:0 10px}
}
@media(min-width:481px) and (max-width:768px){
    .hp-grid{gap:14px}
}
