

body.page-tests {
    min-height: 100vh;
    background: var(--soft-white);
    color: var(--jet-black);
}

.archive-main {
    width: min(var(--content-w), calc(100% - var(--page-gutter) * 2));
    margin-inline: auto;
    padding: var(--page-padding) 0 80px;
}

.archive-page-heading {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 48px;
    align-items: end;
    margin-bottom: 44px;
}

.archive-page-heading > div {
    max-width: 760px;
}

.archive-back {
    display: inline-flex;
    width: max-content;
    min-height: 38px;
    align-items: center;
    gap: 9px;
    padding: 7px 2px;
    color: var(--bold-blue);
    font-size: .92rem;
    font-weight: 750;
    text-decoration: none;
    transition: color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.archive-back i {
    font-size: .8rem;
    transition: transform var(--duration-normal) var(--ease-standard);
}

.archive-back:hover {
    color: var(--jet-black);
    transform: translateX(-2px);
}

.archive-back:hover i {
    transform: translateX(-3px);
}

.archive-page-heading h1 {
    margin: 0;
    color: var(--jet-black);
    font-size: clamp(2.35rem, 5vw, 4.5rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.archive-page-heading h1 + p {
    margin: 14px 0 0;
    color: var(--color-muted-foreground);
    font-size: 1.05rem;
}



.archive-catalog-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: clamp(36px, 5vw, 76px);
    align-items: start;
}

.archive-filter-panel {
    min-width: 0;
    position: sticky;
    top: calc(var(--header-height) + 24px);
}

.archive-filter-heading {
    margin-bottom: 18px;
}

.archive-filter-heading h2 {
    margin: 0;
    color: var(--jet-black);
    font-size: 1.8rem;
    line-height: 1.1;
}

.archive-filter-heading p {
    margin: 9px 0 0;
    color: var(--color-muted-foreground);
    font-size: .8rem;
}

.archive-filter-heading strong {
    color: var(--bold-blue);
}

.archive-filters {
    display: grid;
    gap: 7px;
}

.archive-filter {
    position: relative;
    min-height: 44px;
    padding: 10px 12px;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    background: rgba(var(--palette-primary-rgb), .045);
    color: rgba(var(--palette-night-rgb), .76);
    cursor: pointer;
    font-size: .86rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.archive-filter::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 22%, rgba(var(--palette-primary-rgb), .24) 50%, transparent 78%);
    transform: translateX(-120%);
    transition: transform 520ms var(--ease-standard);
}

.archive-filter:hover {
    background: rgba(var(--palette-primary-rgb), .15);
    color: var(--navy);
    transform: translateX(2px);
}

.archive-filter:hover::after {
    transform: translateX(120%);
}

.archive-filter.is-active {
    background: var(--bold-blue);
    color: var(--soft-white);
    box-shadow: 0 10px 24px rgba(var(--palette-primary-rgb), .16);
}

.archive-catalog-content {
    min-width: 0;
}

.archive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 26px;
}

.archive-search {
    position: relative;
    width: min(100%, 560px);
}

.archive-search i {
    position: absolute;
    top: 50%;
    left: 17px;
    z-index: 1;
    color: var(--bold-blue);
    transform: translateY(-50%);
}

.archive-search input,
.archive-sort select {
    height: 48px;
    border: 1px solid rgba(var(--palette-primary-rgb), .13);
    border-radius: 12px;
    background: #fff;
    color: var(--jet-black);
    box-shadow: 0 8px 22px rgba(var(--palette-primary-rgb), .05);
}

.archive-search input {
    width: 100%;
    padding: 0 18px 0 46px;
}

.archive-search input::placeholder {
    color: rgba(var(--palette-night-rgb), .66);
}

.archive-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(var(--palette-night-rgb), .66);
    font-size: .8rem;
    font-weight: 700;
}

.archive-sort select {
    min-width: 210px;
    padding: 0 38px 0 14px;
    cursor: pointer;
}



.archive-tests {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

body.page-tests .test-section,
body.page-tests .test-section-body,
body.page-tests .test-track {
    display: contents;
}

body.page-tests .test-section-head,
body.page-tests .test-section-description {
    display: none;
}

body.page-tests .test-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 410px;
    flex-direction: column;
    padding: 24px;
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    color: var(--jet-black);
    transition: box-shadow var(--duration-normal) var(--ease-standard), transform var(--duration-normal) var(--ease-standard);
}

body.page-tests .test-card:hover {
    box-shadow: 0 26px 54px rgba(var(--palette-primary-rgb), .19);
    transform: translateY(-5px);
}

body.page-tests .test-card-top {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 26px;
    justify-content: flex-end;
    align-items: center;
}

body.page-tests .test-card-icon {
    display: none;
}

body.page-tests .test-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(250, 250, 250, .52);
    color: rgba(var(--palette-night-rgb), .66);
    font-size: .68rem;
    font-weight: 700;
}

body.page-tests .test-card-status.is-done {
    background: var(--bold-blue);
    color: var(--soft-white);
}

body.page-tests .test-card-tags {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 14px;
}

body.page-tests .test-card-tags span {
    padding: 4px 8px;
    border: 1px solid rgba(var(--palette-primary-rgb), .2);
    border-radius: 5px;
    background: rgba(250, 250, 250, .26);
    color: var(--bold-blue);
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.15;
}

body.page-tests .survey-title {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--jet-black);
    font-size: clamp(1.22rem, 2vw, 1.58rem);
    line-height: 1.12;
    letter-spacing: -.035em;
}

body.page-tests .survey-description {
    position: relative;
    z-index: 1;
    flex: 1;
    margin: 18px 0 24px;
    color: rgba(var(--palette-night-rgb), .66);
    font-size: .86rem;
    line-height: 1.5;
}

body.page-tests .test-card-meta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 16px;
    color: rgba(var(--palette-night-rgb), .7);
    font-size: .73rem;
    font-weight: 750;
}

body.page-tests .test-card-meta i {
    margin-right: 4px;
    color: var(--bold-blue);
}

body.page-tests .survey-reward {
    display: none;
}

body.page-tests .test-card-btn {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
    padding: 9px 14px;
    border: 1px solid rgba(250, 250, 250, .72);
    border-radius: 999px;
    background: var(--button-bg);
    color: var(--button-fg);
    box-shadow: none;
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

body.page-tests .test-card-btn i {
    transition: transform var(--duration-normal) var(--ease-standard);
}

body.page-tests .test-card-btn:hover {
    background: var(--bold-blue);
    color: var(--soft-white);
    transform: translateY(-1px);
}

body.page-tests .test-card-btn:hover i {
    transform: translateX(4px);
}

body.page-tests .test-card[hidden],
body.page-tests .test-section[hidden] {
    display: none !important;
}

.archive-empty {
    margin: 24px 0 0;
    padding: 32px;
    border: 1px dashed rgba(var(--palette-primary-rgb), .28);
    border-radius: 14px;
    background: rgba(var(--palette-primary-rgb), .08);
    color: var(--color-muted-foreground);
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    border: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .archive-tests {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .archive-main {
        width: min(calc(100% - var(--page-gutter) * 2), 760px);
        padding-top: 32px;
    }

    .archive-page-heading {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 34px;
    }

    .archive-catalog-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .archive-filter-panel {
        position: static;
    }

    .archive-filter-heading {
        display: flex;
        align-items: end;
        justify-content: space-between;
    }

    .archive-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .archive-filter {
        white-space: normal;
    }

    .archive-filter[data-archive-filter="oto"],
    .archive-grades {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .archive-main {
        width: min(calc(100% - var(--page-gutter) * 2), 560px);
        padding-bottom: 64px;
    }

    .archive-page-heading h1 {
        font-size: clamp(2.2rem, 13vw, 3.35rem);
    }

    .archive-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .archive-search {
        width: 100%;
    }

    .archive-sort {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .archive-sort select {
        width: 100%;
    }

    .archive-tests {
        grid-template-columns: 1fr;
    }

    body.page-tests .test-card {
        min-height: 370px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .archive-back,
    .archive-back i,
    .archive-filter,
    .archive-filter::after,
    body.page-tests .test-card,
    body.page-tests .test-card-btn,
    body.page-tests .test-card-btn i {
        transition: none;
    }
}

/* Классы показываем только внутри архива ОТО. */

.archive-grades {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px 12px;
    padding: 0 0 0 12px;
    border-left: 1px solid var(--border-color, #ccd5ed);
}

.archive-grades[hidden] {
    display: none;
}

.archive-grades button {
    padding: 7px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary, #0f0637);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 220ms ease, color 220ms ease;
}

.archive-grades button[aria-pressed="true"] {
    background: var(--bold-blue, #0c4d83);
    color: #fff;
}
