:root {
    --green-950: #052e16;
    --green-900: #14532d;
    --green-800: #166534;
    --green-700: #15803d;
    --green-100: #dcfce7;
    --green-50: #f0fdf4;

    --amber: #d97706;

    --text: #14532d;
    --muted: #6b7280;
    --border: rgba(22,101,52,.12);
    --bg: #fbfcfa;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(22,101,52,.035), transparent 38%),
        var(--bg);

    color: var(--text);

    font-family:
        Tahoma,
        Arial,
        "Segoe UI",
        sans-serif;

    line-height: 1.6;
}


button,
input {
    font: inherit;
}


.tool-header {
    position: sticky;
    top: 0;
    z-index: 30;

    background: rgba(255,255,255,.92);

    backdrop-filter: blur(14px);

    border-bottom: 1px solid rgba(22,101,52,.08);
}


.header-inner {
    width: min(1160px, calc(100% - 32px));

    min-height: 70px;

    margin-inline: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;
}


.brand {
    font-size: 13px;
    letter-spacing: .08em;
    font-weight: 900;
    color: var(--green-900);
}


.back-link {
    color: var(--green-800);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}


.language-btn {
    border: 1px solid rgba(22,101,52,.18);

    background: var(--white);
    color: var(--green-800);

    min-height: 40px;

    padding: 0 18px;

    border-radius: 999px;

    font-weight: 800;

    cursor: pointer;
}


main {
    width: min(1160px, calc(100% - 32px));

    margin-inline: auto;
}


.hero {
    text-align: center;

    padding: 68px 0 36px;
}


.eyebrow {
    margin-bottom: 8px;

    color: var(--amber);

    font-size: 13px;
    font-weight: 900;
}


.hero h1 {
    margin: 0;

    color: var(--green-900);

    font-size: clamp(32px, 5vw, 52px);

    line-height: 1.15;

    font-weight: 900;
}


.hero p {
    max-width: 760px;

    margin: 16px auto 0;

    color: var(--muted);

    font-size: 15px;

    line-height: 1.9;
}


.calculator-shell {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 24px;

    align-items: stretch;
}


.calculator-card,
.how-card,
.cta-card {
    background: rgba(255,255,255,.98);

    border: 1px solid var(--border);

    border-radius: 24px;

    box-shadow:
        0 16px 42px rgba(15,60,42,.065),
        0 3px 10px rgba(15,60,42,.03);
}


.calculator-card {
    padding: 28px;
}


.card-heading {
    display: flex;

    gap: 13px;

    align-items: flex-start;

    margin-bottom: 26px;
}


.card-number {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--green-50);

    color: var(--green-700);

    font-size: 12px;
    font-weight: 900;
}


.card-heading h2 {
    margin: 0;

    font-size: 21px;

    color: var(--green-900);
}


.card-heading p {
    margin: 4px 0 0;

    color: var(--muted);

    font-size: 12px;
}


.form-grid {
    display: grid;

    grid-template-columns: repeat(2,minmax(0,1fr));

    gap: 18px;
}


label > span {
    display: block;

    margin-bottom: 7px;

    color: var(--green-900);

    font-size: 13px;
    font-weight: 800;
}


.input-wrap {
    position: relative;
}


input {
    width: 100%;

    height: 52px;

    padding-inline:
        14px
        58px;

    border: 1px solid #d7e2da;

    border-radius: 13px;

    background: #fff;

    color: var(--green-950);

    font-weight: 800;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}


input:focus {
    border-color: rgba(21,128,61,.6);

    box-shadow:
        0 0 0 4px rgba(21,128,61,.09);
}


.unit {
    position: absolute;

    inset-inline-end: 13px;
    top: 50%;

    transform: translateY(-50%);

    color: #89928e;

    font-size: 11px;
    font-weight: 800;
}


.buttons {
    display: grid;

    grid-template-columns:
        minmax(0,1.5fr)
        minmax(0,1fr);

    gap: 10px;

    margin-top: 22px;
}


.primary-btn,
.reset-btn {
    min-height: 46px;

    border-radius: 999px;

    font-weight: 900;

    cursor: pointer;

    transition:
        transform .2s ease,
        background .2s ease,
        border-color .2s ease;
}


.primary-btn {
    border: 1px solid var(--green-700);

    background: var(--green-700);

    color: #fff;
}


.primary-btn:hover {
    background: var(--green-900);

    border-color: var(--green-900);

    transform: translateY(-1px);
}


.reset-btn {
    border: 1px solid rgba(22,101,52,.16);

    background: var(--green-50);

    color: var(--green-800);
}


.reset-btn:hover {
    border-color: rgba(22,101,52,.3);

    transform: translateY(-1px);
}


.results-grid {
    display: grid;

    gap: 11px;
}


.metric {
    min-height: 80px;

    padding: 16px 18px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 18px;

    border: 1px solid rgba(22,101,52,.09);

    border-radius: 15px;

    background: #fff;
}


.metric span {
    color: var(--muted);

    font-size: 13px;
}


.metric strong {
    color: var(--green-900);

    font-size: 19px;

    text-align: end;
}


.metric.highlight {
    background: var(--green-50);

    border-color: rgba(22,101,52,.13);
}


.metric.highlight strong {
    font-size: 25px;
}


.formula {
    margin-top: 17px;

    padding: 13px 15px;

    border-radius: 12px;

    background: #f8faf9;

    color: var(--muted);

    font-size: 12px;
}


.notice {
    margin-top: 16px;

    padding: 16px;

    border-radius: 14px;

    background: #fff9e8;

    border: 1px solid rgba(217,119,6,.12);
}


.notice strong {
    display: block;

    color: #8a5600;

    margin-bottom: 5px;

    font-size: 13px;
}


.notice p {
    margin: 0;

    color: #79643b;

    font-size: 12px;

    line-height: 1.75;
}


.how-card {
    margin-top: 24px;

    padding: 26px 28px;
}


.how-card h2 {
    margin: 0;

    color: var(--green-900);

    font-size: 22px;
}


.method-grid {
    display: grid;

    grid-template-columns: repeat(3,minmax(0,1fr));

    gap: 12px;

    margin-top: 20px;
}


.method-grid > div {
    min-height: 80px;

    display: flex;

    align-items: center;

    gap: 10px;

    border-radius: 14px;

    background: var(--green-50);

    padding: 14px;
}


.method-grid strong {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--green-700);

    color: #fff;

    font-size: 11px;
}


.method-grid span {
    color: var(--green-900);

    font-size: 12px;

    font-weight: 800;
}


.cta-card {
    margin-top: 24px;

    padding: 28px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 24px;
}


.cta-card span {
    color: var(--amber);

    font-size: 12px;

    font-weight: 900;
}


.cta-card h2 {
    margin: 4px 0 4px;

    color: var(--green-900);

    font-size: 22px;
}


.cta-card p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
}


.cta-button {
    flex: 0 0 auto;

    min-height: 46px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 0 25px;

    border-radius: 999px;

    background: var(--green-700);

    color: #fff;

    text-decoration: none;

    font-size: 13px;

    font-weight: 900;
}


footer {
    width: min(1160px, calc(100% - 32px));

    margin-inline: auto;

    padding: 34px 0 50px;

    text-align: center;

    color: #8b938f;

    font-size: 11px;
}


html[dir="ltr"] body {
    font-family:
        "Segoe UI",
        Arial,
        sans-serif;
}


@media (max-width: 820px) {

    .calculator-shell {
        grid-template-columns: 1fr;
    }

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

}


@media (max-width: 600px) {

    .header-inner,
    main,
    footer {
        width: min(100% - 24px, 1160px);
    }

    .header-inner {
        min-height: 64px;

        gap: 8px;
    }

    .brand {
        display: none;
    }

    .hero {
        padding: 44px 0 25px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero p {
        font-size: 13px;
    }

    .calculator-card {
        padding: 20px 16px;

        border-radius: 20px;
    }

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

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

    .metric {
        min-height: 72px;

        padding: 13px;
    }

    .metric strong {
        font-size: 16px;
    }

    .metric.highlight strong {
        font-size: 20px;
    }

    .how-card {
        padding: 21px 16px;

        border-radius: 20px;
    }

    .cta-card {
        padding: 21px 16px;

        border-radius: 20px;

        flex-direction: column;

        align-items: stretch;
    }

    .cta-button {
        width: 100%;
    }

}


/* ========================================================
   HOMEPAGE TYPOGRAPHY + PACKAGING
   ======================================================== */

/*
Uses the same font stack as the main website when its webfont
is available, with safe fallbacks.
*/
body {
    font-family:
        "Tajawal",
        "Cairo",
        Tahoma,
        Arial,
        sans-serif;
}

html[dir="ltr"] body {
    font-family:
        "Inter",
        "Tajawal",
        "Segoe UI",
        Arial,
        sans-serif;
}


.field-label {
    display: block;

    margin-bottom: 7px;

    color: var(--green-900);

    font-size: 13px;
    font-weight: 800;
}


.package-options {
    display: grid;

    grid-template-columns:
        repeat(2,minmax(0,1fr));

    gap: 9px;
}


.package-option {
    min-height: 70px;

    padding: 10px 12px;

    border: 1px solid #d7e2da;

    border-radius: 13px;

    background: #fff;

    color: var(--green-900);

    display: flex;

    align-items: center;

    gap: 10px;

    text-align: start;

    cursor: pointer;

    transition:
        background-color .2s ease,
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}


.package-option:hover {
    border-color: rgba(22,101,52,.32);

    transform: translateY(-1px);
}


.package-option.active {
    background: var(--green-50);

    border-color: var(--green-700);

    box-shadow:
        0 0 0 3px rgba(21,128,61,.07);
}


.package-icon {
    width: 37px;
    height: 37px;

    flex: 0 0 37px;

    border-radius: 10px;

    background: var(--green-50);

    color: var(--green-700);

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 17px;
    font-weight: 900;
}


.package-option.active .package-icon {
    background: #fff;
}


.package-copy {
    min-width: 0;

    display: flex;

    flex-direction: column;

    gap: 2px;
}


.package-copy strong {
    color: var(--green-900);

    font-size: 12px;
    font-weight: 900;
}


.package-copy small {
    color: var(--muted);

    font-size: 10px;

    line-height: 1.35;
}


.jumbo-size-wrap {
    margin-top: 12px;
}


.jumbo-size-wrap[hidden] {
    display: none !important;
}


@media (max-width: 600px) {

    .package-options {
        grid-template-columns: 1fr 1fr;
    }

    .package-option {
        min-height: 66px;

        padding: 9px;
    }

    .package-icon {
        width: 32px;
        height: 32px;

        flex-basis: 32px;
    }

    .package-copy strong {
        font-size: 11px;
    }

    .package-copy small {
        font-size: 9px;
    }

}


/* Standard fixed agricultural values */
.fixed-value-input {
    background: #f0fdf4 !important;
    color: #14532d !important;
    border-color: rgba(22,101,52,.14) !important;
    cursor: default !important;
    font-weight: 900 !important;
}

.fixed-value-input:focus {
    box-shadow: none !important;
    border-color: rgba(22,101,52,.14) !important;
}


/* GG PACKAGING SIDE BY SIDE */

.packaging-field {
    margin-top: 4px;
}

#bagLabel,
.field-label {
    display: block;
    margin-bottom: 10px;
    color: #14532d;
    font-size: 13px;
    font-weight: 900;
}

/* الخياران جنب بعض */
.package-options {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
}

/* الكرت */
.package-option {
    width: 100% !important;
    min-height: 94px !important;
    padding: 12px 12px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(22,101,52,.16) !important;
    background: linear-gradient(180deg, #ffffff 0%, #fbfefc 100%) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: 0 4px 14px rgba(15,60,42,.04) !important;
    transition: .18s ease !important;
}

.package-option:hover {
    border-color: rgba(22,101,52,.28) !important;
    background: #fbfefc !important;
    box-shadow: 0 8px 18px rgba(15,60,42,.06) !important;
}

.package-option.active {
    border-color: #16a34a !important;
    background: linear-gradient(180deg, #f6fff8 0%, #ecfdf3 100%) !important;
    box-shadow: 0 8px 22px rgba(22,101,52,.08) !important;
}

/* الأيقونة */
.package-icon {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
    border-radius: 12px !important;
    background: #eef8f1 !important;
    color: #15803d !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    font-weight: 900 !important;
}

.package-option.active .package-icon {
    background: #dcfce7 !important;
    color: #166534 !important;
}

/* النص */
.package-copy {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 3px !important;
    line-height: 1.25 !important;
}

.package-copy strong {
    margin: 0 !important;
    color: #14532d !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
}

.package-copy small {
    margin: 0 !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    white-space: pre-line !important; /* مهم لعرض 18 لتر ثم 15 كجم */
}

/* محاذاة */
html[dir="rtl"] .package-option {
    flex-direction: row-reverse !important;
    text-align: right !important;
}

html[dir="ltr"] .package-option {
    flex-direction: row !important;
    text-align: left !important;
}

/* موبايل */
@media (max-width: 640px) {
    .package-options {
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
        gap: 10px !important;
    }

    .package-option {
        min-height: 88px !important;
        padding: 10px !important;
        border-radius: 14px !important;
        gap: 8px !important;
    }

    .package-icon {
        width: 36px !important;
        height: 36px !important;
        flex-basis: 36px !important;
        border-radius: 10px !important;
        font-size: 15px !important;
    }

    .package-copy strong {
        font-size: 13px !important;
    }

    .package-copy small {
        font-size: 11px !important;
    }
}

/* /GG PACKAGING SIDE BY SIDE */



/* GG PACKAGE POSITION */

/* البلوك بالكامل */
.packaging-field {
    width: 100% !important;
}

/* العربية: نقله للجانب الأيسر الفارغ */
html[dir="rtl"] .packaging-field #bagLabel {
    width: min(100%, 310px) !important;
    margin-right: auto !important;
    margin-left: 0 !important;
    text-align: right !important;
}

html[dir="rtl"] .packaging-field .package-options {
    width: min(100%, 310px) !important;
    margin-right: auto !important;
    margin-left: 0 !important;
}


/* في حالة أن الحاوية نفسها هي عنصر Grid */
html[dir="rtl"] label:has(#bagLabel),
html[dir="rtl"] div:has(> #bagLabel):has(.package-options) {
    width: 100% !important;
}


/* الإنجليزية: انعكاس طبيعي للتصميم */
html[dir="ltr"] .packaging-field #bagLabel {
    width: min(100%, 310px) !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    text-align: left !important;
}

html[dir="ltr"] .packaging-field .package-options {
    width: min(100%, 310px) !important;
    margin-left: auto !important;
    margin-right: 0 !important;
}


/* الموبايل يرجع للعرض الطبيعي */
@media (max-width: 640px) {

    html[dir="rtl"] .packaging-field #bagLabel,
    html[dir="rtl"] .packaging-field .package-options,
    html[dir="ltr"] .packaging-field #bagLabel,
    html[dir="ltr"] .packaging-field .package-options {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

}

/* /GG PACKAGE POSITION */

