* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


:root {
    --bg: #080b14;
    --card: #111827;
    --card-light: #172033;
    --border: rgba(255, 255, 255, 0.09);

    --primary: #6366f1;
    --primary-light: #818cf8;

    --success: #10b981;
    --success-light: #34d399;

    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;

    --danger: #f87171;
    --warning: #fbbf24;
}


html {
    scroll-behavior: smooth;
}


body {

    min-height: 100vh;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);

    background:

        radial-gradient(
            circle at 10% 10%,
            rgba(99, 102, 241, 0.18),
            transparent 28%
        ),

        radial-gradient(
            circle at 90% 85%,
            rgba(139, 92, 246, 0.15),
            transparent 28%
        ),

        var(--bg);

    padding: 40px 20px;
}


button,
input {
    font: inherit;
}


button {
    cursor: pointer;
}


/* APP */

.app {

    width: 100%;

    max-width: 850px;

    margin: auto;
}


/* HEADER */

.header {

    display: flex;

    align-items: center;

    gap: 18px;

    margin-bottom: 28px;
}


.logo {

    width: 62px;

    height: 62px;

    display: flex;

    justify-content: center;

    align-items: center;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            rgba(99, 102, 241, 0.25),
            rgba(139, 92, 246, 0.15)
        );

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

    font-size: 30px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.25);
}


.header h1 {

    font-size: clamp(26px, 5vw, 36px);

    letter-spacing: -1px;

    line-height: 1.15;
}


.header p {

    margin-top: 7px;

    color: var(--muted);

    font-size: 14px;
}


.dot {

    margin: 0 5px;

    color: var(--primary-light);
}


/* CARD */

.card {

    padding: 32px;

    border-radius: 26px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.055),
            rgba(255, 255, 255, 0.025)
        );

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

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.35);

    backdrop-filter: blur(20px);
}


/* STEP */

.step {

    display: grid;

    grid-template-columns: 48px 1fr;

    gap: 20px;

    padding-bottom: 30px;

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

    margin-bottom: 30px;
}


.step-number {

    width: 48px;

    height: 48px;

    display: flex;

    justify-content: center;

    align-items: center;

    border-radius: 14px;

    background: rgba(99, 102, 241, 0.12);

    border: 1px solid rgba(129, 140, 248, 0.2);

    color: var(--primary-light);

    font-weight: 800;

    font-size: 13px;
}


.step-content h2 {

    font-size: 21px;

    margin-bottom: 5px;
}


.step-content > p {

    color: var(--muted);

    font-size: 14px;

    margin-bottom: 20px;
}


/* SUBJECT COUNT */

.subject-count {

    display: flex;

    gap: 12px;
}


.subject-count input {

    flex: 1;

    min-width: 0;

    padding: 15px 17px;

    border-radius: 13px;

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

    outline: none;

    background: rgba(0, 0, 0, 0.22);

    color: white;

    font-size: 16px;

    transition: 0.2s;
}


.subject-count input:focus {

    border-color: var(--primary-light);

    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.10);
}


.subject-count input::placeholder {

    color: #64748b;
}


/* PRIMARY BUTTON */

.primary-btn {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 10px;

    padding: 15px 22px;

    border: none;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #7c3aed
        );

    color: white;

    font-weight: 700;

    transition: 0.2s;

    white-space: nowrap;

    box-shadow:
        0 10px 25px rgba(99, 102, 241, 0.22);
}


.primary-btn:hover {

    transform: translateY(-2px);

    box-shadow:
        0 14px 30px rgba(99, 102, 241, 0.3);
}


.primary-btn:active {

    transform: translateY(0);
}


/* HEADING */

.section-heading {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    margin-bottom: 20px;
}


.counter {

    padding: 7px 11px;

    border-radius: 20px;

    background: rgba(99, 102, 241, 0.10);

    border: 1px solid rgba(99, 102, 241, 0.15);

    color: var(--primary-light);

    font-size: 12px;

    font-weight: 700;

    white-space: nowrap;
}


/* MARK INPUTS */

#marksContainer {

    display: grid;

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

    gap: 13px;

    margin-bottom: 20px;
}


.subject-box {

    padding: 14px;

    border-radius: 15px;

    background: rgba(255, 255, 255, 0.035);

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

    transition: 0.2s;
}


.subject-box:focus-within {

    border-color: rgba(129, 140, 248, 0.45);

    background: rgba(99, 102, 241, 0.05);
}


.subject-top {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 10px;
}


.subject-label {

    color: var(--soft);

    font-size: 13px;

    font-weight: 700;
}


.subject-number {

    color: #64748b;

    font-size: 11px;
}


.mark-input {

    width: 100%;

    padding: 12px;

    border-radius: 10px;

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

    background: rgba(0, 0, 0, 0.2);

    color: white;

    outline: none;

    font-size: 16px;

    transition: 0.2s;
}


.mark-input:focus {

    border-color: var(--primary-light);

    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.08);
}


.mark-input.invalid {

    border-color: var(--danger);

    box-shadow:
        0 0 0 3px rgba(248, 113, 113, 0.08);
}


/* CALCULATE */

.calculate-btn {

    width: 100%;

    padding: 16px;

    border: none;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            var(--success),
            #059669
        );

    color: white;

    font-weight: 800;

    font-size: 15px;

    transition: 0.2s;

    box-shadow:
        0 10px 25px rgba(16, 185, 129, 0.16);
}


.calculate-btn:hover {

    transform: translateY(-2px);

    box-shadow:
        0 15px 30px rgba(16, 185, 129, 0.23);
}


.calculate-btn:active {

    transform: translateY(0);
}


/* MESSAGE */

.message {

    min-height: 0;

    margin: -8px 0 20px;

    color: var(--warning);

    font-size: 13px;

    font-weight: 600;

    text-align: center;
}


/* RESULT */

.result {

    padding: 26px;

    border-radius: 20px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.055),
            rgba(255, 255, 255, 0.025)
        );

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

    animation: resultAppear 0.45s ease;
}


@keyframes resultAppear {

    from {

        opacity: 0;

        transform: translateY(15px) scale(0.98);
    }

    to {

        opacity: 1;

        transform: translateY(0) scale(1);
    }
}


.result-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}


.result-label {

    color: var(--primary-light);

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 1.5px;
}


.result-header h2 {

    margin-top: 4px;

    font-size: 22px;
}


/* GRADE */

.grade-badge {

    width: 64px;

    height: 64px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            #f59e0b,
            #d97706
        );

    color: white;

    font-size: 28px;

    font-weight: 900;

    box-shadow:
        0 10px 30px rgba(245, 158, 11, 0.25);

    flex-shrink: 0;
}


/* STATS */

.stats {

    display: grid;

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

    gap: 12px;

    margin-bottom: 25px;
}


.stat {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 15px;

    border-radius: 14px;

    background: rgba(255, 255, 255, 0.035);

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


.stat-icon {

    font-size: 20px;
}


.stat small {

    display: block;

    color: var(--muted);

    font-size: 11px;

    margin-bottom: 4px;
}


.stat strong {

    font-size: 18px;
}


/* PERFORMANCE */

.performance {

    margin-bottom: 20px;
}


.performance-title {

    display: flex;

    justify-content: space-between;

    color: var(--muted);

    font-size: 12px;

    font-weight: 700;

    margin-bottom: 12px;
}


.performance-row {

    margin-bottom: 12px;
}


.performance-info {

    display: flex;

    justify-content: space-between;

    margin-bottom: 6px;

    font-size: 12px;
}


.performance-info span:first-child {

    color: var(--soft);

    font-weight: 600;
}


.performance-info span:last-child {

    color: white;

    font-weight: 700;
}


.progress-track {

    height: 7px;

    overflow: hidden;

    border-radius: 10px;

    background: rgba(255, 255, 255, 0.07);
}


.progress-bar {

    height: 100%;

    width: 0;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            var(--primary-light)
        );

    animation: progress 0.8s ease forwards;
}


@keyframes progress {

    from {
        width: 0;
    }
}


/* RESULT MESSAGE */

.result-message {

    padding: 13px 15px;

    margin-bottom: 15px;

    border-radius: 12px;

    background: rgba(16, 185, 129, 0.07);

    border: 1px solid rgba(16, 185, 129, 0.13);

    color: var(--success-light);

    font-size: 13px;

    text-align: center;

    font-weight: 600;
}


/* RESET */

.reset-btn {

    width: 100%;

    padding: 13px;

    border-radius: 12px;

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

    background: rgba(255, 255, 255, 0.04);

    color: var(--soft);

    font-weight: 700;

    transition: 0.2s;
}


.reset-btn:hover {

    background: rgba(255, 255, 255, 0.08);

    color: white;

    transform: translateY(-1px);
}


/* HIDDEN */

.hidden {

    display: none !important;
}


/* FOOTER */

footer {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 8px;

    margin-top: 22px;

    color: #64748b;

    font-size: 11px;

    text-align: center;
}


footer strong {

    color: #94a3b8;
}


.footer-dot {

    color: #475569;
}


/* MOBILE */

@media (max-width: 650px) {

    body {

        padding: 22px 14px;
    }


    .header {

        align-items: flex-start;
    }


    .logo {

        width: 52px;

        height: 52px;

        font-size: 25px;

        border-radius: 15px;
    }


    .card {

        padding: 22px;

        border-radius: 21px;
    }


    .step {

        grid-template-columns: 1fr;

        gap: 12px;
    }


    .step-number {

        width: 40px;

        height: 32px;

        border-radius: 10px;
    }


    .subject-count {

        flex-direction: column;
    }


    .primary-btn {

        width: 100%;
    }


    #marksContainer {

        grid-template-columns: 1fr;
    }


    .section-heading {

        align-items: flex-start;

        flex-direction: column;
    }


    .stats {

        grid-template-columns: 1fr;
    }


    .result {

        padding: 20px;
    }


    .result-header h2 {

        font-size: 19px;
    }


    .grade-badge {

        width: 55px;

        height: 55px;

        font-size: 24px;
    }


    footer {

        flex-direction: column;

        gap: 4px;
    }


    .footer-dot {

        display: none;
    }
}