/* ==========================================================================
   FINWISDOM FINANCIAL CALCULATORS STYLES
   ========================================================================== */

:root {
    --calc-primary: #012217;
    --calc-accent: #0072AA;
    --calc-growth: #10b981;
    --calc-bg: #f8fafc;
    --calc-card: #ffffff;
    --calc-line: #e2e8f0;
    --calc-muted: #64748b;
    --calc-soft: #f8fafc;
}

.calc_single_section {
    padding: 60px 0 90px;
    background: var(--calc-bg);
}

.calc_wrap {
    background: var(--calc-card);
    border: 1px solid var(--calc-line);
    border-radius: 24px;
    padding: 36px 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.calc_wrap .row {
    --bs-gutter-x: 0;
}

.calc_head_bar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 26px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--calc-line);
}

.calc_head_bar .ch_icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0072AA 0%, #005b88 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(0, 114, 170, 0.25);
}

.calc_head_bar h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--calc-primary);
    margin: 0 0 4px 0;
}

.calc_head_bar p {
    color: var(--calc-muted);
    font-size: 14px;
    margin: 0;
}

.calc_inputs {
    padding-right: 36px;
    border-right: 1px solid var(--calc-line);
}

.calc_results {
    padding-left: 36px;
}

/* Inputs */
.calc_field {
    margin-bottom: 24px;
}

.calc_field label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--calc-primary);
    margin-bottom: 8px;
}

.calc_field .val_badge {
    font-size: 13px;
    color: var(--calc-accent);
    font-weight: 700;
}

.calc_field input[type=number] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--calc-line);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--calc-primary);
    background: #ffffff;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.calc_field select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--calc-line);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--calc-primary);
    background: #ffffff;
    outline: none;
    transition: all 0.2s ease;
}

.calc_field input[type=number]:focus,
.calc_field select:focus {
    border-color: var(--calc-accent);
    box-shadow: 0 0 0 3px rgba(0, 114, 170, 0.15);
}

.calc_field input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 6px;
    margin-top: 12px;
    background: #e2e8f0;
    cursor: pointer;
    outline: none;
    accent-color: var(--calc-accent);
}

.calc_field input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--calc-accent);
    border: 3px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 114, 170, 0.4);
    transition: transform 0.15s ease;
}

.calc_field input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.calc_field input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--calc-accent);
    border: 3px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 114, 170, 0.4);
}

.calc_toggle {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.calc_toggle .ct_btn {
    flex: 1;
    min-width: 110px;
    text-align: center;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--calc-line);
    background: #ffffff;
    color: var(--calc-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13.5px;
}

.calc_toggle .ct_btn.active {
    background: var(--calc-primary);
    color: #ffffff;
    border-color: var(--calc-primary);
}

/* Results */
.calc_results h4 {
    font-size: 14px;
    color: var(--calc-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: 20px;
}

.calc_result_main {
    background: linear-gradient(135deg, #0072AA 0%, #005b88 100%);
    border-radius: 16px;
    padding: 24px 22px;
    color: #ffffff;
    text-align: center;
    margin-bottom: 18px;
    box-shadow: 0 8px 20px rgba(0, 114, 170, 0.22);
}

.calc_result_main span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc_result_main strong {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    font-family: inherit;
}

.calc_result_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border: 1px solid var(--calc-line);
    border-radius: 12px;
    background: #ffffff;
    margin-bottom: 12px;
}

.calc_result_row .crr_label {
    color: var(--calc-muted);
    font-size: 14px;
    font-weight: 600;
}

.calc_result_row .crr_value {
    font-weight: 700;
    color: var(--calc-primary);
    font-size: 17px;
}

/* Gains/interest figure (last result row) */
.calc_results .calc_result_row:last-of-type .crr_value {
    color: var(--calc-growth);
}

.calc_chart_wrap {
    margin-top: 24px;
}

.calc_bar {
    height: 14px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    background: var(--calc-line);
}

.calc_bar .cb_invest {
    background: var(--calc-primary);
}

.calc_bar .cb_return {
    background: var(--calc-accent);
}

.calc_legend {
    display: flex;
    gap: 22px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--calc-muted);
}

.calc_legend .dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-right: 6px;
}

.calc_legend .dot.invest {
    background: var(--calc-primary);
}

.calc_legend .dot.return {
    background: var(--calc-accent);
}

/* Explanation block */
.calc_explain {
    padding: 40px 0 0;
}

.calc_explain .ce_box {
    background: #ffffff;
    border: 1px solid var(--calc-line);
    border-radius: 20px;
    padding: 32px 34px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
}

.calc_explain h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--calc-primary);
    margin-bottom: 14px;
}

.calc_explain h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--calc-primary);
    margin: 22px 0 10px;
}

.calc_explain p {
    color: #475569;
    margin-bottom: 14px;
    line-height: 1.7;
    font-size: 14.5px;
}

.calc_formula {
    background: #f1f5f9;
    border-left: 4px solid var(--calc-accent);
    padding: 16px 20px;
    border-radius: 8px;
    font-family: monospace;
    color: var(--calc-primary);
    margin: 14px 0;
    font-weight: 600;
    font-size: 14px;
}

.calc_explain ul {
    margin: 0 0 14px 0;
    padding-left: 20px;
    color: #475569;
}

.calc_explain ul li {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 14px;
}

@media (max-width: 991px) {
    .calc_inputs {
        padding-right: 0;
        padding-bottom: 30px;
        border-right: none;
        border-bottom: 1px solid var(--calc-line);
        margin-bottom: 30px;
    }
    .calc_results {
        padding-left: 0;
    }
    .calc_wrap {
        padding: 24px 20px;
    }
    .calc_head_bar h2 {
        font-size: 20px;
    }
    .calc_result_main strong {
        font-size: 26px;
    }
}

/* ---------- Growth chart ---------- */
.calc_chart_area {
    margin-top: 26px;
}

.calc_chart_area h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--calc-primary);
    margin: 0 0 12px;
}

.calc_growth {
    width: 100%;
    position: relative;
}

.calc_growth .cg_svg {
    width: 100%;
    height: auto;
    display: block;
}

.cg_pt {
    fill: #0072AA;
    opacity: 0.6;
}

.cg_guide {
    stroke: #0072AA;
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.cg_hoverdot {
    fill: #0072AA;
    stroke: #ffffff;
    stroke-width: 2.5;
}

.cg_hit {
    cursor: crosshair;
}

.cg_tip {
    position: absolute;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 6;
    background: #012217;
    color: #ffffff;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 12px;
    line-height: 1.55;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(1, 34, 23, 0.35);
}

.cg_tip b {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 700;
}

.cg_tip span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.cg_tip em {
    font-style: normal;
    font-weight: 700;
    margin-left: auto;
    padding-left: 16px;
}

.cg_tip i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex: none;
}

.cg_tip i.d1 {
    background: #012217;
}

.cg_tip i.d2 {
    background: #0072AA;
}

.cg_tip .tt {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 5px;
    padding-top: 5px;
}

.cg_grid {
    stroke: #E8ECF3;
    stroke-width: 1;
}

.cg_axis {
    stroke: #D3D9E6;
    stroke-width: 1;
}

.cg_ylab {
    fill: #8A93A6;
    font-size: 11px;
    text-anchor: end;
}

.cg_xlab {
    fill: #8A93A6;
    font-size: 11px;
    text-anchor: middle;
}

.cg_rlab {
    fill: #0072AA;
    font-size: 11px;
    font-weight: 700;
    text-anchor: middle;
}

.cg_invest {
    fill: rgba(1, 34, 23, 0.12);
}

.cg_interest {
    fill: rgba(0, 114, 170, 0.22);
}

.cg_line {
    fill: none;
    stroke: #0072AA;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.cg_invline {
    fill: none;
    stroke: #012217;
    stroke-width: 1.5;
    stroke-dasharray: 5 4;
    opacity: 0.65;
}

.cg_dot {
    fill: #0072AA;
    stroke: #ffffff;
    stroke-width: 2;
}

/* ---------- HRA comparison bars ---------- */
.hra_compare {
    margin-top: 24px;
}

.hra_compare h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--calc-primary);
    margin: 0 0 14px;
}

.hb_row {
    margin-bottom: 14px;
}

.hb_top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--calc-muted);
    margin-bottom: 6px;
    gap: 12px;
}

.hb_label span {
    color: var(--calc-growth);
    font-weight: 600;
}

.hb_val {
    font-weight: 700;
    color: var(--calc-primary);
    white-space: nowrap;
}

.hb_track {
    height: 12px;
    border-radius: 8px;
    background: var(--calc-line);
    overflow: hidden;
}

.hb_fill {
    height: 100%;
    border-radius: 8px;
    background: rgba(1, 34, 23, 0.25);
    transition: width 0.3s ease;
}

.hb_min .hb_fill {
    background: var(--calc-accent);
}

.hb_min .hb_val {
    color: var(--calc-accent);
}

/* ---------- Select dropdown (nice-select) ---------- */
.calc_field .nice-select {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    float: none;
    width: 100%;
    height: auto;
    line-height: 24px;
    padding: 10px 36px 10px 14px;
    border: 1.5px solid var(--calc-line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--calc-primary);
    font-size: 14.5px;
    font-weight: 600;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.calc_field .nice-select:hover,
.calc_field .nice-select:focus,
.calc_field .nice-select.open {
    border-color: var(--calc-accent);
    box-shadow: 0 0 0 3px rgba(0, 114, 170, 0.12);
}

.calc_field .nice-select:after {
    border-bottom: 2px solid var(--calc-muted);
    border-right: 2px solid var(--calc-muted);
    width: 7px;
    height: 7px;
    right: 16px;
    margin-top: -5px;
}

.calc_field .nice-select .current {
    font-weight: 600;
}

.calc_field .nice-select .list {
    width: 100%;
    margin-top: 6px;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(1, 34, 23, 0.12);
    padding: 6px;
    z-index: 20;
}

.calc_field .nice-select .option {
    border-radius: 8px;
    line-height: 1.5;
    min-height: auto;
    padding: 8px 12px;
    font-size: 14px;
}

.calc_field .nice-select .option.selected {
    color: var(--calc-accent);
    font-weight: 700;
}

.calc_field .nice-select .option:hover,
.calc_field .nice-select .option.focus,
.calc_field .nice-select .option.selected.focus {
    background: #E8F4FB;
}
