/* ============================================================
   EDGE AMC — Calculator Suite — Shared Design System
   ============================================================
   BRAND TOKENS — sourced from the live edgeamc.com stylesheet
   (https://www.edgeamc.com/contents/website/css/style.css):
     Primary (buttons/headers):  #043852  (dark teal)
     Accent / hover / CTA:       #f47957  (coral)
     Heading text:               #132c33
     Body text:                  #606060  (secondary #808080)
     Section background:         #F2F5F6
     Link blue:                  #1E6588
     Fonts: 'Playfair Display' (headings, serif) + 'Inter' (body)
     Buttons: square corners (border-radius: 0), padding 10px 35px,
              navy background → coral on hover, white text
   Bengali script falls back to Noto Serif/Sans Bengali since
   Playfair Display and Inter don't cover Bengali glyphs.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=Noto+Serif+Bengali:wght@500;600;700&family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap');

:root {
    /* ---- Brand palette (from edgeamc.com live CSS) ---- */
    --color-primary: #043852;
    /* EDGE dark teal — buttons, headers */
    --color-primary-dark: #032a3e;
    --color-primary-light: #1E6588;
    /* EDGE link blue */
    --color-accent: #f47957;
    /* EDGE coral — hover states, CTAs */
    --color-accent-dark: #e0603c;
    --color-positive: #1E8E5A;
    /* gains / positive values */
    --color-negative: #C0392B;
    /* warnings / negative values */
    --color-bg: #F2F5F6;
    /* EDGE section background */
    --color-surface: #FFFFFF;
    --color-border: #E1E7EF;
    --color-text: #606060;
    /* EDGE body text */
    --color-heading: #132c33;
    /* EDGE heading text */
    --color-text-muted: #808080;
    /* EDGE secondary text */
    --color-text-on-primary: #FFFFFF;

    /* ---- Typography (EDGE: Playfair Display headings, Inter body) ---- */
    --font-heading: 'Playfair Display', 'Noto Serif Bengali', Georgia, serif;
    --font-body: 'Inter', 'Noto Sans Bengali', 'Segoe UI', sans-serif;

    /* ---- Layout (EDGE uses sharp, square corners) ---- */
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --shadow-sm: 0 1px 3px rgba(4, 56, 82, 0.08);
    --shadow-md: 0 8px 24px rgba(4, 56, 82, 0.10);
    --shadow-lg: 0 16px 40px rgba(4, 56, 82, 0.14);
    --container-max: 1180px;
}

/* ================= Reset ================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-surface);
    /*line-height: 1.55;*/
    -webkit-font-smoothing: antialiased;
}

h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    font-weight: 700;
    margin: 0 0 .5em;
    line-height: 1.25;
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--color-primary-light);
    text-decoration: none;
}

a:hover {
    color: var(--color-accent);
}

img {
    max-width: 100%;
    display: block;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

button {
    font-family: inherit;
}

/* Bengali script needs slightly larger line-height for readability */
html[lang="bn"] body {
    line-height: 1.75;
}

html[lang="bn"] h1,
html[lang="bn"] h2,
html[lang="bn"] h3 {
    line-height: 1.45;
}

.calc .container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ Standalone language toggle bar ============
   The calculators ship without site header/footer (they embed
   into existing edgeamc.com page chrome). The language toggle
   sits on its own, top-right above the calculator title. */
.lang-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 18px 0 0;
}

.lang-toggle {
    display: inline-flex;
    border: 1px solid var(--color-primary);
    overflow: hidden;
    background: var(--color-surface);
}

.lang-toggle button {
    border: none;
    background: transparent;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--color-primary);
    cursor: pointer;
    transition: background .3s ease, color .3s ease;
}

.lang-toggle button:hover:not(.active) {
    background: rgba(4, 56, 82, .07);
}

.lang-toggle button.active {
    background: var(--color-primary);
    color: #fff;
}

/* EDGE AMC button style: square corners, navy → coral on hover (.btn_com) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14.5px;
    border-radius: 0;
    padding: 10px 35px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background .3s ease, color .3s ease, border-color .3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent);
    color: #fff;
}

.btn-accent {
    background: var(--color-accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}

/* Outlined variant for use on the dark navy CTA band */
.btn-on-dark {
    background: transparent;
    border-color: #fff;
    color: #fff;
}

.btn-on-dark:hover {
    background: #fff;
    color: var(--color-primary);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 13px 42px;
    font-size: 16px;
}

/* ================= Breadcrumb / Hero ================= */
.calc-hero {
    padding: 22px 0 24px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}

.breadcrumb a {
    color: var(--color-text-muted);
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

/* EDGE uses large Playfair Display headings (h1 55px on desktop) */
.calc-hero h1 {
    font-size: clamp(28px, 4.5vw, 44px);
}

.calc-hero .lede {
    font-size: 16.5px;
    color: var(--color-text-muted);
    max-width: 760px;
}

/* ================= Calculator layout ================= */
.calc-shell {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 28px;
    padding: 8px 0 48px;
    align-items: start;
}

.calc-shell>div {
    min-width: 0;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px;
}

.card h2 {
    font-size: 19px;
    margin-bottom: 18px;
}

.field {
    margin-bottom: 22px;
}

.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 10px;
}

.field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.field .hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

.input-with-prefix {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    transition: border-color .15s;
}

.input-with-prefix:focus-within {
    border-color: var(--color-primary);
}

.input-with-prefix .prefix {
    padding: 12px 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-right: 1.5px solid var(--color-border);
    font-size: 14.5px;
}

.input-with-prefix.is-suffix {
    flex-direction: row-reverse;
}

.input-with-prefix.is-suffix .prefix {
    border-right: none;
    border-left: 1.5px solid var(--color-border);
}

.input-with-prefix input {
    border: none;
    outline: none;
    padding: 12px 14px;
    font-size: 15.5px;
    font-weight: 600;
    width: 100%;
    font-family: var(--font-body);
    color: var(--color-text);
    background: transparent;
}

input[type="range"] {
    width: 100%;
    margin-top: 10px;
    accent-color: var(--color-primary);
    height: 4px;
}

.range-scale {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.toggle-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toggle-group button {
    border: 1.5px solid var(--color-border);
    background: #fff;
    border-radius: 0;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text-muted);
}

.toggle-group button.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

/* ---- Results panel ---- */
.result-card {
    position: sticky;
    top: 20px;
}

.result-headline {
    text-align: center;
    padding: 6px 0 18px;
    border-bottom: 1px dashed var(--color-border);
    margin-bottom: 18px;
}

.result-headline .label {
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.result-headline .value {
    font-family: var(--font-heading);
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 800;
    color: var(--color-primary);
    margin: 4px 0;
}

.result-headline .value small {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.result-headline .words {
    font-size: 12.5px;
    color: var(--color-text-muted);
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.result-stat {
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.result-stat .dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
}

.result-stat .label {
    font-size: 12.5px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.result-stat .value {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    color: var(--color-heading);
    margin-top: 2px;
}

.donut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin: 6px 0 20px;
}

.donut-legend {
    font-size: 13px;
}

.donut-legend .item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.donut-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.disclaimer {
    font-size: 11.5px;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
    margin-top: 6px;
}

/* ---- Content / SEO sections ---- */
.content-section {
    padding: 40px 0;
}

.alt {
    background: var(--color-bg) !important;
}

.content-section h2 {
    font-size: 24px;
    margin-bottom: 16px;
}

.content-section h3 {
    font-size: 17px;
    margin-top: 20px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.two-col>div,
.related-calcs>a,
.result-grid>div {
    min-width: 0;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
}

.faq-item summary {
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--color-heading);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    transition: color .3s ease;
}

.faq-item summary:hover {
    color: var(--color-accent);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    font-size: 20px;
    color: var(--color-accent);
    flex-shrink: 0;
}

.faq-item[open] summary::after {
    content: "\2212";
}

.faq-item p {
    margin-top: 10px;
    color: var(--color-text-muted);
    font-size: 14.5px;
}

.related-calcs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.related-calcs a {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 18px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-heading);
    font-size: 15px;
    box-shadow: var(--shadow-sm);
    transition: border-color .3s ease, color .3s ease;
}

.related-calcs a:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.related-calcs a .desc {
    display: block;
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.5;
}

/* Conversion band — EDGE navy with a coral top rule */
.cta-band {
    background: var(--color-primary);
    border-top: 4px solid var(--color-accent);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    text-align: center;
    margin: 8px 0 0;
}

.cta-band h2 {
    color: #fff;
    font-size: clamp(21px, 3vw, 27px);
}

.cta-band p {
    color: rgba(255, 255, 255, .84);
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

.cta-band .btn-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Inside the navy band the primary CTA inverts to coral so it stays prominent */
.cta-band .btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.cta-band .btn-primary:hover {
    background: #fff;
    color: var(--color-primary);
}

/* ================= Utilities ================= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

[data-i18n-bn],
[lang="bn"] .lang-en,
.lang-bn {}

html[lang="en"] .lang-bn {
    display: none !important;
}

html[lang="bn"] .lang-en {
    display: none !important;
}

/* ================= Responsive ================= */
@media (max-width: 980px) {
    .calc-shell {
        grid-template-columns: 1fr;
    }

    .result-card {
        position: static;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .related-calcs {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .card {
        padding: 20px;
    }

    .result-grid {
        grid-template-columns: 1fr 1fr;
    }

    .related-calcs {
        grid-template-columns: 1fr;
    }

    .cta-band {
        padding: 26px 18px;
    }

    .donut-wrap {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .result-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 16px;
    }

    .lang-toggle button {
        padding: 6px 10px;
        font-size: 12px;
    }
}
