/* ============================================================
   EMD Calculator (GeM) tool styles
   Palette: #0c3c63 (deep blue) · #32d314 (green) accents
   ============================================================ */

.calculator-wrap {
    max-width: 1080px;
    margin: 0 auto 3rem;
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(12, 60, 99, 0.10);
    font-family: Roboto, sans-serif;
}

/* ---------- Hero ---------- */
.calculator-wrap .hero {
    background: linear-gradient(135deg, #0c3c63 0%, #1e5a8a 100%);
    padding: 32px 36px;
}

.calculator-wrap .hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.calculator-wrap .hero-text h2 {
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.2;
}

.calculator-wrap .hero-text p {
    color: rgba(255, 255, 255, 0.88);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    max-width: 640px;
}

.calculator-wrap .hero-icon {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.10);
}

/* ---------- Content grid ---------- */
.calculator-wrap .content {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 32px;
    padding: 36px;
}

/* ---------- Left panel: inputs ---------- */
.calculator-wrap .section-block {
    margin-bottom: 28px;
}

.calculator-wrap .section-block:last-child {
    margin-bottom: 0;
}

.calculator-wrap .label-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.calculator-wrap .label-row svg {
    width: 22px;
    height: 22px;
    color: #0c3c63;
    flex: 0 0 auto;
}

.calculator-wrap .field-title {
    font-size: 17px;
    font-weight: 600;
    color: #0c3c63;
    margin: 0;
}

.calculator-wrap .field-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 12px;
    line-height: 1.5;
}

.calculator-wrap .input-wrap input {
    width: 100%;
    padding: 13px 16px;
    font-size: 16px;
    color: #0c3c63;
    background: #f7f9fb;
    border: 1.5px solid #d7dde3;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: Roboto, sans-serif;
}

.calculator-wrap .input-wrap input:focus {
    border-color: #32d314;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(50, 211, 20, 0.15);
}

/* Rate pills */
.calculator-wrap .rate-pills-title {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin: 16px 0 10px;
}

.calculator-wrap .rate-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.calculator-wrap .rate-pill {
    flex: 1 1 auto;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #0c3c63;
    background: #eef3f7;
    border: 1.5px solid #d7dde3;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: Roboto, sans-serif;
    line-height: 1.3;
}

.calculator-wrap .rate-pill:hover {
    border-color: #32d314;
    color: #0c3c63;
}

.calculator-wrap .rate-pill.active {
    background: linear-gradient(to top, #32d314, #33e312);
    border-color: #32d314;
    color: #fff;
    box-shadow: 0 5px 12px rgba(50, 211, 20, 0.30);
}

/* ---------- Right panel: result ---------- */
.calculator-wrap .result-card {
    background: #f7f9fb;
    border: 1px solid #e6e8ec;
    border-radius: 14px;
    padding: 24px;
    height: 100%;
}

.calculator-wrap .result-head p {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
    margin: 0 0 14px;
}

.calculator-wrap .result-box {
    background: linear-gradient(135deg, #0c3c63 0%, #1e5a8a 100%);
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    margin-bottom: 20px;
}

.calculator-wrap .result-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 8px;
}

.calculator-wrap .result-amount {
    font-size: 34px;
    font-weight: 700;
    color: #9ff0d0;
    line-height: 1.2;
    word-break: break-word;
}

.calculator-wrap .result-empty {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    margin: 8px 0 0;
}

/* Breakdown */
.calculator-wrap .breakdown-card {
    background: #fff;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
}

.calculator-wrap .breakdown-title {
    font-size: 15px;
    font-weight: 600;
    color: #0c3c63;
    margin: 0 0 12px;
}

.calculator-wrap .breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calculator-wrap .breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2e6ea;
}

.calculator-wrap .breakdown-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.calculator-wrap .breakdown-label {
    font-size: 14px;
    color: #6b7280;
}

.calculator-wrap .breakdown-value {
    font-size: 15px;
    font-weight: 600;
    color: #0c3c63;
    text-align: right;
}

.calculator-wrap .validity-note {
    font-size: 13px;
    color: #4a5568;
    background: #eefdeb;
    border-left: 4px solid #32d314;
    border-radius: 6px;
    padding: 10px 14px;
    line-height: 1.5;
}

/* ============================================================
   Dark mode
   ============================================================ */
body.dark-mode .calculator-wrap {
    background: #1e1e24;
    border-color: #33343d;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .calculator-wrap .field-title,
body.dark-mode .calculator-wrap .breakdown-title,
body.dark-mode .calculator-wrap .breakdown-value {
    color: #f5f5f5;
}

body.dark-mode .calculator-wrap .label-row svg {
    color: #66b3ff;
}

body.dark-mode .calculator-wrap .field-desc,
body.dark-mode .calculator-wrap .rate-pills-title,
body.dark-mode .calculator-wrap .breakdown-label,
body.dark-mode .calculator-wrap .validity-note {
    color: #c4c4cc;
}

body.dark-mode .calculator-wrap .input-wrap input {
    background: #26262e;
    border-color: #3a3b45;
    color: #f5f5f5;
}

body.dark-mode .calculator-wrap .input-wrap input:focus {
    background: #2c2c35;
    border-color: #32d314;
}

body.dark-mode .calculator-wrap .rate-pill {
    background: #26262e;
    border-color: #3a3b45;
    color: #dcdce2;
}

body.dark-mode .calculator-wrap .result-card,
body.dark-mode .calculator-wrap .breakdown-card {
    background: #26262e;
    border-color: #33343d;
}

body.dark-mode .calculator-wrap .breakdown-item {
    border-bottom-color: #3a3b45;
}

body.dark-mode .calculator-wrap .validity-note {
    background: rgba(50, 211, 20, 0.08);
}

/* ============================================================
   Responsive
   ============================================================ */
@media screen and (max-width: 900px) {
    .calculator-wrap .content {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px;
    }

    .calculator-wrap .hero {
        padding: 24px;
    }

    .calculator-wrap .hero-text h2 {
        font-size: 26px;
    }
}

@media screen and (max-width: 575px) {
    .calculator-wrap {
        border-radius: 14px;
        margin-bottom: 2rem;
    }

    .calculator-wrap .hero-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .calculator-wrap .hero-icon {
        width: 56px;
        height: 56px;
    }

    .calculator-wrap .hero-text h2 {
        font-size: 23px;
    }

    .calculator-wrap .content {
        padding: 20px 16px;
    }

    .calculator-wrap .rate-pill {
        flex: 1 1 100%;
    }

    .calculator-wrap .result-amount {
        font-size: 28px;
    }
}

/* ============================================================
   EMD formula / explanation section
   ============================================================ */
.emd-formula-section {
    max-width: 1080px;
    margin: 0 auto 3rem;
    padding: 32px 36px;
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(12, 60, 99, 0.08);
    font-family: Roboto, sans-serif;
}

.emd-formula-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0c3c63;
    margin: 0 0 16px;
    line-height: 1.25;
}

.emd-formula-subhead {
    font-size: 20px;
    font-weight: 600;
    color: #0c3c63;
    margin: 26px 0 12px;
}

.emd-formula-intro {
    font-size: 16px;
    line-height: 1.7;
    color: #4a5568;
    margin: 0 0 16px;
}

.emd-formula-box {
    background: linear-gradient(135deg, #0c3c63 0%, #1e5a8a 100%);
    border-radius: 12px;
    padding: 22px 24px;
    text-align: center;
    margin: 4px 0 8px;
}

.emd-formula-eq {
    font-size: 22px;
    font-weight: 700;
    color: #9ff0d0;
    letter-spacing: 0.3px;
    line-height: 1.5;
    word-break: break-word;
}

.emd-formula-example {
    font-size: 18px;
    color: #fff;
    font-weight: 500;
}

.emd-formula-example strong {
    color: #9ff0d0;
}

.emd-formula-list {
    padding-left: 22px;
    margin: 0 0 8px;
    list-style: disc;
}

.emd-formula-list li {
    font-size: 16px;
    line-height: 1.7;
    color: #4a5568;
    margin-bottom: 10px;
}

.emd-formula-list li strong {
    color: #0c3c63;
}

.emd-formula-note {
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
    background: #eefdeb;
    border-left: 4px solid #32d314;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 20px 0 0;
}

/* Dark mode */
body.dark-mode .emd-formula-section {
    background: #1e1e24;
    border-color: #33343d;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .emd-formula-section h2,
body.dark-mode .emd-formula-subhead,
body.dark-mode .emd-formula-list li strong {
    color: #f5f5f5;
}

body.dark-mode .emd-formula-intro,
body.dark-mode .emd-formula-list li,
body.dark-mode .emd-formula-note {
    color: #c4c4cc;
}

body.dark-mode .emd-formula-note {
    background: rgba(50, 211, 20, 0.08);
}

/* Responsive */
@media screen and (max-width: 900px) {
    .emd-formula-section {
        padding: 24px;
    }
}

@media screen and (max-width: 575px) {
    .emd-formula-section {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .emd-formula-section h2 {
        font-size: 23px;
    }

    .emd-formula-eq {
        font-size: 18px;
    }

    .emd-formula-example {
        font-size: 16px;
    }
}
