/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =========================
   BODY
========================= */

body {

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    min-height: 100vh;

    background:
        linear-gradient(
            135deg,
            #f4f7fb,
            #e9eef7
        );

    color: #172033;

    padding: 30px 15px;

}


/* =========================
   MAIN WRAPPER
========================= */

.calculator-wrapper {

    width: 100%;

    max-width: 900px;

    margin: auto;

}


/* =========================
   CARD
========================= */

.calculator-card {

    background: #ffffff;

    border-radius: 24px;

    padding: 32px;

    box-shadow:
        0 20px 60px rgba(20, 40, 80, 0.12);

}


/* =========================
   HEADER
========================= */

.calculator-header {

    display: flex;

    align-items: center;

    gap: 18px;

    margin-bottom: 35px;

}


.header-icon {

    width: 65px;

    height: 65px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 32px;

    border-radius: 18px;

    background: #eef2ff;

}


.calculator-header h1 {

    font-size: 30px;

    line-height: 1.2;

    margin-bottom: 7px;

}


.calculator-header p {

    color: #667085;

    font-size: 15px;

}


/* =========================
   FORM GRID
========================= */

.form-grid {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 20px;

}


.input-group {

    display: flex;

    flex-direction: column;

}


.input-group label {

    font-size: 15px;

    font-weight: 700;

    margin-bottom: 8px;

}


.input-wrapper {

    display: flex;

    align-items: center;

    border: 2px solid #e4e7ec;

    border-radius: 12px;

    overflow: hidden;

    transition: 0.2s ease;

    background: #ffffff;

}


.input-wrapper:focus-within {

    border-color: #4f46e5;

    box-shadow:
        0 0 0 4px rgba(79, 70, 229, 0.10);

}


.input-wrapper input {

    width: 100%;

    border: none;

    outline: none;

    padding: 14px 12px;

    font-size: 17px;

    font-weight: 600;

    color: #172033;

}


.currency-symbol,
.percentage-symbol {

    padding: 0 14px;

    font-size: 17px;

    font-weight: 700;

    color: #667085;

}


.input-group small {

    margin-top: 7px;

    color: #98a2b3;

    font-size: 12px;

}


/* =========================
   BUTTONS
========================= */

.button-group {

    display: flex;

    gap: 14px;

    margin-top: 30px;

}


.calculate-btn,
.reset-btn {

    border: none;

    border-radius: 12px;

    padding: 15px 22px;

    font-size: 15px;

    font-weight: 700;

    cursor: pointer;

    transition: 0.2s ease;

}


.calculate-btn {

    flex: 1;

    background: #4f46e5;

    color: #ffffff;

}


.calculate-btn:hover {

    background: #4338ca;

    transform: translateY(-2px);

}


.reset-btn {

    background: #f2f4f7;

    color: #344054;

}


.reset-btn:hover {

    background: #e4e7ec;

}


/* =========================
   ERROR
========================= */

.error-message {

    display: none;

    margin-top: 20px;

    padding: 13px 15px;

    border-radius: 10px;

    background: #fff1f0;

    color: #c62828;

    font-size: 14px;

    font-weight: 600;

}


/* =========================
   RESULTS
========================= */

.result-section {

    margin-top: 35px;

    padding-top: 30px;

    border-top: 1px solid #eaecf0;

}


.result-heading {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;

}


.result-heading h2 {

    font-size: 21px;

}


.result-heading span {

    color: #16803c;

    background: #ecfdf3;

    padding: 6px 12px;

    border-radius: 20px;

    font-size: 12px;

    font-weight: 700;

}


/* =========================
   RESULT GRID
========================= */

.results-grid {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 15px;

}


.result-card {

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 18px;

    border-radius: 15px;

    background: #f8fafc;

    border: 1px solid #eaecf0;

}


.result-icon {

    width: 45px;

    height: 45px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background: #ffffff;

    font-size: 22px;

}


.result-content {

    display: flex;

    flex-direction: column;

    gap: 5px;

}


.result-content span {

    color: #667085;

    font-size: 13px;

}


.result-content strong {

    font-size: 22px;

    color: #172033;

}


/* =========================
   HIGHLIGHT RESULTS
========================= */

.highlight-card {

    background: #eef2ff;

    border-color: #c7d2fe;

}


.highlight-card strong {

    color: #4338ca;

}


.customer-card {

    background: #ecfdf3;

    border-color: #bbf7d0;

}


.customer-card strong {

    color: #15803d;

}


.profit-card {

    background: #fff7ed;

    border-color: #fed7aa;

}


.profit-card strong {

    color: #c2410c;

}


/* =========================
   SUMMARY
========================= */

.calculation-summary {

    margin-top: 25px;

    padding: 20px;

    border-radius: 15px;

    background: #f8fafc;

}


.calculation-summary h3 {

    font-size: 17px;

    margin-bottom: 12px;

}


#summaryText {

    color: #475467;

    line-height: 1.7;

    font-size: 14px;

}


/* =========================
   FORMULA
========================= */

.formula-section {

    margin-top: 35px;

    padding-top: 30px;

    border-top: 1px solid #eaecf0;

}


.formula-section h2 {

    font-size: 21px;

    margin-bottom: 18px;

}


.formula-box {

    padding: 20px;

    border-radius: 15px;

    background: #101828;

    color: #ffffff;

}


.formula-box p {

    margin-top: 12px;

    margin-bottom: 6px;

}


.formula-box p:first-child {

    margin-top: 0;

}


.formula-box code {

    display: block;

    padding: 10px;

    border-radius: 8px;

    background: rgba(255, 255, 255, 0.08);

    color: #d1d5db;

    font-size: 13px;

}


/* =========================
   FOOTER
========================= */

.calculator-footer {

    text-align: center;

    margin-top: 30px;

    padding-top: 20px;

    border-top: 1px solid #eaecf0;

}


.calculator-footer p {

    color: #98a2b3;

    font-size: 13px;

}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 700px) {

    body {

        padding: 15px 10px;

    }


    .calculator-card {

        padding: 22px 17px;

        border-radius: 18px;

    }


    .calculator-header {

        align-items: flex-start;

    }


    .calculator-header h1 {

        font-size: 24px;

    }


    .calculator-header p {

        font-size: 13px;

    }


    .header-icon {

        width: 52px;

        height: 52px;

        font-size: 25px;

    }


    .form-grid {

        grid-template-columns: 1fr;

    }


    .results-grid {

        grid-template-columns: 1fr;

    }


    .button-group {

        flex-direction: column;

    }


    .calculate-btn,
    .reset-btn {

        width: 100%;

    }

}


@media (max-width: 400px) {

    .result-content strong {

        font-size: 19px;

    }

}