.calculator-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Lighter backdrop for better glass effect */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(8px);
    /* Subtle blur on the backdrop itself */
    -webkit-backdrop-filter: blur(8px);
}

.calculator-modal--open {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.calculator-modal__content {
    background: rgba(10, 25, 20, 0.7);
    /* Further increased transparency for unmistakable glass effect */
    width: 95%;
    max-width: 850px;
    /* Smaller width as requested */
    max-height: 95vh;
    padding: 30px 30px;
    /* More compact padding */
    border-radius: 24px;
    position: relative;
    color: #ffffff;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    font-family: "FactorA", Helvetica, Arial, sans-serif;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.calculator-modal__close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 26px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
    line-height: 1;
}

.calculator-modal__close:hover {
    opacity: 1;
}

.calculator-modal__header {
    text-align: center;
    margin-bottom: 18px;
}

.calculator-modal__title {
    font-size: 26px;
    font-weight: 500;
    /* Screenshot has slightly lighter weight title */
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.calculator-modal__subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

/* Currency Toggle */
.currency-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.toggle-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 14px;
    display: flex;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-btn {
    padding: 10px 28px;
    border-radius: 10px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: #ffffff;
    color: #000000;
}

/* Inputs Grid */
.calculator-modal__inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 18px;
}

.calculator-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calculator-input-group label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    text-transform: none;
    /* Screenshot has normal case labels */
    letter-spacing: normal;
}

.input-container {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    /* Darker, more solid look like screenshot */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

.input-container:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.input-container input {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    width: 100%;
    outline: none;
    padding-right: 40px;
}

/* Remove Arrows/Spinners */
.input-container input::-webkit-outer-spin-button,
.input-container input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-suffix {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #444;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    transition: color 0.3s;
}

.input-container:focus-within .input-suffix {
    color: #888;
}

/* Results Section (Horizontal Summary Bar like Screenshot) */
.calculator-modal__results-bar {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
}

.calculator-modal__results-bar--bank {
    background: rgba(59, 130, 246, 0.04);
    /* Subtle blue tint for bank */
    border-color: rgba(59, 130, 246, 0.1);
}

.results-bar-header {
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-bar-header::before {
    content: '';
    width: 3px;
    height: 14px;
    background: #ffffff;
    border-radius: 2px;
}

.calculator-modal__results-bar--bank .results-bar-header::before {
    background: #3b82f6;
    /* Blue indicator for bank */
}

.result-stat {
    text-align: center;
    flex: 1;
    position: relative;
}

.result-stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background: rgba(255, 255, 255, 0.05);
    /* Subtle vertical lines */
}

.result-stat__label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    display: block;
}

.result-stat__value {
    font-size: 22px;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.result-stat__value.highlight-green {
    color: #4ade80;
}

.result-stat__value.highlight-blue {
    color: #60a5fa;
}

.result-stat__value.highlight-yellow {
    color: #facc15;
}

.result-stat__subvalue {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
    display: block;
}

/* Comparison Cards */
.calculator-modal__comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.comparison-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    gap: 16px;
    transition: all 0.3s ease;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
}

.card-content h4 {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
    font-weight: 400;
}

.card-content p {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

/* Main Action Button */
.calculator-modal__submit {
    width: 100%;
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calculator-modal__submit:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .calculator-modal__inputs {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .calculator-modal {
        padding: 40px 15px;
        /* Doubled the top/bottom space */
        box-sizing: border-box;
    }

    .calculator-modal__content {
        padding: 40px 20px 20px;
        width: 100%;
        height: auto;
        border-radius: 24px;
        max-height: 100%;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .calculator-modal__close {
        top: 15px;
        right: 20px;
    }

    .calculator-modal__title {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .calculator-modal__header,
    .currency-toggle,
    .calculator-modal__inputs,
    .calculator-modal__results-bar,
    .calculator-modal__comparison {
        margin-bottom: 20px;
    }

    .calculator-modal__inputs {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .calculator-modal__results-bar {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
        border-radius: 16px;
    }

    .result-stat:not(:last-child)::after {
        display: none;
    }

    .result-stat {
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 12px;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: end;
    }

    .result-stat:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .result-stat__label {
        grid-column: 1 / 3;
        margin-bottom: 4px;
        font-size: 13px;
    }

    .result-stat__value {
        grid-column: 1;
        font-size: 22px;
        margin-bottom: 0;
    }

    .result-stat__subvalue {
        grid-column: 2;
        text-align: right;
        font-size: 13px;
    }

    .calculator-modal__comparison {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .comparison-card {
        padding: 16px;
        border-radius: 16px;
        gap: 14px;
    }

    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 12px;
    }

    .card-content h4 {
        margin-bottom: 4px;
    }

    .card-content p {
        font-size: 13px;
    }
}