.calc-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid #191527;
    background: #0C0913;
}

.calc-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}

.calc-hero-body {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 40px;
}

.calc-hero-text {
    flex: 1 1 560px;
    min-width: 0;
}

.calc-hero .calc-hero-title {
    display: block;
    margin: 0 0 20px;
    font-size: clamp(26px, 2.6vw, 38px);
    line-height: 1.2;
}

.calc-hero .calc-hero-title .calc-title-end {
    font-size: inherit;
    line-height: inherit;
    white-space: nowrap;
}

.calc-hero-title svg {
    display: inline-block;
    margin-left: 14px;
    vertical-align: middle;
}

.calc-hero-content,
.calc-hero-cta {
    font-size: 16px;
    line-height: 1.5;
}

.calc-hero-content > *:last-child {
    margin-bottom: 0;
}

.calc-hero-cta {
    margin: 20px 0 0;
}

.calc-hero-card {
    display: flex;
    flex: 0 1 580px;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid #2c2540;
    border-radius: 22px;
    background:
        radial-gradient(ellipse at 0% 95%, rgba(202, 12, 4, 0.28), transparent 55%),
        rgba(14, 10, 26, 0.55);
    backdrop-filter: blur(8px);
}

.calc-card-logo {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 98px;
    height: 98px;
    padding: 6px;
    border: 1px solid #352E4C;
    border-radius: 14px;
    background: #0C0913;
}

.calc-card-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.calc-card-main {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.calc-card-name {
    font-size: 26px;
    line-height: 1.1;
}

.calc-card-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.calc-card-meta {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.calc-card-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 36px;
    line-height: 1;
}

.calc-card-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
}

.calc-card-dates span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.calc-panel {
    padding: 40px;
    border-radius: 30px;
    background: #0C0913;
}

.calc-panel *,
.calc-panel *::before,
.calc-panel *::after {
    box-sizing: border-box;
}

.calc-intro {
    max-width: 760px;
    font-size: 20px;
    line-height: 1.4;
}

.calc-intro p,
.calc-text p {
    margin: 0 0 1em;
}

.calc-intro > *:last-child,
.calc-text > *:last-child {
    margin-bottom: 0;
}

.calc-intro p:not(:first-child) {
    font-size: 16px;
}

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

.calc-tab {
    display: inline-flex;
    align-items: center;
    padding: 12px 18px;
    border: 1px solid #352E4C;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    line-height: 1.2;
    text-decoration: none!important;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

a.calc-tab:hover,
a.calc-tab:focus-visible {
    border-color: #CA0C04;
}

.calc-tab.is-active {
    border-color: #CA0C04;
    background: #CA0C04;
}

.calc {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 30px;
}

.calc-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    padding: 30px;
    border: 1px solid #352E4C;
    border-radius: 20px;
}

.calc-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 16px;
}

.calc-field input,
.calc-field select {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid #352E4C;
    border-radius: 10px;
    background-color: #0C0913;
    color: #fff;
    font: inherit;
    font-size: 16px;
    outline: 0;
}

.calc-field input:focus,
.calc-field select:focus {
    border-color: #CA0C04;
}

.calc-field select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l6 6 6-6' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.calc-error {
    margin: 0;
    color: #ff6b6b;
    font-size: 15px;
}

.calc-error[hidden] {
    display: none;
}

.calc-results {
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    background:
        radial-gradient(ellipse at 90% 40%, rgba(202, 12, 4, 0.25), transparent 55%),
        #0C0913;
}

.calc-result-main {
    display: flex;
    flex: unset;
    width: 100%;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.calc-result-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

.calc-result-amount {
    font-size: 60px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.calc-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    justify-content: start;
    gap: 14px 30px;
    margin: 0;
}

.calc-facts dt {
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
}

.calc-facts dd {
    margin: 6px 0 0;
    font-size: 14px;
}

.calc-progress {
    display: flex;
    align-items: center;
}

.calc-bar {
    display: block;
    position: relative;
    width: 92px;
    height: 18px;
    overflow: hidden;
    border-radius: 6px;
    background: #1d1830;
}

.calc-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: #3b3466;
    transition: width 0.3s ease;
}

.calc-bar-text {
    position: absolute;
    margin-left: 8px;
    font-size: 11px;
}

.calc-progress {
    position: relative;
}

.calc-progress .calc-bar-text {
    left: 0;
    margin: 0;
    padding-left: 8px;
}

.calc-open {
    flex-shrink: 0;
    border: 0;
}

.calc-explanation {
    padding: 30px;
    background: transparent;
}

.calc-explanation > *:first-child {
    margin-top: 0;
}

.calc-explanation > *:last-child {
    margin-bottom: 0;
}

.calc-explanation :is(h2, h3, h4) {
    margin: 24px 0 10px;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
}

.calc-explanation > :is(h2, h3, h4):first-child {
    margin-top: 0;
}

.calc-explanation p,
.calc-text p {
    font-size: 16px;
    line-height: 1.5;
}

.calc-explanation p {
    margin: 0 0 1em;
}

.calc-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
}

.calc-heading svg {
    flex-shrink: 0;
}

.calc-sub {
    margin: -10px 0 0;
    font-size: 16px;
}

.calc-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.calc-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 30px;
    border: 1px solid #352E4C;
    border-radius: 20px;
    background:
        radial-gradient(ellipse at 100% 0%, rgba(40, 110, 200, 0.3), transparent 45%),
        radial-gradient(ellipse at 0% 100%, rgba(40, 110, 200, 0.22), transparent 45%),
        #0a1220;
    color: #fff;
    text-decoration: none;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.calc-card:hover,
.calc-card:focus-visible {
    border-color: #CA0C04;
    transform: translateY(-2px);
}

.calc-card-title {
    font-size: 28px;
    line-height: 1.2;
}

.calc-card-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    line-height: 1.4;
}

.calc-reading-title {
    margin: 0;
    font-size: 26px;
}

@media only screen and (max-width: 1100px) {
    .calc {
        grid-template-columns: 1fr;
    }

    .calc-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media only screen and (max-width: 768px) {
    .calc-hero-body,
    .calc-panel {
        padding: 24px;
    }

    .calc-hero .calc-hero-title {
        font-size: 36px;
    }

    .calc-box {
        padding: 20px;
    }

    .calc-result-amount {
        font-size: 40px;
    }

    .calc-cards {
        grid-template-columns: 1fr;
    }

    .calc-hero-card {
        flex-wrap: wrap;
    }

    .calc-card-meta {
        flex-basis: 100%;
    }
}

@media only screen and (max-width: 520px) {
    .calc-hero-body,
    .calc-panel {
        padding: 18px;
    }

    .calc-facts {
        grid-template-columns: 1fr 1fr;
    }

    .calc-open {
        width: 100%;
        max-width: none;
    }

    .calc-tab {
        flex: 1 1 100%;
        justify-content: center;
    }
}

.calc-toggle {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.calc-toggle legend {
    margin-bottom: 10px;
    padding: 0;
    font-size: 16px;
}

.calc-segments {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid #352E4C;
    border-radius: 10px;
    background: #0C0913;
}

.calc-segments label {
    position: relative;
    display: block;
}

.calc-segments input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.calc-segments span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.55);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.calc-segments input:checked + span {
    background: #3b3466;
    color: #fff;
}

.calc-segments input:focus-visible + span {
    outline: 2px solid #CA0C04;
}

.calc-field .calc-money {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid #352E4C;
    border-radius: 10px;
    background: #0C0913;
}

.calc-field .calc-money:focus-within {
    border-color: #CA0C04;
}

.calc-field .calc-money > span {
    color: rgba(255, 255, 255, 0.5);
}

.calc-field .calc-money input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0;
    border: 0;
}

.calc-tiers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.calc-tier-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.calc-tier-bars li {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 14px;
}

.calc-tier-bars .calc-bar {
    width: 100%;
    height: 22px;
}

.calc-tier-bars .calc-bar-text {
    left: 0;
    top: 50%;
    margin: 0;
    padding-left: 8px;
    transform: translateY(-50%);
    font-size: 12px;
}

.calc-tier-bars .is-selected .calc-bar-fill {
    background: #CA0C04;
}

.calc-tier-bars .is-empty {
    opacity: 0.5;
}

@media only screen and (max-width: 520px) {
    .calc-tier-bars li {
        grid-template-columns: 70px minmax(0, 1fr);
    }
}

.calc-dash {
    display: inline-block;
    margin: 0 12px;
    color: rgba(255, 255, 255, 0.45);
}

@supports selector(:has(*)) {
    .calc-segments {
        position: relative;
        isolation: isolate;
    }

    .calc-segments::before {
        content: "";
        position: absolute;
        top: 4px;
        bottom: 4px;
        left: 4px;
        z-index: -1;
        width: calc(50% - 6px);
        border-radius: 8px;
        background: #3b3466;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .calc-segments:has(label:nth-child(2) input:checked)::before {
        transform: translateX(calc(100% + 4px));
    }

    .calc-segments input:checked + span {
        background: transparent;
    }

    .calc-segments span {
        transition: color 0.3s ease;
    }
}

@media (prefers-reduced-motion: reduce) {
    .calc-segments::before,
    .calc-segments span {
        transition: none;
    }
}
