/* EQ quiz — mirrors disc glass/gold language */
@font-face {
    font-family: 'Yekan';
    src: url('/fonts/Yekan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Yekan';
    src: url('/fonts/Yekan.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}
.quiz-intro { text-align: center; margin-bottom: 20px; }
.quiz-intro p { color: var(--text-muted); line-height: 1.9; max-width: 36rem; margin: 0 auto 18px; }
.eq-limit-hint { color: var(--text-secondary); font-size: .92rem; margin-bottom: 12px !important; }
.eq-container[hidden] { display: none !important; }
.quiz-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; color: var(--text-secondary); font-family: 'Kalameh', sans-serif;
}
.quiz-page-counter {
    font-family: 'Yekan', monospace; font-size: 1.4rem; color: var(--primary-color); font-weight: 700;
}
.badge {
    display: inline-block; background: rgba(218,178,93,.2); color: var(--primary-color);
    border-radius: 999px; padding: 4px 12px; font-size: .85rem; margin-bottom: 12px;
    font-family: 'Yekan', monospace;
}
.eq-question-text {
    color: var(--text-heading);
    font-family: 'Kalameh', sans-serif;
    font-size: clamp(1.05rem, 2.2vw, 1.22rem);
    font-weight: 600;
    line-height: 1.95;
    margin: 8px 0 22px;
}
.eq-scale {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
}
.eq-scale-btn {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 8px; border-radius: 14px; cursor: pointer; min-height: 48px;
    background: rgba(255,255,255,.04); border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-family: 'Kalameh', sans-serif;
    transition: border-color .22s ease, background .22s ease, transform .22s cubic-bezier(.22,1,.36,1), box-shadow .22s ease;
}
.eq-scale-btn:hover { border-color: rgba(218,178,93,.55); transform: translateY(-1px); }
.eq-scale-btn:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(218,178,93,.2);
}
.eq-scale-btn.selected {
    border-color: var(--primary-color);
    background: rgba(218,178,93,.18);
    box-shadow: 0 0 0 3px rgba(218,178,93,.14);
}
.eq-scale-num {
    font-family: 'Yekan', 'Kalameh', monospace; font-size: 1.35rem; font-weight: 700; color: var(--primary-color);
}
.eq-scale-label {
    font-family: 'Kalameh', sans-serif;
    font-size: .8rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.45;
    color: var(--text-muted);
}
.quiz-nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.quiz-error {
    display: none; margin-top: 14px; padding: 12px 14px; border-radius: 12px;
    background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: var(--text-primary);
}
.quiz-error.show { display: block; }

.result-hero { text-align: center; margin-bottom: 22px; }
.result-badge {
    display: inline-block; background: rgba(218,178,93,.22); color: var(--primary-color);
    border-radius: 999px; padding: 6px 14px; font-weight: 700; margin-bottom: 10px;
}
.result-pattern-row { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; margin: 18px 0; }
.result-pattern-card, .result-numeric-card { padding: 18px; text-align: center; }
.result-pattern-card h3, .result-numeric-card h3 { color: var(--text-muted); font-size: .95rem; margin-bottom: 8px; }
.result-pattern-display { color: var(--text-heading); font-size: 1.25rem; font-weight: 700; }
.numeric-code-display { color: var(--primary-color); font-size: 2rem; font-family: 'Yekan', monospace; }
.radar-wrap { position: relative; height: min(340px, 90vw); margin: 10px 0 28px; overflow: visible; }
.eq-domain-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.eq-domain-card { padding: 16px 18px; }
.eq-domain-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.eq-domain-head h3 { margin: 0; color: var(--text-heading); font-size: 1.05rem; }
.eq-bar { height: 8px; border-radius: 999px; background: rgba(128,128,128,.2); overflow: hidden; margin-bottom: 12px; }
.eq-bar span { display: block; height: 100%; border-radius: 999px; }
.eq-domain-card ul, .code-profile-card ul { margin: 0; padding-inline-start: 1.1rem; }
.eq-domain-card li, .code-profile-card li { color: var(--text-primary); line-height: 1.85; margin-bottom: 4px; }
.code-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.code-profile-card { padding: 18px; }
.code-profile-card h3 { color: var(--primary-color); margin: 0 0 12px; font-size: 1.05rem; }
.demo-banner {
    background: rgba(218,178,93,.15); border: 1px solid rgba(218,178,93,.35);
    border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; color: var(--text-primary);
}

.tests-header { margin-top: var(--space-2, 8px); }
.tests-header .page-lead + .page-lead,
.tests-header .aeo-answer {
    margin-top: -12px;
    margin-bottom: 22px;
}
.tests-edu-link {
    color: var(--primary-color, #dab25d);
    font-weight: 600;
    text-decoration: none;
}
.tests-edu-link:hover {
    color: var(--primary-hover, #c49d4a);
    text-decoration: underline;
}

.tests-cat-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0 auto 1.5rem;
    max-width: 920px;
    width: 100%;
    min-width: 0;
    padding: 0 12px;
    box-sizing: border-box;
}
.tests-cat-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(218, 178, 93, .35);
    background: rgba(218, 178, 93, .08);
    color: var(--text-primary, #1a1a1a);
    font-size: .9rem;
    text-decoration: none;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: center;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.tests-cat-chip:hover {
    border-color: rgba(218, 178, 93, .65);
    background: rgba(218, 178, 93, .16);
}
.tests-cat-chip.is-active {
    background: rgba(218, 178, 93, .28);
    border-color: rgba(218, 178, 93, .8);
    font-weight: 600;
}
[data-theme="dark"] .tests-cat-chip {
    color: var(--text-primary, #f5f5f5);
    background: rgba(218, 178, 93, .12);
}
.tests-cat-section {
    margin-bottom: 2rem;
}
.tests-cat-section__head {
    text-align: center;
}
.tests-cat-section__head .page-lead,
.tests-cat-section__head .aeo-lead {
    text-align: center;
}
.tests-cat-heading {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 1rem;
    text-align: center;
    color: var(--text-primary, #1a1a1a);
}

.tests-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 16px;
    max-width: 920px;
    margin: 0 auto 2rem;
    padding: 0 12px;
    width: 100%;
    min-width: 0;
}
.tests-cat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 18px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    transition: transform .2s ease, border-color .2s ease;
}
.tests-cat-card:hover {
    transform: translateY(-2px);
}
.tests-cat-card__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color, #dab25d);
}
.tests-cat-card__meta {
    margin: 0;
    font-size: .9rem;
    color: var(--text-secondary, #666);
}
.tests-cat-card__cta {
    margin-top: auto;
    padding-top: 10px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--primary-color, #dab25d);
}
.tests-breadcrumb {
    text-align: center;
    margin: 0 0 8px;
    font-size: .9rem;
    color: var(--text-secondary, #666);
    overflow-wrap: anywhere;
    max-width: 100%;
}
.tests-breadcrumb a {
    color: var(--primary-color, #dab25d);
    text-decoration: none;
}
.tests-breadcrumb a:hover {
    text-decoration: underline;
}

.site-link-list {
    list-style: none;
    margin: 0 auto 2rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 640px;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 18px;
    margin-bottom: 40px;
    width: 100%;
    min-width: 0;
}
.tests-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(218, 178, 93, 0.16);
    border-top: 3px solid var(--test-accent, var(--primary-color, #dab25d));
    transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease, border-color .3s ease;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.tests-card--active { cursor: pointer; }
.tests-card--active:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .22), 0 0 0 1px rgba(218, 178, 93, 0.12);
    border-color: var(--test-accent, var(--primary-color));
}
.tests-card--soon { cursor: not-allowed; }
.tests-card__image {
    display: block;
    width: 100%;
    height: 140px;
    box-sizing: border-box;
    object-fit: contain;
    object-position: center;
    padding: 6px 8px;
    border-radius: 12px;
    margin-bottom: 12px;
    background: transparent;
    mix-blend-mode: multiply;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    transition: transform .3s ease, box-shadow .3s ease;
}
.tests-card--active:hover .tests-card__image {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
[data-theme="dark"] .tests-card__image {
    mix-blend-mode: screen;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}

[data-theme="light"] .tests-card {
    background: rgba(250, 244, 232, 0.90);
    border-color: rgba(160, 120, 42, 0.32);
}

[data-theme="light"] .tests-card--active:hover {
    box-shadow: 0 12px 28px rgba(55, 38, 12, 0.10), 0 0 0 1px rgba(201, 162, 55, 0.16);
}

[data-theme="light"] .tests-card__image {
    box-shadow: 0 6px 16px rgba(55, 38, 12, 0.10);
}

[data-theme="light"] .tests-card--active:hover .tests-card__image {
    box-shadow: 0 8px 20px rgba(55, 38, 12, 0.12);
}

[data-theme="light"] .eq-scale-btn {
    background: #faf4e8;
    border-color: rgba(160, 120, 42, 0.36);
}

[data-theme="light"] .tests-cat-card {
    background: rgba(250, 244, 232, 0.90);
    border: 1px solid rgba(160, 120, 42, 0.32);
}
.tests-card__title {
    margin: 0 0 8px;
    color: var(--text-heading);
    font-size: 1.1rem;
    font-weight: 700;
}
.tests-card__access {
    display: inline-flex;
    align-items: center;
    margin: 0 0 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color, #dab25d);
    background: rgba(218, 178, 93, 0.16);
    border: 1px solid rgba(218, 178, 93, 0.4);
    max-width: 100%;
    overflow-wrap: anywhere;
}
.tests-card__desc {
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 12px;
    font-size: .85rem;
    min-height: 0;
}
.tests-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: .75rem;
    margin-bottom: 12px;
}
.tests-card__btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    justify-content: center;
    padding-inline: 10px;
    font-size: .82rem;
    white-space: nowrap;
}
.tests-card__footer {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: stretch;
    margin-top: 14px;
    position: relative;
    z-index: 3;
}
.tests-card__footer .tests-card__edu {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    padding: 0 8px;
    font-size: .78rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tests-card__footer .comments-trigger {
    flex: 0 0 40px;
    --ct-size: 40px;
    width: 40px;
    min-width: 40px;
    height: 40px;
    align-self: center;
}
.tests-card__footer .tests-soon {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
}
.tests-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
}
.tests-card--soon .tests-card__title,
.tests-card--soon .tests-card__desc,
.tests-card--soon .tests-meta,
.tests-card--soon .tests-soon {
    filter: blur(3px);
}
.tests-card--soon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: inherit;
    z-index: 1;
    pointer-events: none;
}
.tests-card--soon .tests-card__image {
    filter: none;
    position: relative;
    z-index: 0;
}
.tests-card__overlay {
    position: absolute;
    left: 50%;
    bottom: 58px;
    transform: translateX(-50%);
    z-index: 2;
    text-align: center;
    pointer-events: none;
}
.tests-card__soon-label {
    display: inline-block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading, #fff);
    text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

@media (min-width: 1024px) {
    .tests-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}
@media (min-width: 1440px) {
    .tests-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
}
@media (max-width: 1023px) {
    .tests-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .eq-scale { grid-template-columns: 1fr; }
    .eq-scale-btn { flex-direction: row; justify-content: flex-start; gap: 14px; }
    .result-pattern-row, .eq-domain-grid, .code-profile-grid { grid-template-columns: 1fr; }
    .tests-grid { grid-template-columns: 1fr; gap: 14px; }
    .tests-cat-filters {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        padding: 0 4px 4px;
        margin-inline: -4px;
        mask-image: linear-gradient(to left, transparent, #000 10px, #000 calc(100% - 10px), transparent);
        -webkit-mask-image: linear-gradient(to left, transparent, #000 10px, #000 calc(100% - 10px), transparent);
    }
    .tests-cat-filters::-webkit-scrollbar { display: none; }
    .tests-cat-chip {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
    .tests-card { padding: 15px; }
    .tests-card__image { height: 120px; }
    .tests-card__footer {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
    }
    .tests-card__btn,
    .tests-card__edu,
    .tests-soon {
        width: auto;
        justify-content: center;
    }
}
@media (max-width: 375px) {
    .tests-card { padding: 12px; }
    .tests-card__title { font-size: 1.05rem; }
    .tests-card__btn,
    .tests-card__edu {
        font-size: .72rem;
        padding-inline: 6px;
    }
    .tests-card__footer {
        gap: 5px;
    }
    .tests-card__footer .comments-trigger {
        flex: 0 0 36px;
        --ct-size: 36px;
        width: 36px;
        min-width: 36px;
        height: 36px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .tests-card,
    .tests-card__image,
    .eq-scale-btn,
    .tests-card--active:hover,
    .tests-card--active:hover .tests-card__image,
    .eq-scale-btn:hover {
        transition: none !important;
        transform: none !important;
    }
}
