/* =============================================
   CRYPTO POSITION SIZE CALCULATOR - gmp-cal.css
   All layout styles scoped under .gmp-calculator-wrap
   to prevent affecting navbar, footer, and other pages.
   ============================================= */

.page-content {
    background: #fff;
}

.form-v4-content {
    width: 100%;
    margin: 0 auto;
    background-color: #f4fbfb;
    padding: 40px;
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    height: fit-content !important;
    min-height: auto !important;
}

/* ---- Calculator 3-column layout ---- */
.gmp-calculator-wrap .calculator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.gmp-calculator-wrap .left,
.gmp-calculator-wrap .right {
    flex: 1;
    min-width: 200px;
}

.gmp-calculator-wrap .chart-container {
    flex: 1.2;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---- Canvas / Doughnut Chart ---- */
.gmp-calculator-wrap .chart-container canvas {
    width: 250px !important;
    height: 250px !important;
}

/* ---- Left: Result labels ---- */
.gmp-calculator-wrap .left .results h3 {
    margin-bottom: 4px;
    color: #273158;
    font-weight: 700;
    font-size: 15px;
    font-family: "Nunito", sans-serif;
}

.gmp-calculator-wrap .left .results p {
    font-size: 22px;
    font-weight: bold;
    color: #2EB24C;
    font-family: "Nunito", sans-serif;
    margin-bottom: 18px;
    margin-top: 0;
}

/* ---- Center: Chart heading ---- */
.gmp-calculator-wrap .chart-container h3 {
    margin-bottom: 10px;
    color: #273158;
    font-weight: 700;
    font-size: 15px;
    font-family: "Nunito", sans-serif;
}

/* ---- Right: Input labels ---- */
.gmp-calculator-wrap .right label {
    display: block;
    margin-bottom: 5px;
    color: #273158;
    font-size: 15px;
    font-family: "Nunito", sans-serif;
    font-weight: 600;
}

/* ---- Text value inputs ---- */
.gmp-calculator-wrap input[type="text"] {
    width: 100%;
    max-width: 140px;
    padding: 8px 12px;
    margin-top: 8px;
    margin-bottom: 24px;
    border: none;
    border-radius: 6px;
    background-color: rgba(173, 216, 230, 0.45);
    font-weight: 600;
    color: #333;
    font-size: 15px;
    font-family: "Nunito", sans-serif;
}

/* ---- Estimated Listing Price total row ---- */
.gmp-calculator-wrap .total {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0f0f5;
}

.gmp-calculator-wrap .total h3 {
    color: #273158;
    font-size: 18px;
    font-weight: 700;
    font-family: "Nunito", sans-serif;
    margin-bottom: 6px;
}

.gmp-calculator-wrap .total p.listing-price {
    font-size: 26px;
    font-weight: bold;
    color: #2EB24C;
    font-family: "Nunito", sans-serif;
    margin-bottom: 8px;
}

.gmp-calculator-wrap .total p.disclaimer {
    font-size: 12px;
    font-weight: normal;
    color: #888;
}

/* ---- Responsive: mobile stacking ---- */
@media (max-width: 768px) {
    .form-v4-content {
        padding: 20px 16px;
    }

    .gmp-calculator-wrap .calculator {
        flex-direction: column;
        gap: 10px;
    }

    .gmp-calculator-wrap .right {
        order: 1;
        width: 100%;
        min-width: 100%;
    }

    .gmp-calculator-wrap .chart-container {
        order: 2;
        width: 100%;
        min-width: 100%;
    }

    .gmp-calculator-wrap .left {
        order: 3;
        width: 100%;
        min-width: 100%;
    }

    .gmp-calculator-wrap .left .results {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .gmp-calculator-wrap .left .results h3 {
        font-size: 13px;
    }

    .gmp-calculator-wrap .left .results p {
        font-size: 16px;
        margin-bottom: 0;
    }

    .gmp-calculator-wrap .chart-container canvas {
        width: 200px !important;
        height: 200px !important;
    }
}

/* ---- Crypto position size calculator extras ---- */
.gmp-calculator-wrap .right {
    align-self: flex-start;
}

.gmp-calculator-wrap .quick-risk {
    display: flex;
    gap: 6px;
}

.gmp-calculator-wrap .quick-risk button {
    flex: 1;
    border: 1px solid #cfdfe6;
    background: #fff;
    color: #273158;
    border-radius: 8px;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    font-family: "Nunito", sans-serif;
    cursor: pointer;
}

.gmp-calculator-wrap .quick-risk button.active,
.gmp-calculator-wrap .quick-risk button:hover {
    border-color: #273158;
    background: #273158;
    color: #fff;
}

.gmp-calculator-wrap .calc-alert {
    display: none;
    margin-top: 20px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #fdecea;
    color: #a12622;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.gmp-calculator-wrap .calc-alert.warn {
    background: #fff4d6;
    color: #7a5600;
}

/* ---- Input panel: bordered fields, segmented toggles ---- */
.gmp-calculator-wrap .right {
    flex: 1.6;
    min-width: 260px;
}

.gmp-calculator-wrap .right > div {
    margin-bottom: 14px;
}

.gmp-calculator-wrap .ifield {
    position: relative;
    flex: 1;
    min-width: 0;
}

.gmp-calculator-wrap .right input[type="text"] {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #cfdfe6;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    color: #273158;
}

.gmp-calculator-wrap .right input[type="text"]:focus {
    outline: none;
    border-color: #2EB24C;
    box-shadow: 0 0 0 3px rgba(46, 178, 76, 0.15);
}

.gmp-calculator-wrap .ifield .pre,
.gmp-calculator-wrap .ifield .suf {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #8a6a0c;
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
}

.gmp-calculator-wrap .ifield .pre {
    left: 12px;
}

.gmp-calculator-wrap .ifield .suf {
    right: 12px;
}

.gmp-calculator-wrap .ifield .pre + input {
    padding-left: 30px;
}

.gmp-calculator-wrap .ifield.wide-pre .pre + input {
    padding-left: 52px;
}

.gmp-calculator-wrap .ifield input:has(+ .suf) {
    padding-right: 30px;
}

.gmp-calculator-wrap .seg {
    display: flex;
    padding: 4px;
    border-radius: 10px;
    background: #e3eef2;
}

.gmp-calculator-wrap .seg button {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #5a6478;
    font-size: 14px;
    font-weight: 600;
    font-family: "Nunito", sans-serif;
    cursor: pointer;
}

.gmp-calculator-wrap .seg button.active {
    background: #fff;
    color: #273158;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.gmp-calculator-wrap .seg[data-target="direction"] button.active[data-value="long"] {
    background: #2EB24C;
    color: #fff;
}

.gmp-calculator-wrap .seg[data-target="direction"] button.active[data-value="short"] {
    background: #e74c3c;
    color: #fff;
}

/* ---- Labels for the toggle groups ---- */
.gmp-calculator-wrap .right .psc-label {
    display: block;
    margin-bottom: 5px;
    color: #273158;
    font-size: 15px;
    font-family: "Nunito", sans-serif;
    font-weight: 600;
}

/* ---- Page heading: one line on desktop ---- */
.form-v4-content h1 {
    font-size: 2rem;
}

/* ---- Position Size total, shown in the left results column ---- */
.gmp-calculator-wrap .left .total-left {
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid #e0f0f5;
}

.gmp-calculator-wrap .left .total-left h3 {
    font-size: 18px;
}

.gmp-calculator-wrap .left .total-left p.listing-price {
    font-size: 26px;
    margin-bottom: 0;
}

.gmp-calculator-wrap .total {
    margin-top: 20px;
    padding-top: 14px;
}

@media (max-width: 768px) {
    .form-v4-content h1 {
        font-size: 1.6rem;
    }

    .gmp-calculator-wrap .left .total-left {
        width: 100%;
    }
}

/* =============================================
   CRYPTO LIQUIDATION PRICE CALCULATOR extras
   ============================================= */
.gmp-calculator-wrap .row2 {
    display: flex;
    gap: 10px;
}

.gmp-calculator-wrap .row2 > div {
    flex: 1;
    min-width: 0;
}

.gmp-calculator-wrap .lev-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gmp-calculator-wrap .lev-row input[type="range"] {
    flex: 1;
    min-width: 0;
    height: 6px;
    accent-color: #273158;
    cursor: pointer;
}

.gmp-calculator-wrap .lev-row .ifield {
    flex: 0 0 86px;
}

.gmp-calculator-wrap .lev-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    color: #8a93a6;
    font-size: 11px;
    font-weight: 600;
}

.gmp-calculator-wrap .opt {
    color: #8a93a6;
    font-size: 12px;
    font-weight: 600;
}

.gmp-calculator-wrap .left .total-left p.liq-price { color: #e74c3c; }
.gmp-calculator-wrap .left .results small {
    display: block;
    margin-top: -14px;
    margin-bottom: 14px;
    color: #5a6478;
    font-size: 12px;
    font-weight: 600;
}

.gmp-calculator-wrap .calc-alert.ok {
    background: #e7f7ec;
    color: #1d7a36;
}

@media (max-width: 768px) {
    .gmp-calculator-wrap .left .results small {
        width: 100%;
        margin: -6px 0 0;
    }
}

/* Side toggle: green long, red short (same as the position size calculator) */
.gmp-calculator-wrap .seg[data-target="side"] button.active[data-value="long"] {
    background: #2EB24C;
    color: #fff;
}

.gmp-calculator-wrap .seg[data-target="side"] button.active[data-value="short"] {
    background: #e74c3c;
    color: #fff;
}

/* tick labels sit under the slider only (box is 86px + 12px gap) */
.gmp-calculator-wrap .lev-ticks {
    margin-right: 98px;
}

/* Hint text under an input (margin, maintenance rate) */
.gmp-calculator-wrap .right .opt {
    display: block;
    margin-top: 4px;
}

/* "Below / Above entry price" under the liquidation price */
.gmp-calculator-wrap .left .total-left small {
    margin-top: 4px;
    margin-bottom: 0;
}
