/* ========================= */
/* RESET */
/* ========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", sans-serif;
    background: #F8FAFC;
    color: #111827;
    line-height: 1.6;
}

/* ========================= */
/* CONTAINER */
/* ========================= */

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

:root {
    --page-background: #f5f7fb;
    --card-background: #ffffff;
    --text-color: #111827;
    --muted-text: #6b7280;
    --border-color: #d1d5db;
}

html[data-theme="dark"] {
    --page-background: #0f172a;
    --card-background: #1e293b;
    --text-color: #f8fafc;
    --muted-text: #cbd5e1;
    --border-color: #475569;
}

body {
    color: var(--text-color);
    background: var(--page-background);
}

html[data-theme="dark"] .test-header,
html[data-theme="dark"] .test-footer,
html[data-theme="dark"] .passage-panel,
html[data-theme="dark"] .question-panel,
html[data-theme="dark"] .navigator-panel,
html[data-theme="dark"] .instructions-card,
html[data-theme="dark"] .break-card {
    color: var(--text-color);
    border-color: var(--border-color);
    background: var(--card-background);
}

html[data-theme="dark"] #theme-toggle,
html[data-theme="dark"] #save-exit-btn {
    color: #f8fafc;
    border-color: #475569;
    background: #334155;
}

html[data-theme="dark"] #theme-toggle:hover,
html[data-theme="dark"] #save-exit-btn:hover {
    background: #475569;
}

html[data-theme="dark"] #reset-btn {
    color: #fecaca;
    border-color: #991b1b;
    background: #450a0a;
}

html[data-theme="dark"] #reset-btn:hover {
    color: #ffffff;
    background: #b91c1c;
}

html[data-theme="dark"] #module-progress {
    color: #cbd5e1;
}

html[data-theme="dark"] .test-card {
    color: #f8fafc;
    background: #1e293b;
    border-color: #475569;
}

html[data-theme="dark"] .test-card h2,
html[data-theme="dark"] .test-card strong {
    color: #f8fafc;
}

html[data-theme="dark"] .test-meta,
html[data-theme="dark"] .saved-module {
    color: #cbd5e1;
}

html[data-theme="dark"] .progress-badge {
    color: #bfdbfe;
    background: #1e3a8a;
}



/* ========================= */
/* HEADER */
/* ========================= */

.header {
    position: sticky;
    top: 0;

    background: rgba(255, 255, 255, .85);

    backdrop-filter: blur(12px);

    border-bottom: 1px solid #E5E7EB;

    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;

    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;

    text-decoration: none;
    color: inherit;
}

.logo img {
    width: 42px;
    height: 42px;
}

.logo span {

    font-size: 1.55rem;

    font-weight: 700;

    letter-spacing: -.5px;

}

#theme-toggle {
    width: 44px;
    height: 44px;

    border: none;
    border-radius: 12px;

    background: #F3F4F6;

    cursor: pointer;

    font-size: 1.1rem;

    transition: .25s;
}

#theme-toggle:hover {
    background: #E5E7EB;
}


/* ========================= */
/* HERO */
/* ========================= */

.hero {
    padding: 70px 0 35px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-color);
    margin-bottom: 18px;
}

.hero p {
    max-width: 700px;
    margin: 0 auto;
    color: var(--muted-text);
    font-size: 1.05rem;
    line-height: 1.8;
}
html[data-theme="dark"] .hero p {
    color: #cbd5e1;
}

html[data-theme="dark"] .hero h1 {
    color: #f8fafc;
}
/* ========================= */
/* TESTS */
/* ========================= */

.tests {
    padding-bottom: 70px;
}

.tests .container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================= */
/* TEST CARD */
/* ========================= */

.test-card{

    display:flex;
    justify-content:space-between;
    align-items:center;

    background:#fff;

    border:1px solid #E5E7EB;

    border-radius:20px;

    padding:30px 35px;

    transition:.25s;

    cursor:pointer;

}

.test-card:hover{

    transform:translateY(-4px);

    border-color:#2563EB;

    box-shadow:0 18px 45px rgba(37,99,235,.12);

}

.test-card h2 {
    
    font-size:1.65rem;


    margin-bottom: 14px;

}

.test-card p{

    color:#6B7280;

    margin-bottom:6px;

}

.questions {

    display: block;

    font-size: .9rem;

    color: #9CA3AF;

    margin-bottom: 10px;

    font-weight: 500;

}
.test-meta {

    display: flex;
    align-items: center;
    gap: 20px;

}

.arrow{

    font-size:2.3rem;

    color:#2563EB;

    transition:.25s;

}
.test-card:hover .arrow{

    transform:translateX(6px);

}

/* ========================= */
/* RESPONSIVE */
/* ========================= */

@media (max-width:768px) {

    .hero {

        padding: 60px 0 40px;

    }

    .hero h1 {

        font-size: 2rem;

    }

    .test-card {

        display: flex;
        justify-content: space-between;
        align-items: center;

        background: white;

        border: 1px solid #E5E7EB;
        border-radius: 18px;

        padding: 24px 30px;

        cursor: pointer;

        transition: .25s;

    }

}

.page-title {

    font-size: 1.2rem;

    font-weight: 600;

    color: #374151;

}


.navigator button.active {

    background: #2563EB;

    color: white;

}


/* ======================================
   TEST PROGRESS CARDS
======================================= */

.test-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.test-card-header h2 {
    margin: 0;
}

.progress-badge {
    flex-shrink: 0;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: 0.8rem;
    font-weight: 700;

    color: #1d4ed8;
    background: #dbeafe;
}

.saved-module {
    margin: 18px 0;

    color: #4b5563;
}

.test-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.start-test-btn,
.restart-test-btn {
    padding: 11px 18px;

    border-radius: 9px;

    font-size: 0.95rem;
    font-weight: 700;

    cursor: pointer;
}

.start-test-btn {
    border: none;

    color: #ffffff;
    background: #2563eb;
}

.start-test-btn:hover {
    background: #1d4ed8;
}

.restart-test-btn {
    border: 1px solid #d1d5db;

    color: inherit;
    background: transparent;
}

.restart-test-btn:hover {
    background: rgba(127, 127, 127, 0.1);
}

.tests-error {
    padding: 24px;

    text-align: center;

    color: #dc2626;
    font-weight: 700;
}


/* ======================================
   MOBILE TEST CARDS
======================================= */

@media (max-width: 600px) {

    .header .container,
    .test-card-header,
    .test-meta,
    .test-card-actions {
        width: 100%;
    }

    .header .container {
        padding: 12px 16px;
    }

    .logo span {
        font-size: 1.25rem;
    }

    .hero {
        padding: 48px 16px 28px;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.15;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .tests {
        padding: 16px;
    }

    #tests-container {
        width: 100%;
        padding: 0;
    }

    .test-card {
        width: 100%;
        display: block;
        padding: 22px 18px;
    }

    .test-card-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 18px;
    }

    .test-card-header h2 {
        font-size: 1.4rem;
        line-height: 1.2;
    }

    .test-meta {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 18px;
    }

    .test-meta span {
        display: block;
        width: 100%;
    }

    .saved-module {
        margin: 16px 0;
        line-height: 1.5;
    }

    .test-card-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .start-test-btn,
    .restart-test-btn {
        width: 100%;
        min-height: 46px;
    }

}


.hero h1 {
    color: var(--text-color);
}

.hero p {
    color: var(--muted-text);
}

html[data-theme="dark"] .hero h1 {
    color: #f8fafc;
}

html[data-theme="dark"] .hero p {
    color: #cbd5e1;
}


html[data-theme="dark"] .header {
    background: #1e293b;
    border-bottom-color: #475569;
}

html[data-theme="dark"] .header .logo span {
    color: #f8fafc;
}


.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;
    padding: 12px 22px;

    border: none;
    border-radius: 10px;

    text-decoration: none;
    font-weight: 700;

    color: #ffffff;
    background: #2563eb;
}

.button:hover {
    background: #1d4ed8;
}


/* ======================================
   SITE FOOTER
====================================== */

.site-footer {
    width: 100%;
    margin-top: 48px;
    padding: 24px 20px;

    text-align: center;

    color: var(--muted-text);
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
}

.site-footer p {
    max-width: 760px;
    margin: 0 auto 12px;

    font-size: 0.9rem;
    line-height: 1.6;
}

.telegram-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 10px 18px;

    color: #ffffff;
    background: #229ed9;

    border-radius: 10px;

    text-decoration: none;
    font-weight: 700;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.telegram-link:hover {
    background: #1687bd;
    transform: translateY(-1px);
}

.telegram-link:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

html[data-theme="dark"] .site-footer {
    color: #cbd5e1;
    background: #0f172a;
    border-color: #334155;
}

@media (max-width: 600px) {
    .site-footer {
        margin-top: 32px;
        padding: 22px 16px;
    }

    .site-footer p {
        font-size: 0.82rem;
    }

    .telegram-link {
        width: 100%;
        max-width: 320px;
    }
}

.footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    margin: 0 8px 10px;
    padding: 10px 18px;

    color: #2563eb;
    background: transparent;

    border: 1px solid #2563eb;
    border-radius: 10px;

    text-decoration: none;
    font-weight: 700;
}

.footer-link:hover {
    color: #ffffff;
    background: #2563eb;
}

@media (max-width: 600px) {
    .footer-link {
        width: 100%;
        max-width: 320px;
        margin: 0 auto 10px;
    }
}


.support-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 9px 16px;

    color: #ffffff;
    background: #2563eb;

    border-radius: 10px;

    text-decoration: none;
    font-weight: 700;
}

.support-nav-link:hover {
    background: #1d4ed8;
}

@media (max-width: 600px) {
    .support-nav-link {
        padding: 8px 12px;
        font-size: 0.88rem;
    }
}