:root {
    --red: #d71920;
    --red-dark: #9f1018;
    --ink: #17171b;
    --muted: #60636d;
    --line: rgba(23, 23, 27, .1);
    --soft: #f5f6f8;
    --amber: #f3a712;
    --blue: #2268d8;
    --green: #16845b;
    --white: #fff
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    direction: rtl;
    background: #f6f7f9;
    color: var(--ink);
    font-family: "Alexandria", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
select {
    font: inherit
}

.page-wrap {
    width: min(1180px, calc(100% - 34px));
    margin: auto
}

.tool-nav {
    position: sticky;
    top: 12px;
    z-index: 50;
    width: min(1240px, calc(100% - 24px));
    height: 76px;
    margin: 12px auto 0;
    padding: 0 18px;
    border: 1px solid rgba(23, 23, 27, .09);
    border-radius: 23px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 16px 42px rgba(23, 23, 27, .08);
    backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    gap: 22px
}

.tool-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 18px
}

.tool-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain
}

.tool-nav nav {
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 4px
}

.tool-nav nav a {
    padding: 10px 11px;
    border-radius: 11px;
    color: #494b53;
    font-size: 10px;
    font-weight: 700
}

.tool-nav nav a:hover,
.tool-nav nav a.active {
    background: #fff0f0;
    color: var(--red-dark)
}

.nav-home {
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--ink);
    color: #fff;
    font-size: 10px;
    font-weight: 800
}

.tool-hero {
    position: relative;
    min-height: 560px;
    padding: 95px 0 70px;
    overflow: hidden
}

.tool-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 15%, rgba(215, 25, 32, .13), transparent 28%), radial-gradient(circle at 10% 80%, rgba(34, 104, 216, .08), transparent 25%);
    pointer-events: none
}

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 45px;
    align-items: center
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--red);
    font-size: 11px;
    font-weight: 900
}

.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 6px rgba(215, 25, 32, .09)
}

h1 {
    max-width: 760px;
    margin: 0 0 18px;
    font-size: clamp(44px, 6vw, 82px);
    line-height: 1.12;
    letter-spacing: -.055em
}

h1 em {
    color: var(--red);
    font-style: normal
}

.hero-copy>p {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 2
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px
}

.primary,
.secondary {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900
}

.primary {
    background: var(--red);
    color: #fff;
    box-shadow: 0 14px 30px rgba(215, 25, 32, .2)
}

.secondary {
    border: 1px solid var(--line);
    background: #fff
}

.hero-visual {
    position: relative;
    min-height: 390px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(23, 23, 27, .11);
    overflow: hidden;
    padding: 28px
}

.hero-visual::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    left: -90px;
    bottom: -100px;
    border-radius: 50%;
    background: rgba(215, 25, 32, .09)
}

.metric {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 15px;
    align-items: center;
    padding: 17px 0;
    border-bottom: 1px solid var(--line)
}

.metric:last-child {
    border: 0
}

.metric b {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    background: #18181c;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 15px
}

.metric span {
    display: block;
    font-size: 12px;
    font-weight: 800
}

.metric small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.7
}

.section {
    padding: 85px 0
}

.section.white {
    background: #fff
}

.section.dark {
    background: #161619;
    color: #fff
}

.section-head {
    max-width: 800px;
    margin-bottom: 32px
}

.section-head span {
    color: var(--red);
    font-size: 10px;
    font-weight: 900
}

.section-head h2 {
    margin: 9px 0 12px;
    font-size: clamp(31px, 4vw, 52px);
    line-height: 1.22;
    letter-spacing: -.04em
}

.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.95
}

.dark .section-head p {
    color: #b7b8bf
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px
}

.info-card {
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff
}

.dark .info-card {
    border-color: rgba(255, 255, 255, .1);
    background: #202024
}

.info-card b {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 22px;
    border-radius: 13px;
    background: #fff0f0;
    color: var(--red);
    font-size: 13px
}

.info-card h3 {
    margin: 0 0 9px;
    font-size: 17px;
    line-height: 1.5
}

.info-card p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.9
}

.dark .info-card p {
    color: #b3b4bb
}

.steps {
    display: grid;
    gap: 10px
}

.step {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 20px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: #fff
}

.step>strong {
    font-size: 28px;
    color: var(--red)
}

.step h3 {
    margin: 0 0 7px;
    font-size: 17px
}

.step p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.9
}

.notice {
    padding: 20px;
    border: 1px solid rgba(243, 167, 18, .35);
    border-radius: 18px;
    background: #fff7e3;
    color: #624300;
    font-size: 10px;
    line-height: 1.9
}

.source-list {
    display: grid;
    gap: 10px
}

.source-list a {
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: #363840;
    font-size: 10px;
    font-weight: 800
}

.tool-footer {
    padding: 34px 0;
    border-top: 1px solid var(--line);
    background: #fff
}

.tool-footer .page-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: #686a72;
    font-size: 9px
}

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .65s ease, transform .65s cubic-bezier(.2, .8, .2, 1)
}

.reveal.in {
    opacity: 1;
    transform: none
}

/* Calculator */
.calculator-shell {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
    align-items: start
}

.calc-panel,
.calc-result {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(23, 23, 27, .06)
}

.calc-panel {
    padding: 26px
}

.calc-result {
    position: sticky;
    top: 105px;
    padding: 26px
}

.calc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 22px
}

.calc-tab {
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    padding: 10px 12px;
    color: #555861;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer
}

.calc-tab.active {
    background: var(--ink);
    color: #fff
}

.calc-pane {
    display: none
}

.calc-pane.active {
    display: block
}

.calc-pane h3 {
    margin: 0 0 8px;
    font-size: 20px
}

.calc-pane>p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.8
}

.unit-list {
    display: grid;
    gap: 9px
}

.unit-row {
    display: grid;
    grid-template-columns: 1.3fr .8fr .65fr 42px;
    gap: 8px
}

.field {
    display: grid;
    gap: 6px
}

.field label {
    font-size: 9px;
    font-weight: 800;
    color: #555861
}

.field input,
.field select {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafafa;
    color: #202024;
    padding: 0 11px;
    outline: 0
}

.field input:focus,
.field select:focus {
    border-color: rgba(215, 25, 32, .5);
    box-shadow: 0 0 0 4px rgba(215, 25, 32, .07)
}

.remove-unit {
    align-self: end;
    width: 42px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: #fff0f0;
    color: var(--red);
    cursor: pointer
}

.add-unit {
    margin-top: 11px;
    border: 1px dashed rgba(215, 25, 32, .4);
    border-radius: 12px;
    background: #fffafa;
    color: var(--red);
    padding: 12px;
    font-weight: 900;
    font-size: 10px;
    cursor: pointer
}

.ministerial-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.result-ring {
    width: 190px;
    height: 190px;
    margin: 8px auto 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--red) var(--score, 0%), #ededf0 0);
    position: relative
}

.result-ring::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: #fff
}

.result-ring div {
    position: relative;
    text-align: center
}

.result-ring strong {
    display: block;
    font-size: 40px
}

.result-ring small {
    color: var(--muted);
    font-size: 9px
}

.breakdown {
    display: grid;
    gap: 8px
}

.breakdown div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 12px;
    border-radius: 12px;
    background: #f6f7f9;
    font-size: 9px
}

.breakdown b {
    font-size: 11px
}

.calc-error {
    min-height: 22px;
    margin-top: 12px;
    color: var(--red);
    font-size: 9px
}

.grade-label {
    margin-top: 18px;
    padding: 14px;
    border-radius: 14px;
    background: #18181c;
    color: #fff;
    text-align: center;
    font-size: 12px;
    font-weight: 900
}

/* Subjects */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px
}

.subject-card {
    padding: 27px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff
}

.subject-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px
}

.subject-card h3 {
    margin: 0;
    font-size: 21px
}

.subject-mark {
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff1f1;
    color: var(--red);
    font-size: 10px;
    font-weight: 900
}

.subject-card p {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.9
}

.subject-card ul {
    padding: 0;
    margin: 15px 0 0;
    list-style: none;
    display: grid;
    gap: 8px
}

.subject-card li {
    font-size: 10px;
    padding-right: 17px;
    position: relative
}

.subject-card li::before {
    content: "";
    position: absolute;
    right: 0;
    top: .7em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red)
}

@media(max-width:900px) {
    .tool-nav nav {
        display: none
    }

    .hero-grid,
    .calculator-shell {
        grid-template-columns: 1fr
    }

    .hero-visual {
        min-height: auto
    }

    .calc-result {
        position: static
    }

    .info-grid {
        grid-template-columns: 1fr 1fr
    }

    .unit-row {
        grid-template-columns: 1fr 1fr
    }

    .remove-unit {
        align-self: auto
    }

    .subject-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:580px) {
    .tool-nav {
        height: 66px
    }

    .tool-logo span {
        display: none
    }

    .tool-hero {
        padding-top: 65px;
        min-height: auto
    }

    h1 {
        font-size: clamp(38px, 13vw, 58px)
    }

    .hero-copy>p {
        font-size: 12px
    }

    .hero-visual {
        padding: 20px;
        border-radius: 24px
    }

    .section {
        padding: 65px 0
    }

    .info-grid,
    .ministerial-grid {
        grid-template-columns: 1fr
    }

    .unit-row {
        grid-template-columns: 1fr
    }

    .remove-unit {
        width: 100%
    }

    .step {
        grid-template-columns: 45px 1fr
    }

    .tool-footer .page-wrap {
        align-items: flex-start;
        flex-direction: column
    }

    .page-wrap {
        width: min(100% - 24px, 1180px)
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none
    }
}