/* =========================================================
   FREEVEXA — POSITION SIZE CALCULATOR
   ========================================================= */

.tool-hero {
    position: relative;
    padding: 150px 24px 70px;
    overflow: hidden;
    text-align: center;
}

.tool-hero::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    background:
        radial-gradient(
            circle,
            rgba(112, 0, 255, 0.16),
            transparent 68%
        );
    pointer-events: none;
}

.tool-hero-content {
    position: relative;
    z-index: 2;
    max-width: 850px;
    margin: 0 auto;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 15px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: #a7a9b4;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #35e889;
    box-shadow: 0 0 12px rgba(53, 232, 137, 0.7);
}

.tool-hero h1 {
    margin: 24px 0 16px;
    font-size: clamp(42px, 6vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.tool-hero h1 span {
    background: linear-gradient(
        100deg,
        #ffffff,
        #9d7cff,
        #00eaff
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tool-hero p {
    max-width: 690px;
    margin: 0 auto;
    color: #9295a1;
    font-size: 17px;
    line-height: 1.75;
}

.tool-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.tool-meta span {
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    color: #8f929d;
    font-size: 12px;
}



/* =========================================================
   CALCULATOR
   ========================================================= */

.calculator-section {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0 80px;
}

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 22px;
    align-items: start;
}

.calculator-card {
    position: relative;
    padding: 30px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.045),
            rgba(255, 255, 255, 0.018)
        );
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.card-heading {
    margin-bottom: 28px;
}

.step-label {
    display: block;
    margin-bottom: 8px;
    color: #8d7cff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.card-heading h2 {
    margin: 0;
    font-size: 25px;
    letter-spacing: -0.025em;
}

.card-heading p {
    margin: 8px 0 0;
    color: #80838f;
    font-size: 14px;
    line-height: 1.6;
}



/* =========================================================
   FORM
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    min-width: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    color: #c5c6ce;
    font-size: 13px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    outline: none;
    background: rgba(0, 0, 0, 0.24);
    color: #f1f1f4;
    font-family: inherit;
    font-size: 14px;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    border-color: rgba(112, 0, 255, 0.65);
    background: rgba(112, 0, 255, 0.055);
    box-shadow: 0 0 0 3px rgba(112, 0, 255, 0.08);
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: #101117;
    color: #ffffff;
}

.input-with-symbol {
    position: relative;
}

.input-with-symbol input {
    padding-left: 38px;
}

.input-with-symbol span {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #777b87;
    font-size: 14px;
    pointer-events: none;
}

.input-with-symbol input + span {
    left: auto;
    right: 15px;
}

.input-with-symbol:has(input + span) input {
    padding-left: 15px;
    padding-right: 38px;
}



/* =========================================================
   DIRECTION
   ========================================================= */

.direction-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    height: 50px;
}

.direction-option {
    position: relative;
    cursor: pointer;
}

.direction-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.direction-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(0, 0, 0, 0.24);
    color: #858894;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.direction-option input:checked + span {
    color: #ffffff;
    border-color: rgba(0, 240, 255, 0.45);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.07);
}



/* =========================================================
   NOTE
   ========================================================= */

.calculator-note {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
}

.calculator-note span {
    flex: 0 0 auto;
    color: #8f7cff;
}

.calculator-note p {
    margin: 0;
    color: #777b87;
    font-size: 12px;
    line-height: 1.6;
}



/* =========================================================
   ERROR
   ========================================================= */

.error-message {
    display: none;
    margin-top: 15px;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid rgba(255, 72, 110, 0.25);
    background: rgba(255, 72, 110, 0.07);
    color: #ff8da7;
    font-size: 12px;
    line-height: 1.5;
}

.error-message.show {
    display: block;
}



/* =========================================================
   BUTTON
   ========================================================= */

.calculate-btn {
    width: 100%;
    height: 54px;
    margin-top: 20px;
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    color: #ffffff;
    background:
        linear-gradient(
            110deg,
            #7000ff,
            #5630ff,
            #00b8ff
        );
    box-shadow:
        0 12px 35px rgba(91, 30, 255, 0.24);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.calculate-btn span {
    margin-left: 8px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 42px rgba(91, 30, 255, 0.34);
}



/* =========================================================
   RESULT
   ========================================================= */

.result-card {
    overflow: hidden;
}

.result-card::before {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    right: -140px;
    top: -150px;
    background:
        radial-gradient(
            circle,
            rgba(0, 240, 255, 0.10),
            transparent 70%
        );
    pointer-events: none;
}

.main-result {
    position: relative;
    padding: 27px 20px;
    margin-bottom: 18px;
    text-align: center;
    border-radius: 18px;
    border: 1px solid rgba(0, 240, 255, 0.15);
    background:
        linear-gradient(
            145deg,
            rgba(0, 240, 255, 0.07),
            rgba(112, 0, 255, 0.07)
        );
}

.result-label {
    display: block;
    color: #777b87;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
}

.main-result strong {
    display: block;
    margin-top: 8px;
    color: #ffffff;
    font-size: 52px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.lot-caption {
    display: block;
    margin-top: 6px;
    color: #747782;
    font-size: 13px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.result-box {
    min-height: 78px;
    padding: 14px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.17);
}

.result-box span {
    display: block;
    margin-bottom: 7px;
    color: #777b87;
    font-size: 11px;
}

.result-box strong {
    color: #e9e9ee;
    font-size: 15px;
    font-weight: 700;
}

.result-footer {
    display: flex;
    gap: 9px;
    margin-top: 18px;
    padding: 13px;
    border-radius: 12px;
    background: rgba(255, 184, 0, 0.045);
    border: 1px solid rgba(255, 184, 0, 0.10);
}

.result-footer span {
    color: #e4b94e;
}

.result-footer p {
    margin: 0;
    color: #777b87;
    font-size: 11px;
    line-height: 1.55;
}



/* =========================================================
   INFO SECTION
   ========================================================= */

.how-section {
    padding-top: 30px;
}

.info-grid {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.info-card {
    padding: 27px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    transition:
        transform 0.25s ease,
        border-color 0.25s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    border-color: rgba(112, 0, 255, 0.25);
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 20px;
    border-radius: 13px;
    border: 1px solid rgba(112, 0, 255, 0.22);
    background: rgba(112, 0, 255, 0.08);
    font-size: 20px;
}

.info-card h3 {
    margin: 0 0 9px;
    font-size: 17px;
}

.info-card p {
    margin: 0;
    color: #777b87;
    font-size: 13px;
    line-height: 1.7;
}



/* =========================================================
   FORMULA
   ========================================================= */

.formula-section {
    padding-top: 40px;
}

.formula-card {
    width: min(900px, calc(100% - 40px));
    margin: 0 auto;
    padding: 35px;
    text-align: center;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(
            145deg,
            rgba(112, 0, 255, 0.045),
            rgba(0, 240, 255, 0.025)
        );
}

.formula-card h2 {
    margin: 10px 0 22px;
    font-size: 28px;
}

.formula-display {
    display: inline-block;
    max-width: 100%;
    padding: 16px 22px;
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
    color: #b7a6ff;
    font-family: monospace;
    font-size: 14px;
}

.formula-card p {
    max-width: 650px;
    margin: 18px auto 0;
    color: #777b87;
    font-size: 13px;
    line-height: 1.7;
}



/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {

    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 700px) {

    .tool-hero {
        padding-top: 125px;
    }

    .calculator-section {
        width: min(100% - 24px, 600px);
    }

    .calculator-card {
        padding: 22px;
        border-radius: 19px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: auto;
    }

    .result-grid {
        grid-template-columns: 1fr 1fr;
    }

    .info-grid {
        width: min(100% - 24px, 600px);
        grid-template-columns: 1fr;
    }

    .formula-card {
        width: min(100% - 24px, 600px);
        padding: 25px 18px;
    }

}


@media (max-width: 480px) {

    .tool-hero h1 {
        font-size: 42px;
    }

    .tool-hero p {
        font-size: 14px;
    }

    .tool-meta {
        gap: 6px;
    }

    .tool-meta span {
        font-size: 11px;
    }

    .calculator-card {
        padding: 18px;
    }

    .card-heading h2 {
        font-size: 22px;
    }

    .main-result strong {
        font-size: 44px;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .direction-toggle {
        gap: 6px;
    }

}
