:root {
    --ink: #18211f;
    --muted: #64706c;
    --paper: #f6f8f5;
    --card: #fff;
    --nav: #132522;
    --accent: #ffcc67;
    --accent2: #45a88d;
    --line: #dce4df;
    --danger: #c34f4f;
    --shadow: 0 10px 30px rgba(24, 33, 31, .07)
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper)
}

button,
input {
    font: inherit
}

button {
    cursor: pointer
}

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px 1fr
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--nav);
    color: #fff;
    padding: 32px 22px;
    display: flex;
    flex-direction: column
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    font-weight: 800;
    font-size: 1.22rem;
    letter-spacing: -.02em
}

.mark {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--accent);
    color: var(--nav);
    box-shadow: 0 7px 18px rgba(0, 0, 0, .2)
}

.eyebrow {
    margin: 43px 10px 12px;
    color: #8fa7a0;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .72rem;
    font-weight: 800
}

.subjects {
    display: grid;
    gap: 8px
}

.subject {
    border: 0;
    border-radius: 12px;
    color: #c7d4d0;
    background: transparent;
    padding: 12px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700
}

.subject:hover,
.subject:focus-visible {
    background: #203b36;
    color: #fff
}

.subject.active {
    background: #fff;
    color: var(--nav);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18)
}

.subject-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #294a43;
    display: grid;
    place-items: center;
    font-size: .8rem
}

.subject.active .subject-icon {
    background: var(--accent)
}

.subject.locked {
    opacity: .45;
    pointer-events: none
}

.side-foot {
    margin-top: auto;
    border-top: 1px solid #29443e;
    padding: 20px 10px 0;
    color: #9fb3ad;
    font-size: .82rem
}

.side-foot strong {
    color: #fff;
    display: block;
    margin-bottom: 2px
}

.main {
    min-width: 0
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 27px clamp(24px, 4vw, 58px) 0;
    position: sticky;
    top: 0;
    z-index: 5
}

.title-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px
}

.kicker {
    font-size: .78rem;
    color: var(--accent2);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin: 0 0 3px
}

.title {
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.15;
    letter-spacing: -.035em;
    margin: 0
}

.progress-copy {
    text-align: right;
    color: var(--muted);
    font-size: .82rem;
    white-space: nowrap
}

.progress-copy strong {
    display: block;
    color: var(--ink);
    font-size: 1rem
}

.tools {
    display: flex;
    gap: 8px;
    overflow: auto;
    padding: 22px 0 17px;
    scrollbar-width: none
}

.tool {
    white-space: nowrap;
    border: 1px solid var(--line);
    background: #fff;
    color: #34413e;
    padding: 9px 13px;
    border-radius: 10px;
    font-weight: 750;
    font-size: .86rem
}

.tool:hover,
.tool:focus-visible {
    border-color: #8dbbad;
    background: #f2faf7
}

.content {
    max-width: 1120px;
    margin: auto;
    padding: 30px clamp(20px, 4vw, 58px) 80px
}

.quiz-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #e7f4ef;
    color: #28755f;
    font-weight: 800;
    font-size: .78rem;
    padding: 7px 10px;
    border-radius: 999px
}

.time {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    font-size: .9rem
}

.progress-track {
    height: 5px;
    background: #e5ebe7;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 18px
}

.progress-bar {
    height: 100%;
    width: 4%;
    background: var(--accent2);
    transition: width .25s ease
}

.section-heading {
    margin: 44px 0 18px;
    padding-top: 4px
}

.section-heading:first-child {
    margin-top: 0
}

.section-heading h2 {
    font-size: 1.25rem;
    letter-spacing: -.02em;
    margin: 0 0 4px
}

.section-heading p {
    color: var(--muted);
    margin: 0;
    font-size: .92rem
}

.questions {
    display: grid;
    gap: 20px
}

.question {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: clamp(20px, 3vw, 30px);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(230px, .6fr);
    gap: 30px;
    scroll-margin-top: 165px
}

.question--single {
    grid-template-columns: 1fr
}

.q-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em
}

.q-num {
    background: var(--nav);
    color: #fff;
    width: 29px;
    height: 29px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: .82rem
}

.q-text {
    font-size: 1.08rem;
    font-weight: 760;
    line-height: 1.5;
    margin: 16px 0 19px;
    letter-spacing: -.01em
}

.answers {
    display: grid;
    gap: 9px
}

.answer {
    position: relative
}

.answer input {
    position: absolute;
    opacity: 0;
    pointer-events: none
}

.answer label {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: #43504c;
    transition: .15s
}

.answer label:hover {
    border-color: #9cbcb2;
    background: #f9fcfb
}

.letter {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    border: 1px solid #cad6d0;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 850;
    font-size: .78rem
}

.answer input:checked+label {
    border-color: var(--accent2);
    background: #edf8f4;
    color: #155846;
    box-shadow: 0 0 0 2px rgba(69, 168, 141, .12)
}

.answer input:checked+label .letter {
    background: var(--accent2);
    border-color: var(--accent2);
    color: #fff
}

.other-reveal {
    margin-top: 10px;
    display: none
}

.other-reveal.show {
    display: block
}

.other-reveal input[type="text"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 11px 13px;
    color: var(--ink)
}

.other-reveal input[type="text"]:focus {
    outline: 2px solid var(--accent2);
    outline-offset: 1px
}

/* ---- Likert scale ---- */

.likert-wrap {
    margin-top: 4px
}

.likert {
    display: flex;
    gap: 8px
}

.likert-option {
    flex: 1;
    position: relative;
    text-align: center
}

.likert-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none
}

.likert-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: .15s
}

.likert-option label:hover {
    border-color: #9cbcb2;
    background: #f9fcfb
}

.likert-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #cad6d0;
    background: #fff
}

.likert-option input:checked+label {
    border-color: var(--accent2);
    background: #edf8f4;
    box-shadow: 0 0 0 2px rgba(69, 168, 141, .12)
}

.likert-option input:checked+label .likert-dot {
    background: var(--accent2);
    border-color: var(--accent2)
}

.likert-labels {
    display: flex;
    gap: 8px;
    margin-top: 9px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em
}

.likert-labels span {
    flex: 1;
    text-align: center;
    line-height: 1.3
}

.submit-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 24px;
    background: var(--nav);
    color: #fff;
    border-radius: 17px;
    padding: 20px 24px
}

.submit-copy strong {
    display: block
}

.submit-copy span {
    color: #a9bbb6;
    font-size: .84rem
}

.submit {
    border: 0;
    background: var(--accent);
    color: var(--nav);
    font-weight: 850;
    border-radius: 11px;
    padding: 12px 20px
}

.submit:hover {
    filter: brightness(1.05);
    transform: translateY(-1px)
}

.submit:disabled {
    opacity: .5;
    cursor: not-allowed
}

.resource {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(390px, 92vw);
    background: #fff;
    z-index: 15;
    box-shadow: -20px 0 50px rgba(0, 0, 0, .18);
    padding: 28px;
    transform: translateX(110%);
    transition: .25s
}

.resource.open {
    transform: none
}

.resource h2 {
    margin: 0 0 5px
}

.resource p {
    color: var(--muted)
}

.resource-close {
    float: right;
    border: 0;
    background: #edf1ef;
    border-radius: 8px;
    padding: 6px 10px
}

/* ---- Results screen ---- */

.results {
    display: none
}

.results.show {
    display: block
}

.result-hero {
    background: var(--nav);
    color: #fff;
    border-radius: 20px;
    padding: clamp(26px, 4vw, 42px);
    box-shadow: var(--shadow);
    margin-bottom: 20px
}

.result-kicker {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .76rem;
    font-weight: 800;
    margin: 0 0 8px
}

.result-hero h2 {
    margin: 0 0 12px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -.02em
}

.result-hero p {
    color: #c7d4d0;
    margin: 0;
    max-width: 640px;
    line-height: 1.6
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px
}

.insight-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: var(--shadow)
}

.insight-card .q-label {
    margin-bottom: 10px
}

.insight-card p {
    margin: 0;
    color: #43504c;
    line-height: 1.55
}

.tutor-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px
}

.tutor-avatar {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 50%;
    background: var(--nav);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-weight: 800
}

.tutor-info strong {
    display: block;
    font-size: 1.02rem
}

.tutor-info span {
    color: var(--muted);
    font-size: .88rem
}

.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.retake {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-weight: 750;
    border-radius: 11px;
    padding: 12px 20px
}

.retake:hover {
    border-color: #9cbcb2;
    background: #f9fcfb
}

@media(max-width:820px) {
    .app {
        grid-template-columns: 1fr
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 17px 18px;
        display: block
    }

    .brand {
        margin-bottom: 14px
    }

    .eyebrow,
    .side-foot {
        display: none
    }

    .subjects {
        display: flex;
        overflow: auto
    }

    .subject {
        min-width: max-content;
        padding: 9px 11px
    }

    .topbar {
        top: 0;
        padding: 18px 20px 0
    }

    .question {
        grid-template-columns: 1fr
    }

    .content {
        padding-top: 22px
    }

    .progress-copy span {
        display: none
    }

    .insight-grid {
        grid-template-columns: 1fr
    }

    .likert-labels {
        font-size: .6rem
    }
}

@media(max-width:520px) {
    .title-row {
        align-items: end
    }

    .title {
        font-size: 1.35rem
    }

    .kicker {
        font-size: .68rem
    }

    .question {
        padding: 18px;
        gap: 18px
    }

    .submit-wrap {
        align-items: stretch;
        flex-direction: column
    }

    .submit {
        width: 100%
    }

    .likert-option label {
        padding: 10px 4px
    }
}
