* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00CC00;
    --primary-dark: #00a800;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 15px rgba(0, 0, 0, 0.08);
    --header-height: 72px;
}

html.is-locked .page {
    visibility: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
}

.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.site-brand:hover .site-name {
    color: var(--primary-dark);
}

.site-logo {
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.site-name {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    transition: color 0.15s ease;
}

.site-tagline {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.site-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.site-nav a.is-active {
    background: rgba(0, 204, 0, 0.12);
    color: var(--primary-dark);
}

.site-main {
    flex: 1;
    width: 100%;
    padding: 40px 20px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 720px;
}

.header {
    text-align: center;
    margin-bottom: 36px;
}

.page-hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 8px 0 4px;
}

.hero-greeting {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
    background: rgba(0, 204, 0, 0.1);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
    letter-spacing: 0.01em;
}

.page-hero h1,
.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.page-hero p,
.header p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.page-banner {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border: 1px solid rgba(0, 204, 0, 0.15);
    border-radius: 20px;
    padding: 28px 24px 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
}

.page-banner .course-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.page-banner h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.page-banner p {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: none;
    margin: 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary-color);
}

.sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.section-card {
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.section-card:hover,
.section-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    outline: none;
}

.section-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.section-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.section-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

.tests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.test-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px solid transparent;
    gap: 16px;
}

.test-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.test-info {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.test-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.test-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.test-card .test-meta {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    margin-top: 2px;
}

.test-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.auth-overlay.visible {
    display: flex;
}

.auth-modal {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 28px 24px 24px;
    box-shadow: var(--shadow-lg);
}

.auth-modal h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.auth-modal .auth-sub {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.auth-modal input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 16px;
    margin-bottom: 10px;
    outline: none;
}

.auth-modal input:focus {
    border-color: var(--primary-color);
}

.auth-error {
    min-height: 18px;
    color: var(--danger-color);
    font-size: 13px;
    margin-bottom: 14px;
}

.auth-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.auth-actions button {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.auth-cancel {
    background: #e2e8f0;
    color: var(--text-primary);
}

.auth-submit {
    background: var(--primary-color);
    color: #fff;
}

@media (max-width: 600px) {
    .site-main {
        padding: 24px 16px 36px;
    }

    .site-header-inner {
        padding: 12px 16px;
    }

    .site-nav a {
        padding: 7px 11px;
        font-size: 13px;
    }

    .site-name {
        font-size: 15px;
    }

    .site-tagline {
        font-size: 12px;
    }

    .page-hero h1,
    .header h1 {
        font-size: 26px;
    }

    .page-banner {
        padding: 22px 18px 18px;
        border-radius: 16px;
    }

    .page-banner h1 {
        font-size: 24px;
    }

    .sections {
        grid-template-columns: 1fr;
    }

    .test-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .test-info {
        flex-direction: column;
    }

    .test-btn {
        width: 100%;
        text-align: center;
    }
}
