:root {
    --plum: #3D174D;
    --blue: #4C60A8;
    --cyan: #0692CE;
    --pink: #EB428F;
    --yellow: #FFD345;
    --green: #50B763;
    --paper: #f6f4ef;
    --surface: #fffdf8;
    --surface-2: #f8f6f1;
    --surface-3: #f1eee8;
    --text: #25132c;
    --muted: rgba(37, 19, 44, 0.68);
    --line: rgba(61, 23, 77, 0.12);
    --shadow-1: 0 2px 6px rgba(37, 19, 44, 0.08), 0 10px 28px rgba(37, 19, 44, 0.05);
    --shadow-2: 0 12px 32px rgba(37, 19, 44, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Montserrat, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(255, 211, 69, 0.18), transparent 24%),
        radial-gradient(circle at 0% 0%, rgba(80, 183, 99, 0.1), transparent 20%),
        linear-gradient(180deg, #faf8f2 0%, #f4f1ea 100%);
}

.page-shell {
    min-height: 100vh;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 253, 248, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.logo,
.site-nav a {
    color: var(--plum);
    text-decoration: none;
    font-weight: 700;
}

.logo {
    letter-spacing: -0.02em;
}

.site-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.content {
    max-width: 1220px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-1);
    padding: 2rem;
}

.hero {
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -3rem -3rem auto;
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, var(--green), var(--yellow));
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    opacity: 0.9;
}

.narrow {
    max-width: 480px;
    margin: 3rem auto;
}

.medium {
    max-width: 720px;
    margin: 2rem auto;
}

.results-page {
    max-width: 1120px;
    margin: 2rem auto;
}

.stack > * + * {
    margin-top: 1rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.7rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: rgba(61, 23, 77, 0.08);
    color: var(--plum);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.card h1,
.card h2 {
    letter-spacing: -0.03em;
}

.lead {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.btn {
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1.35rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--plum);
    color: white;
    box-shadow: 0 6px 18px rgba(61, 23, 77, 0.22);
}

.btn-secondary {
    background: rgba(61, 23, 77, 0.04);
    color: var(--plum);
    border: 1px solid rgba(61, 23, 77, 0.18);
}

.btn-link {
    background: transparent;
    color: var(--plum);
    padding: 0;
}

label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    border: 1px solid rgba(61, 23, 77, 0.16);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    padding: 0.9rem 0.95rem;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--plum);
    box-shadow: 0 0 0 4px rgba(61, 23, 77, 0.1);
    background: white;
}

form p {
    margin: 0;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-field {
    display: grid;
    gap: 0.45rem;
}

.field-help {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #9b1232;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.choice-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.choice-pill {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(61, 23, 77, 0.14);
    background: var(--surface-2);
}

.choice-pill input {
    width: auto;
    margin: 0;
}

.progress {
    width: 100%;
    height: 12px;
    background: rgba(61, 23, 77, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 0;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--plum), var(--blue) 60%, var(--green));
    transition: width 0.2s ease;
}

.muted {
    color: var(--muted);
}

.question-card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: clamp(1.4rem, 2vw, 1.9rem);
    line-height: 1.3;
}

.assessment-shell {
    position: relative;
    overflow: hidden;
    min-height: 380px;
    background: var(--surface);
}

.assessment-shell::before {
    content: "";
    position: absolute;
    top: -90px;
    right: -80px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 211, 69, 0.35), rgba(255, 211, 69, 0));
    pointer-events: none;
}

.question-card {
    position: relative;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: none;
}

.question-card::after {
    content: "";
    position: absolute;
    left: 1.75rem;
    right: 1.75rem;
    top: 0;
    height: 6px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, var(--plum), var(--green), var(--yellow));
}

.choice-row {
    display: flex;
    gap: 1rem;
}

.choice-row button {
    flex: 1;
    min-height: 58px;
}

.result-badge {
    display: inline-block;
    font-size: 1.6rem;
    font-weight: 800;
    padding: 1rem 1.4rem;
    border-radius: 22px;
    background: var(--plum);
    color: white;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-2);
}

.report-preview {
    margin-top: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.report-preview__header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(61, 23, 77, 0.04), rgba(255, 211, 69, 0.1));
}

.report-preview__header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
}

.report-preview__header p {
    margin: 0;
    color: var(--muted);
}

.report-preview__frame {
    display: block;
    width: 100%;
    min-height: 1480px;
    border: 0;
    background: white;
}

.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 320px 1fr;
}

.teacher-dashboard {
    display: grid;
    gap: 1rem;
}

.teacher-summary {
    display: grid;
    gap: 1.5rem;
}

.teacher-summary h1,
.teacher-results h2 {
    margin-top: 0;
}

.teacher-summary__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem 2rem;
}

.teacher-summary__school,
.teacher-summary__emis {
    margin: 0;
}

.teacher-summary__meta {
    display: flex;
    gap: 1.25rem;
    align-items: baseline;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.teacher-summary__emis {
    color: rgba(37, 19, 44, 0.7);
    font-weight: 600;
}

.teacher-summary__actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.teacher-summary__ops {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    grid-column: 1 / -1;
}

.teacher-summary__codes {
    grid-column: 1 / -1;
}

.teacher-summary__codes h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
}

.teacher-results {
    overflow-x: auto;
}

.section-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.section-toolbar h1,
.section-toolbar h2,
.section-toolbar p {
    margin: 0;
}

.results-filter-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
}

.teacher-results__controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.teacher-results__exports {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.results-filter-form__search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 260px;
}

.results-filter-form input[type="text"] {
    width: 100%;
    min-width: 0;
    padding-right: 2.5rem;
}

.results-filter-form select {
    min-width: 5.75rem;
    width: 5.75rem;
    flex: 0 0 auto;
}

.results-filter-form__clear {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    color: var(--muted);
    text-decoration: none;
    font-size: 1.15rem;
    line-height: 1;
    z-index: 1;
}

.results-filter-form__clear:hover {
    color: var(--plum);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: white;
    border-radius: 18px;
    overflow: hidden;
}

.results-table th,
.results-table td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 0.9rem 0.75rem;
    vertical-align: middle;
}

.results-table thead th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.results-table__sort-link {
    color: inherit;
    text-decoration: none;
}

.results-table__sort-link.is-active {
    color: var(--plum);
}

.results-table tbody tr:hover {
    background: rgba(61, 23, 77, 0.025);
}

.results-table th:nth-child(1),
.results-table td:nth-child(1) {
    width: 28%;
}

.results-table th:nth-child(2),
.results-table td:nth-child(2) {
    width: 16%;
}

.results-table th:nth-child(3),
.results-table td:nth-child(3) {
    width: 18%;
}

.results-table th:nth-child(4),
.results-table td:nth-child(4) {
    width: 16%;
    white-space: nowrap;
}

.results-table th:nth-child(5),
.results-table td:nth-child(5) {
    width: 12%;
    white-space: nowrap;
}

.results-table th:nth-child(6),
.results-table td:nth-child(6) {
    width: 10%;
    white-space: nowrap;
}

.results-table__name,
.results-table__inclination {
    word-break: normal;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.pagination__link {
    color: var(--plum);
    font-weight: 700;
    text-decoration: none;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.pagination__link--disabled {
    color: rgba(37, 19, 44, 0.35);
    background: transparent;
}

.pagination__status {
    color: rgba(37, 19, 44, 0.7);
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.access-code-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.access-code-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1rem;
    margin-bottom: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-2);
}

.access-code-list__meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.access-code-list__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.access-code-list__item--summary {
    margin-bottom: 0;
}

.access-code-panel {
    display: grid;
    gap: 0.65rem;
}

.access-code-panel__summary {
    list-style: none;
    cursor: pointer;
}

.access-code-panel__summary-content {
    display: grid;
    gap: 0.45rem;
}

.access-code-panel__summary .access-code-list {
    pointer-events: none;
}

.access-code-panel__summary .btn,
.access-code-panel__summary .btn-link {
    pointer-events: auto;
}

.access-code-panel__summary::-webkit-details-marker {
    display: none;
}

.access-code-panel__toggle {
    display: inline-block;
    color: var(--plum);
    font-weight: 700;
    white-space: nowrap;
    padding-left: 0.2rem;
}

.access-code-panel[open] .access-code-panel__toggle::after {
    content: "Hide";
}

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

    .teacher-summary__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .teacher-summary__actions {
        justify-content: flex-start;
    }

    .teacher-results__controls {
        width: 100%;
        justify-content: flex-start;
    }

    .teacher-results__exports {
        width: 100%;
    }

    .teacher-results__exports .btn {
        width: 100%;
    }

    .results-filter-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .results-filter-form__search {
        flex: 1 1 100%;
    }

    .results-filter-form input[type="text"] {
        min-width: 0;
        width: 100%;
    }

    .results-filter-form select {
        width: auto;
        min-width: 0;
    }

    .results-table {
        table-layout: auto;
    }

    .results-table th:nth-child(4),
    .results-table td:nth-child(4),
    .results-table th:nth-child(5),
    .results-table td:nth-child(5),
    .results-table th:nth-child(6),
    .results-table td:nth-child(6) {
        white-space: normal;
    }

    .pagination {
        flex-direction: column;
        align-items: flex-start;
    }

    .choice-pills {
        grid-template-columns: 1fr;
    }

    .choice-row {
        flex-direction: column;
    }

    .results-page {
        max-width: none;
        margin: 1rem 0;
    }

    .report-preview__frame {
        min-height: 960px;
    }
}
