/* =========================================================
   Fund calculators — Fonde Investimi and Fonde Pensioni Privat
   Markup: Views/Partials/FundCalculator/_InvestmentCalculator.cshtml
           Views/Partials/FundCalculator/_PensionCalculator.cshtml
   Script: scripts/fundCalculator.js
   Two panels: the inputs (01) on the soft card colour, the projection (02) on white.
   ========================================================= */

.fc-section {
    --fc-ink: #111111;
    --fc-muted: rgba(17, 17, 17, .6);
    --fc-label: rgba(87, 28, 42, .78);
    --fc-line: rgba(87, 28, 42, .16);
    --fc-line-strong: rgba(87, 28, 42, .42);
    --fc-soft: #F7F5F6;
    --fc-tint: rgba(84, 36, 61, .07);
    --fc-track: rgba(87, 28, 42, .14);
    position: relative;
    background: #ffffff;
    color: var(--fc-ink);
    font-family: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    padding-block: clamp(64px, 10vh, 120px) clamp(72px, 11vh, 130px);
    padding-inline: max(clamp(20px, 4.5vw, 72px), calc((100% - 1560px) / 2));
}

    .fc-section *,
    .fc-section *::before,
    .fc-section *::after {
        box-sizing: border-box;
    }

/* ---------- Section head (same rhythm as the funds section above) ---------- */

.fc-section__head {
    margin: 0 0 clamp(28px, 4vh, 48px);
}

.fc-section__eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: rgba(17, 17, 17, .5);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .2em;
    line-height: 1.4;
    text-transform: uppercase;
}

    .fc-section__eyebrow span {
        display: block;
        width: 26px;
        height: 1px;
        flex: none;
        background: var(--color-brand);
    }

.fc-section__title {
    margin: clamp(16px, 2.2vh, 24px) 0 0;
    color: var(--fc-ink);
    font-size: clamp(24px, 2.8vw, 40px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -.04em;
    text-wrap: balance;
}

.fc-section__lead {
    max-width: 76ch;
    margin: clamp(12px, 1.8vh, 18px) 0 0;
    color: rgba(17, 17, 17, .72);
    font-size: clamp(14.5px, 1.15vw, 16px);
    line-height: 1.7;
    text-wrap: pretty;
}

.fc-section__note {
    max-width: 96ch;
    margin: clamp(20px, 3vh, 32px) 0 0;
    color: var(--fc-muted);
    font-size: 12.5px;
    line-height: 1.7;
    text-wrap: pretty;
}

/* ---------- Card with the two panels ---------- */

.fc {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    overflow: hidden;
    border: 1px solid var(--fc-line);
    border-radius: 26px;
    background: #ffffff;
}

.fc__panel {
    min-width: 0;
    padding: clamp(24px, 3vw, 44px);
}

.fc__panel--inputs {
    display: flex;
    flex-direction: column;
    gap: clamp(22px, 3vh, 30px);
    border-right: 1px solid var(--fc-line);
    background: var(--fc-soft);
}

.fc__panel--results {
    display: flex;
    flex-direction: column;
}

/* ---------- Step header: 01 / 02 ---------- */

.fc__step {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin: 0 0 4px;
}

.fc__panel--results .fc__step {
    margin-bottom: clamp(26px, 3.6vh, 40px);
}

.fc__step-num {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--fc-line-strong);
    border-radius: 50%;
    color: var(--color-brand);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .04em;
}

.fc__step-title {
    margin: 2px 0 0;
    color: var(--fc-ink);
    font-size: clamp(20px, 1.8vw, 26px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.03em;
}

.fc__step-sub {
    margin: 6px 0 0;
    color: var(--fc-muted);
    font-size: 14.5px;
    line-height: 1.5;
}

    .fc__step-sub.is-warning {
        color: #B3261E;
        font-weight: 500;
    }

/* ---------- Fields ---------- */

.fc__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(12px, 1.4vw, 18px);
}

.fc__field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.fc__label {
    margin: 0;
    padding: 0;
    color: var(--fc-label);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.fc__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fc__input {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    margin: 0;
    padding: 13px 64px 13px 20px;
    border: 1px solid var(--fc-line-strong);
    border-radius: 999px;
    outline: none;
    background: #ffffff;
    color: var(--color-brand);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: border-color .3s, box-shadow .3s;
}

    .fc__input:hover,
    .fc__input:focus {
        border-color: var(--color-brand);
    }

    .fc__input:focus-visible {
        box-shadow: 0 0 0 3px rgba(87, 28, 42, .12);
    }

    .fc__input[aria-invalid="true"] {
        border-color: #B3261E;
    }

.fc__suffix {
    position: absolute;
    right: 20px;
    color: var(--color-brand);
    font-size: 13.5px;
    font-weight: 600;
    pointer-events: none;
}

.fc__error {
    grid-column: 1 / -1;
    margin: -2px 0 0;
    color: #B3261E;
    font-size: 12.5px;
    line-height: 1.5;
}

    .fc__error[hidden] {
        display: none;
    }

.fc__hint {
    margin: 2px 0 0;
    color: var(--fc-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* ---------- Range sliders ---------- */

.fc__range-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.fc__range-value {
    color: var(--color-brand);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.fc__range {
    --fc-fill: 50%;
    width: 100%;
    height: 24px;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

    .fc__range:focus {
        outline: none;
    }

    .fc__range::-webkit-slider-runnable-track {
        height: 4px;
        border-radius: 999px;
        background: linear-gradient(to right, var(--color-brand) 0 var(--fc-fill), var(--fc-track) var(--fc-fill) 100%);
    }

    .fc__range::-moz-range-track {
        height: 4px;
        border-radius: 999px;
        background: var(--fc-track);
    }

    .fc__range::-moz-range-progress {
        height: 4px;
        border-radius: 999px;
        background: var(--color-brand);
    }

    .fc__range::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
        margin-top: -9px;
        border: 3px solid var(--color-brand);
        border-radius: 50%;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(17, 17, 17, .16);
        transition: transform .2s ease, box-shadow .2s ease;
        -webkit-appearance: none;
        appearance: none;
    }

    .fc__range::-moz-range-thumb {
        width: 16px;
        height: 16px;
        border: 3px solid var(--color-brand);
        border-radius: 50%;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(17, 17, 17, .16);
    }

    .fc__range:hover::-webkit-slider-thumb,
    .fc__range:active::-webkit-slider-thumb {
        transform: scale(1.08);
    }

    .fc__range:focus-visible::-webkit-slider-thumb {
        box-shadow: 0 0 0 5px rgba(87, 28, 42, .16);
    }

    .fc__range:focus-visible::-moz-range-thumb {
        box-shadow: 0 0 0 5px rgba(87, 28, 42, .16);
    }

.fc__range-scale {
    display: flex;
    justify-content: space-between;
    margin-top: -4px;
    color: var(--fc-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Risk profiles ---------- */

.fc__profiles legend {
    float: left;
    width: 100%;
    margin-bottom: 10px;
}

.fc__profile-grid {
    clear: both;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(8px, 1vw, 12px);
}

.fc__profile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 18px 10px 16px;
    border: 1px solid rgba(87, 28, 42, .22);
    border-radius: 18px;
    background: #ffffff;
    color: var(--fc-ink);
    text-align: center;
    cursor: pointer;
    transition: border-color .3s ease, background .3s ease, box-shadow .3s ease;
}

    .fc__profile:hover {
        border-color: rgba(87, 28, 42, .5);
    }

    .fc__profile:has(.fc__profile-input:checked) {
        border-color: var(--color-brand);
        background: var(--fc-tint);
        box-shadow: inset 0 0 0 1px var(--color-brand);
    }

    .fc__profile:has(.fc__profile-input:focus-visible) {
        outline: 2px solid var(--color-brand);
        outline-offset: 3px;
    }

.fc__profile-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.fc__profile-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 4px;
    color: var(--color-brand);
}

.fc__profile-name {
    color: var(--fc-ink);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.fc__profile-risk {
    color: var(--fc-muted);
    font-size: 12px;
    line-height: 1.3;
}

.fc__profile:has(.fc__profile-input:checked) .fc__profile-name,
.fc__profile:has(.fc__profile-input:checked) .fc__profile-risk {
    color: var(--color-brand);
}

.fc__profile-desc {
    margin: 14px 0 0;
    padding: 12px 16px;
    border-left: 2px solid var(--color-brand);
    border-radius: 0 12px 12px 0;
    background: rgba(84, 36, 61, .05);
    color: rgba(17, 17, 17, .72);
    font-size: 13.5px;
    line-height: 1.6;
    text-wrap: pretty;
}

/* ---------- Results ---------- */

.fc__result-label {
    margin: 0;
    color: var(--fc-muted);
    font-size: 14px;
    font-weight: 500;
}

.fc__result-value {
    margin: 10px 0 0;
    color: var(--fc-ink);
    font-size: clamp(40px, 4.6vw, 66px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.045em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.fc__chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    align-self: flex-start;
    gap: 6px 8px;
    margin: 18px 0 0;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--fc-tint);
    color: var(--color-brand);
    font-size: 13px;
    line-height: 1.35;
}

    .fc__chip svg {
        width: 14px;
        height: 14px;
        flex: none;
    }

    .fc__chip[hidden] {
        display: none;
    }

    .fc__chip strong {
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

.fc__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: clamp(24px, 3.2vh, 34px);
    border: 1px solid var(--fc-line);
    border-radius: 18px;
}

.fc__stat {
    min-width: 0;
    padding: 18px 22px 20px;
}

    .fc__stat + .fc__stat {
        border-left: 1px solid var(--fc-line);
    }

.fc__stat-label {
    margin: 0;
    color: var(--fc-muted);
    font-size: 12.5px;
    line-height: 1.4;
}

.fc__stat-value {
    margin: 8px 0 0;
    color: var(--fc-ink);
    font-size: clamp(20px, 1.9vw, 26px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* ---------- Chart ---------- */

.fc__chart-card,
.fc__compare {
    margin-top: clamp(16px, 2.2vh, 22px);
    padding: 20px 22px 16px;
    border: 1px solid var(--fc-line);
    border-radius: 18px;
}

.fc__chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.fc__card-title {
    margin: 0;
    color: var(--fc-ink);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.fc__legend {
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--fc-muted);
    font-size: 12px;
}

    .fc__legend li {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

.fc__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.fc__dot--value {
    background: var(--color-brand);
}

.fc__dot--base {
    background: rgba(17, 17, 17, .3);
}

/* The area gradient under the line takes its colour from currentColor. */
.fc__chart {
    position: relative;
    height: 240px;
    margin-top: 12px;
    color: var(--color-brand);
    touch-action: pan-y;
}

    .fc__chart svg {
        display: block;
        width: 100%;
        height: 100%;
        overflow: visible;
    }

.fc__chart-grid {
    stroke: rgba(17, 17, 17, .08);
    stroke-width: 1;
}

.fc__chart-axis {
    fill: rgba(17, 17, 17, .5);
    font-family: inherit;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.fc__chart-line {
    fill: none;
    stroke: var(--color-brand);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fc__chart-base {
    fill: none;
    stroke: rgba(17, 17, 17, .32);
    stroke-width: 1.5;
    stroke-dasharray: 5 5;
}

.fc__chart-end {
    fill: #ffffff;
    stroke: var(--color-brand);
    stroke-width: 2.5;
}

.fc__chart-guide {
    stroke: rgba(87, 28, 42, .35);
    stroke-width: 1;
}

.fc__chart-hover-dot {
    fill: var(--color-brand);
    stroke: #ffffff;
    stroke-width: 2;
}

.fc__chart-hover-dot--base {
    fill: rgba(17, 17, 17, .45);
}

.fc__tooltip {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    min-width: 132px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--color-brand);
    box-shadow: 0 14px 30px -14px rgba(17, 17, 17, .5);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
    white-space: nowrap;
}

    .fc__tooltip[hidden] {
        display: none;
    }

.fc__tooltip-title {
    margin: 0 0 4px;
    color: rgba(255, 255, 255, .7);
    font-size: 11px;
    letter-spacing: .04em;
}

.fc__tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: 0;
}

    .fc__tooltip-row strong {
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

/* ---------- Profile comparison / scenarios ---------- */

.fc__table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    font-size: 14px;
}

    .fc__table th,
    .fc__table td {
        padding: 11px 8px;
        border-top: 1px solid var(--fc-line);
        text-align: left;
        vertical-align: middle;
    }

        .fc__table th:first-child,
        .fc__table td:first-child {
            padding-left: 0;
        }

        .fc__table th:last-child,
        .fc__table td:last-child {
            padding-right: 0;
        }

    .fc__table thead th {
        border-top: 0;
        padding-top: 4px;
        color: rgba(17, 17, 17, .5);
        font-size: 10.5px;
        font-weight: 500;
        letter-spacing: .14em;
        text-transform: uppercase;
    }

    .fc__table tbody th {
        color: var(--fc-ink);
        font-weight: 500;
        white-space: nowrap;
    }

    .fc__table td {
        color: rgba(17, 17, 17, .78);
    }

    .fc__table .fc__num {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .fc__table tr.is-active th,
    .fc__table tr.is-active td {
        color: var(--color-brand);
        font-weight: 600;
    }

        .fc__table tr.is-active th::before {
            content: "";
            display: inline-block;
            width: 6px;
            height: 6px;
            margin: 0 8px 1px 0;
            border-radius: 50%;
            background: var(--color-brand);
            vertical-align: middle;
        }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
    .fc {
        grid-template-columns: minmax(0, 1fr);
    }

    .fc__panel--inputs {
        border-right: 0;
        border-bottom: 1px solid var(--fc-line);
    }
}

@media (max-width: 560px) {
    .fc {
        border-radius: 22px;
    }

    .fc__panel {
        padding: 22px 18px 26px;
    }

    .fc__step {
        gap: 14px;
    }

    .fc__step-num {
        width: 38px;
        height: 38px;
        font-size: 11.5px;
    }

    .fc__profile {
        padding: 14px 6px 12px;
        border-radius: 14px;
    }

    .fc__profile-name {
        font-size: 13px;
    }

    .fc__profile-risk {
        font-size: 11px;
    }

    .fc__stat {
        padding: 14px 14px 16px;
    }

    .fc__chart-card,
    .fc__compare {
        padding: 16px 14px 12px;
    }

    .fc__chart {
        height: 200px;
    }

    .fc__table {
        font-size: 12.5px;
    }

        .fc__table th,
        .fc__table td {
            padding: 10px 5px;
        }

        .fc__table thead th {
            font-size: 9.5px;
            letter-spacing: .08em;
        }

    .fc__col-risk {
        display: none;
    }

    .fc__table tr.is-active th::before {
        display: none;
    }
}

@media (max-width: 400px) {
    .fc__row {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fc__input,
    .fc__profile,
    .fc__range::-webkit-slider-thumb {
        transition: none;
    }
}
