:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #475569;
    --secondary-hover: #334155;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --bg-color: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --text-color: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --border-light: #e2e8f0;
    --card-bg: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

html[data-theme="dark"],
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: #60a5fa;
    --secondary-color: #94a3b8;
    --secondary-hover: #cbd5e1;
    --success-color: #10b981;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-color: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-light: #475569;
    --card-bg: #1e293b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Улучшение для touch устройств */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

input, textarea, select {
    font-size: 16px; /* Предотвращает зум на iOS */
}

/* Улучшение скролла на мобильных */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px; /* Предотвращает зум на iOS при фокусе */
    }

    body {
        -webkit-overflow-scrolling: touch;
    }

    /* Улучшение для длинного контента */
    .test-content,
    .result-card,
    .favorite-item {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    animation: slideInDown 0.5s ease-out;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar .container {
    position: relative;
    z-index: 101;
}

html[data-theme="dark"] .navbar {
    background-color: rgba(30, 41, 59, 0.95);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: -0.5px;
    transition: transform 0.3s ease;
}

.nav-brand a {
    text-decoration: none;
    display: inline-block;
}

.nav-brand:hover h1 {
    transform: scale(1.05);
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
    position: relative;
    pointer-events: auto;
    touch-action: manipulation;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    transform: scale(1.1);
}

/* Кнопки */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-logout {
    background-color: var(--danger-color);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.25rem;
}

.btn-block {
    width: 100%;
}

/* Главный контент */
.main-content {
    min-height: calc(100vh - 80px);
    padding: 2rem 0 4rem;
}

.page {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

/* Анимация появления страницы */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: pageEnter 0.6s ease-out;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-delay {
    animation: fadeIn 0.6s ease-out 0.2s both;
}

.fade-in-delay-2 {
    animation: fadeIn 0.6s ease-out 0.4s both;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

.scale-in {
    animation: scaleIn 0.5s ease-out;
}

/* Анимации появления для элементов */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Анимация для карточек */
.card-animate {
    animation: scaleIn 0.5s ease-out;
    animation-fill-mode: both;
}

.card-animate:nth-child(1) { animation-delay: 0.1s; }
.card-animate:nth-child(2) { animation-delay: 0.2s; }
.card-animate:nth-child(3) { animation-delay: 0.3s; }
.card-animate:nth-child(4) { animation-delay: 0.4s; }
.card-animate:nth-child(5) { animation-delay: 0.5s; }
.card-animate:nth-child(6) { animation-delay: 0.6s; }

/* Hero секция */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-color) 50%, var(--bg-secondary) 100%);
    padding: 6rem 0 4rem;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color), var(--primary-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    line-height: 1.1;
    animation: shimmer 3s linear infinite, fadeIn 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.hero-actions .btn {
    min-width: 200px;
}

/* Features Section */
.features-section {
    padding: 5rem 0;
    background-color: var(--bg-color);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
    width: 100%;
    animation: slideInUp 0.8s ease-out;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 2px;
    animation: scaleIn 0.8s ease-out 0.3s both;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.6s ease-out;
    animation-fill-mode: both;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%) scale(0);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover::after {
    transform: translate(30%, -30%) scale(1);
}

.feature-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px) rotate(1deg);
    border-color: var(--primary-color);
}

.feature-icon {
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    animation: none;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

/* Stats Section */
.stats-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.stats-section::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 25s linear infinite reverse;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-box {
    padding: 2rem;
    position: relative;
    z-index: 1;
    animation: scaleIn 0.6s ease-out;
    animation-fill-mode: both;
}

.stat-box:nth-child(1) { animation-delay: 0.1s; }
.stat-box:nth-child(2) { animation-delay: 0.2s; }
.stat-box:nth-child(3) { animation-delay: 0.3s; }
.stat-box:nth-child(4) { animation-delay: 0.4s; }

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-text {
    font-size: 1.125rem;
    opacity: 0.95;
    font-weight: 500;
}

/* Page Header */
.page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    letter-spacing: -0.5px;
    animation: slideInLeft 0.6s ease-out;
    position: relative;
    display: inline-block;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 2px;
    animation: scaleIn 0.6s ease-out 0.3s both;
}

.page-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.page-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 700px;
}

.section-description {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Формы */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.6s ease-out;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.auth-form {
    position: relative;
    z-index: 10;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    touch-action: manipulation;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.checkbox-group label span {
    flex: 1;
    line-height: 1.5;
}

.checkbox-group input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    cursor: pointer;
    margin-top: 0.125rem;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    -webkit-appearance: checkbox;
    appearance: checkbox;
    touch-action: manipulation;
    opacity: 1;
}

.checkbox-group input[type="checkbox"]:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.checkbox-group small {
    display: block;
    margin-top: 0.5rem;
    margin-left: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-link {
    text-align: center;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Сетки */
.subjects-grid, .tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
}

.subject-card, .test-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.subject-card::before, .test-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--success-color));
    transform: scaleY(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.subject-card::after, .test-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.subject-card:hover::before, .test-card:hover::before {
    transform: scaleY(1);
}

.subject-card:hover::after, .test-card:hover::after {
    opacity: 1;
}

.subject-card:hover, .test-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.subject-card:active, .test-card:active {
    transform: translateY(-4px) scale(1.01);
}

.subject-card h3, .test-card h3 {
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.subject-card p, .test-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Настройки теста */
.test-settings {
    max-width: 700px;
    margin: 2rem auto;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    animation: slideInUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.test-settings::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    transform: scaleX(0);
    animation: scaleIn 0.8s ease-out 0.3s both;
}

.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.settings-actions {
    margin-top: 2rem;
    text-align: center;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.checkbox-group small {
    margin-left: 2rem;
    margin-top: 0.25rem;
}

/* Тест */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.test-progress {
    flex: 1;
    min-width: 200px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar::before {
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    width: 0%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.progress-fill::after {
    display: none;
}

#progressText {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: opacity 0.1s ease;
    display: inline-block;
}

.test-timer {
    background: none;
    color: var(--text-color);
    padding: 0;
    border-radius: 0;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: fit-content;
    position: relative;
    display: flex;
    align-items: center;
    box-shadow: none;
    animation: none;
    border: none;
}

.test-timer::before {
    display: none;
}

.test-timer span {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.1s ease;
    display: inline-block;
    min-width: 3.5rem;
    text-align: center;
}

.test-content {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.test-content::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.question-item {
    margin-bottom: 2rem;
}

.question-item h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    position: relative;
    padding-left: 1rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    font-size: 1.25rem;
    font-weight: 600;
}

.question-item h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--success-color));
    border-radius: 2px;
}

.favorite-icon-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: transform 0.2s ease, opacity 0.2s ease;
    flex-shrink: 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius);
    position: relative;
}

.favorite-icon-btn:hover {
    transform: scale(1.15);
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.favorite-icon-btn.favorite-active {
    color: var(--primary-color);
}

.favorite-icon-btn span {
    display: inline-block;
    transition: transform 0.2s ease;
}

.favorite-icon-btn:hover span {
    transform: rotate(15deg) scale(1.1);
}

#favoriteContainer {
    display: flex;
    align-items: center;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-item {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-color);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.answer-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.answer-item:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.answer-item:hover::before {
    transform: scaleY(1);
}

.answer-item.selected {
    border-color: var(--primary-color);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
    transform: translateX(8px);
    box-shadow: var(--shadow);
}

.answer-item.selected::before {
    transform: scaleY(1);
    width: 4px;
}

.answer-item.correct {
    border-color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.1);
}

.answer-item.incorrect {
    border-color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
}

.test-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.test-actions .btn {
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.test-actions .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.test-actions .btn:hover::after {
    width: 300px;
    height: 300px;
}

/* Результаты */
.result-card {
    max-width: 600px;
    margin: 2rem auto;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid var(--border-light);
    animation: scaleIn 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.result-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    animation: slideInDown 0.6s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.score-number {
    animation: bounce 0.8s ease-out;
    animation-delay: 0.3s;
    animation-fill-mode: both;
}

.result-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.score-number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.score-total {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.result-percentage {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* Статистика */
.stats-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    animation: slideInRight 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.stats-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, 30%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.6s ease-out;
    animation-fill-mode: both;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-item:hover::before {
    left: 100%;
}

.stat-item:hover {
    background-color: var(--bg-tertiary);
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-value {
    animation: scaleIn 0.8s ease-out;
    animation-fill-mode: both;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }
.stat-item:nth-child(4) { animation-delay: 0.4s; }
.stat-item:nth-child(5) { animation-delay: 0.5s; }

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.user-info-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
    animation: slideInLeft 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.user-info-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.user-info-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-details p {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-color);
}

.user-details p:last-child {
    border-bottom: none;
}

.user-details strong {
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 0.5rem;
}

.favorites-actions {
    margin-top: 2rem;
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.action-hint {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Новости */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.news-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: slideInLeft 0.6s ease-out;
    animation-fill-mode: both;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--success-color));
    transform: scaleY(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover {
    transform: translateY(-8px) translateX(5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.news-card:hover::before {
    transform: scaleY(1);
}

.news-card:hover::after {
    transform: scaleX(1);
}

.news-icon {
    animation: pulse 2s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.news-card:hover .news-icon {
    animation: bounce 0.6s ease;
    transform: scale(1.1);
}

.news-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.news-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius);
    flex-shrink: 0;
}

.news-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.news-category {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.news-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.4;
}

.news-content {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* Обратная связь */
    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 20px;
    }

    .news-card {
        padding: 1.75rem;
    }

    .news-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .contact-form-wrapper {
        padding: 2rem 1.5rem;
    }

    .contact-card {
        padding: 2rem 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer {
        padding: 2rem 0 1rem;
        margin-top: 3rem;
    }

.contact-form-wrapper {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form .form-group label {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.contact-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    color: white;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 15s linear infinite;
}

.social-link {
    animation: slideInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.social-link:nth-child(1) { animation-delay: 0.1s; }
.social-link:nth-child(2) { animation-delay: 0.2s; }
.social-link:nth-child(3) { animation-delay: 0.3s; }

.contact-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.contact-card > p {
    font-size: 1.05rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.6;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateX(5px);
}

.social-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.contact-details {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-details p {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    opacity: 0.95;
}

.contact-details strong {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Футер */
.footer {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg);
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 1.5rem;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}

.footer-social-link {
    animation: scaleIn 0.5s ease-out;
    animation-fill-mode: both;
}

.footer-social-link:nth-child(1) { animation-delay: 0.1s; }
.footer-social-link:nth-child(2) { animation-delay: 0.2s; }
.footer-social-link:nth-child(3) { animation-delay: 0.3s; }

.footer-social-link:hover {
    transform: translateY(-5px) scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-md);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    animation: bounce 0.6s ease;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1rem;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.settings-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    animation: slideInLeft 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.settings-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.password-form .form-group {
    margin-bottom: 0;
}

.recent-results {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    animation: slideInRight 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.recent-results::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-30%, 30%);
}

.recent-results h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Избранное */
.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.favorite-item {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInLeft 0.5s ease-out;
    animation-fill-mode: both;
    position: relative;
    overflow: hidden;
}

.favorite-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--success-color));
    transform: scaleY(0);
    transition: transform 0.4s ease;
}

.favorite-item:hover {
    transform: translateX(5px) translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.favorite-item:hover::before {
    transform: scaleY(1);
}

.favorite-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.favorite-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    border-radius: 0.25rem;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--bg-secondary);
}

/* Уведомления */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    left: auto;
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateX(400px) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--primary-color);
    max-width: 400px;
    word-wrap: break-word;
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.notification.show {
    transform: translateX(0) scale(1);
    opacity: 1;
    pointer-events: auto;
    animation: slideInRight 0.4s ease-out;
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

/* Загрузка */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Пульсирующий эффект для важных элементов */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.8), 0 0 30px rgba(37, 99, 235, 0.6);
    }
}

.glow-effect {
    animation: glow 2s ease-in-out infinite;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: scaleIn 0.3s ease;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content .btn {
    white-space: nowrap;
}

.modal-content > div[style*="display: flex"] .btn {
    flex: 1;
    min-width: 150px;
    text-align: center;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 20% auto;
        padding: 1.5rem;
        max-width: 95%;
    }
    
    .modal-content > div[style*="display: flex"] {
        flex-direction: column;
    }
    
    .modal-content > div[style*="display: flex"] .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Адаптивность */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    /* Улучшение для кнопок назад */
    .btn-secondary {
        min-height: 48px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Навигация */
    .navbar {
        padding: 1rem 0;
        box-shadow: var(--shadow-md);
    }

    .navbar .container {
        position: relative;
        flex-wrap: nowrap;
        gap: 1rem;
        align-items: center;
    }

    .nav-brand h1 {
        font-size: 1.5rem;
        flex: 1;
        margin: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 1001;
        pointer-events: auto;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu-toggle span {
        width: 26px;
        height: 3px;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--card-bg);
        border-bottom: 2px solid var(--border-color);
        box-shadow: var(--shadow-xl);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 100;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        display: flex !important; /* Принудительно показываем на мобильных */
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    /* На десктопе меню всегда видно */
    @media (min-width: 769px) {
        .nav-menu {
            position: static;
            transform: none !important;
            opacity: 1 !important;
            visibility: visible !important;
            display: flex !important;
        }
    }

    .nav-link {
        padding: 1.25rem 1rem;
        font-size: 1.1rem;
        font-weight: 500;
        border-radius: var(--radius);
        text-align: left;
        width: 100%;
        border-bottom: 1px solid var(--border-light);
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .nav-link:last-of-type {
        border-bottom: none;
    }

    .nav-link:active {
        background-color: var(--bg-secondary);
        transform: scale(0.98);
    }

    .nav-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 2px solid var(--border-light);
    }

    .nav-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        font-size: 1rem;
        font-weight: 600;
    }

    .theme-toggle {
        align-self: center;
        min-width: 48px;
        min-height: 48px;
        padding: 0.75rem;
        font-size: 1.5rem;
    }

    .btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        min-height: 48px;
        border-radius: var(--radius);
    }

    .btn-large {
        padding: 1.25rem 2rem;
        font-size: 1.125rem;
        min-height: 52px;
    }

    /* Главный контент */
    .main-content {
        padding: 1.5rem 0 3rem;
    }

    /* Hero секция */
    .hero {
        padding: 2.5rem 0 2rem;
    }

    .hero-content {
        padding: 0 20px;
    }

    .hero-title {
        font-size: 2.25rem;
        margin-bottom: 1rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        font-weight: 600;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 2.5rem;
        line-height: 1.7;
        padding: 0 0.5rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .hero-actions .btn {
        width: 100%;
        min-height: 52px;
    }

    /* Features */
    .features-section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
        padding: 0 20px;
        line-height: 1.3;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 20px;
    }

    .feature-card {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .feature-icon {
        font-size: 3rem;
        margin-bottom: 1.25rem;
    }

    .feature-card h3 {
        font-size: 1.375rem;
        margin-bottom: 1rem;
        line-height: 1.4;
    }

    .feature-card p {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* Stats Section */
    .stats-section {
        padding: 3rem 0;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 20px;
    }

    .stat-box {
        padding: 2rem 1rem;
        border-radius: var(--radius);
    }

    .stat-number {
        font-size: 2.75rem;
        font-weight: 800;
    }

    .stat-text {
        font-size: 1.05rem;
        font-weight: 500;
    }

    /* Page Header */
    .page-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
        padding: 0 20px 1.5rem;
    }

    .page-header h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }

    .page-header h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .page-description {
        font-size: 1.05rem;
        line-height: 1.7;
        margin-top: 0.5rem;
    }

    /* Сетки */
    .subjects-grid, .tests-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
        margin-bottom: 2rem;
        padding: 0 20px 2rem;
    }

    .subject-card, .test-card {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .subject-card h3, .test-card h3 {
        font-size: 1.375rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
        line-height: 1.4;
    }

    .subject-card p, .test-card p {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Настройки теста */
    .test-settings {
        max-width: 100%;
        margin: 2rem auto;
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .settings-section {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }

    .settings-section:last-of-type {
        margin-bottom: 1rem;
    }

    .settings-section h3 {
        font-size: 1.375rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }

.form-group {
    margin-bottom: 1.5rem;
    animation: slideInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

    .form-group label {
        font-size: 1.05rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
        display: block;
    }

    .form-group input[type="number"],
    .form-group input[type="text"] {
        font-size: 1.1rem;
        padding: 1rem;
        min-height: 48px;
        border-width: 2px;
    }

    .form-group small {
        font-size: 0.9rem;
        margin-top: 0.5rem;
        display: block;
        line-height: 1.5;
    }

    .checkbox-group {
        padding: 1rem;
        background-color: var(--bg-secondary);
        border-radius: var(--radius);
        border: 2px solid var(--border-light);
    }

    .checkbox-group label {
        font-size: 1.05rem;
        cursor: pointer;
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        min-height: 48px;
    }

    .checkbox-group input[type="checkbox"] {
        width: 24px;
        height: 24px;
        min-width: 24px;
        margin-top: 2px;
        cursor: pointer;
    }

    .settings-actions {
        margin-top: 2.5rem;
    }

    .settings-actions .btn {
        width: 100%;
        min-height: 52px;
    }

    /* Тест */
    .test-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        margin-bottom: 2rem;
        padding: 0 20px;
    }

    .test-progress {
        width: 100%;
        order: 1;
    }

    .progress-bar {
        height: 10px;
        margin-bottom: 0.75rem;
    }

    .test-timer {
        width: auto;
        text-align: left;
        padding: 0;
        font-size: 0.9rem;
        font-weight: 500;
        order: 0;
        border-radius: 0;
        background: none;
        border: none;
    }
    
    .test-timer span {
        font-size: 0.9rem;
    }

    #progressText {
        font-size: 1rem;
        font-weight: 600;
        display: block;
        margin-top: 0.5rem;
        color: var(--text-color);
    }

    .test-content {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
        border-radius: var(--radius-lg);
    }

    .question-item {
        margin-bottom: 0;
    }

    .question-item h3 {
        font-size: 1.25rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
        line-height: 1.6;
        color: var(--text-color);
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;
    }

    .answers-list {
        gap: 1rem;
    }

    .answer-item {
        padding: 1.25rem 1rem;
        font-size: 1.05rem;
        min-height: 56px;
        display: flex;
        align-items: center;
        border-width: 2px;
        border-radius: var(--radius);
        line-height: 1.5;
    }

    .answer-item:active {
        transform: scale(0.98);
    }

    .test-actions {
        flex-direction: row;
        gap: 0.75rem;
        padding: 0 20px;
        justify-content: space-between;
    }

    .test-actions .btn {
        flex: 1;
        min-height: 44px;
        height: 44px;
        font-size: 0.95rem;
        font-weight: 600;
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }
    
    .test-actions #finishTest {
        flex: 1;
    }

    /* Результаты */
    .result-card {
        max-width: 100%;
        margin: 2rem auto;
        padding: 2.5rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .result-card h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .result-score {
        margin: 2rem 0;
    }

    .score-number {
        font-size: 3.5rem;
        font-weight: 800;
    }

    .score-total {
        font-size: 1.5rem;
        font-weight: 500;
    }

    .result-percentage {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 2rem;
    }

    #resultDetails {
        text-align: left;
        margin-top: 2rem;
    }

    #resultDetails > div {
        padding: 1.25rem;
        margin-bottom: 1rem;
        border-radius: var(--radius);
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .result-card .btn {
        width: 100%;
        min-height: 52px;
        margin-top: 2rem;
    }

    /* Статистика */
    .stats-card {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
        border-radius: var(--radius-lg);
    }

    .stats-card h3 {
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin-top: 1.5rem;
    }

    .stat-item {
        padding: 1.75rem 1.5rem;
        border-radius: var(--radius);
    }

    .stat-value {
        font-size: 2.5rem;
        font-weight: 800;
        margin-bottom: 0.75rem;
    }

    .stat-label {
        font-size: 1.05rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    .stat-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .user-info-card {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
        border-radius: var(--radius-lg);
    }

    .user-info-card h3 {
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
    }

    .user-details p {
        padding: 1rem 0;
        font-size: 1.05rem;
        line-height: 1.6;
    }

    .recent-results {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .recent-results h3 {
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
    }

    .section-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    /* Избранное */
    .favorites-list {
        gap: 1.25rem;
        margin-top: 2rem;
        padding: 0 20px;
    }

    .favorite-item {
        padding: 1.75rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .favorite-item-header {
        flex-direction: column;
        gap: 1rem;
    }

    .favorite-item-header > div {
        width: 100%;
    }

    .favorite-item-actions {
        align-self: flex-end;
        margin-top: 0.75rem;
    }

    .favorite-item h4 {
        font-size: 1.125rem;
        font-weight: 600;
        line-height: 1.6;
        word-break: break-word;
        margin-bottom: 0.75rem;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
        padding: 0.75rem;
        font-size: 1.5rem;
    }

    .favorites-actions {
        margin-top: 2rem;
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .favorites-actions .btn {
        width: 100%;
        min-height: 52px;
    }

    .action-hint {
        margin-top: 1rem;
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Новости на мобильных */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 20px;
    }

    .news-card {
        padding: 1.75rem 1.5rem;
    }

    .news-card-header {
        margin-bottom: 1rem;
    }

    .news-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .news-title {
        font-size: 1.25rem;
    }

    .news-content {
        font-size: 0.95rem;
    }

    /* Обратная связь на мобильных */
    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 20px;
    }

    .contact-form-wrapper {
        padding: 2rem 1.5rem;
    }

    .contact-card {
        padding: 2rem 1.5rem;
    }

    .contact-card h3 {
        font-size: 1.5rem;
    }

    .social-link {
        padding: 1rem;
        font-size: 1rem;
    }

    .social-icon {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    /* Футер на мобильных */
    .footer {
        padding: 2rem 0 1rem;
        margin-top: 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 20px;
    }

    .footer-section h3 {
        font-size: 1.375rem;
    }

    .footer-section h4 {
        font-size: 1.05rem;
    }

    .footer-social {
        justify-content: flex-start;
    }

    /* Формы */
    .auth-container {
        max-width: 100%;
        margin: 2rem auto;
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .auth-container h2 {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 1.5rem;
        text-align: center;
    }

    .auth-form {
        gap: 1.5rem;
    }

    .auth-form .form-group {
        margin-bottom: 1.25rem;
    }

    .auth-form .form-group label {
        font-size: 1.05rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

    .auth-form .form-group input {
        padding: 1rem;
        font-size: 1.1rem;
        min-height: 48px;
        border-width: 2px;
    }

    .auth-form .form-group small {
        font-size: 0.9rem;
        margin-top: 0.5rem;
        display: block;
        color: var(--text-muted);
    }

    .auth-form .checkbox-group {
        padding: 1rem;
        background-color: var(--bg-secondary);
        border-radius: var(--radius);
        border: 2px solid var(--border-light);
    }

    .auth-form .checkbox-group label {
        font-size: 1rem;
        min-height: auto;
        align-items: center;
    }

    .auth-form .checkbox-group input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }

    .auth-form .btn {
        width: 100%;
        min-height: 52px;
        font-size: 1.1rem;
        font-weight: 600;
        margin-top: 0.5rem;
    }

    .auth-link {
        text-align: center;
        margin-top: 1.5rem;
        font-size: 1rem;
    }

    .auth-link a {
        font-weight: 600;
        font-size: 1.05rem;
    }

    /* Уведомления */
    .notification {
        top: 80px;
        right: 12px;
        left: 12px;
        max-width: calc(100% - 24px);
        padding: 1.25rem 1.5rem;
        font-size: 1rem;
        transform: translateY(-120px);
        border-radius: var(--radius-lg);
        font-weight: 500;
        line-height: 1.5;
    }

    .notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    /* Очень маленькие экраны */
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header h2 {
        font-size: 1.25rem;
    }

    .page-description {
        font-size: 0.95rem;
    }

    .nav-link {
        padding: 0.875rem;
        font-size: 0.95rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .feature-icon {
        font-size: 2rem;
    }

    .test-content {
        padding: 1.25rem;
    }

    .answer-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .result-card {
        padding: 1.5rem 1rem;
    }

    .result-card h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .score-number {
        font-size: 2.5rem;
    }

    #resultDetails {
        margin-top: 1.5rem;
        text-align: left;
    }

    #resultDetails > div {
        margin: 1rem 0;
        padding: 1rem;
        font-size: 0.9rem;
    }

    .auth-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }

    .test-settings {
        padding: 1.5rem;
    }

    .settings-section h3 {
        font-size: 1.125rem;
    }

    .stats-card,
    .user-info-card,
    .recent-results {
        padding: 1.25rem;
    }
}

/* Пейзажная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .features-section {
        padding: 2rem 0;
    }

    .stats-section {
        padding: 2rem 0;
    }
}

/* Улучшение для планшетов */
@media (min-width: 481px) and (max-width: 768px) {
    .subjects-grid, .tests-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Стили для страницы "О нас" */
.about-section {
    margin-bottom: 3rem;
}

.about-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.about-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.about-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.about-card h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
}

.about-card p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.about-card p:last-child {
    margin-bottom: 0;
}

/* Список целей */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.goal-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.goal-icon {
    font-size: 1.5rem;
    color: var(--success-color);
    font-weight: 700;
    min-width: 2rem;
    text-align: center;
}

.goal-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.goal-item p {
    font-size: 1rem;
    margin: 0;
    color: var(--text-secondary);
}

/* Шаги работы */
.workflow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.workflow-step {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-light);
    transition: var(--transition);
    position: relative;
}

.workflow-step:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-md);
}

.workflow-step h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.workflow-step p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Сетка функций */
.features-grid-about {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-item-about {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    text-align: center;
}

.feature-item-about:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.feature-icon-about {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-item-about h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-item-about p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Социальные сети */
.social-links-about {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-link-about {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-light);
    text-decoration: none;
    transition: var(--transition);
    color: var(--text-color);
}

.social-link-about:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.social-link-about.whatsapp:hover {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.05);
}

.social-link-about.telegram:hover {
    border-color: #0088cc;
    background: rgba(0, 136, 204, 0.05);
}

.social-link-about.instagram:hover {
    border-color: #E4405F;
    background: rgba(228, 64, 95, 0.05);
}

.social-icon-large {
    font-size: 3rem;
    min-width: 60px;
    text-align: center;
}

.social-link-about h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.social-link-about p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Форма обратной связи на странице "О нас" */
.contact-form-wrapper-about {
    margin-top: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.contact-form-about {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.contact-form-about .form-group {
    margin-bottom: 1.5rem;
}

.contact-form-about label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.contact-form-about input,
.contact-form-about select,
.contact-form-about textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
}

.contact-form-about input:focus,
.contact-form-about select:focus,
.contact-form-about textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form-about textarea {
    resize: vertical;
    min-height: 120px;
}

/* Адаптивность для страницы "О нас" */
@media (max-width: 768px) {
    .about-card {
        padding: 1.5rem;
    }

    .about-card h2 {
        font-size: 1.5rem;
    }

    .about-icon {
        font-size: 2.5rem;
    }

    .workflow-steps {
        grid-template-columns: 1fr;
    }

    .features-grid-about {
        grid-template-columns: 1fr;
    }

    .social-links-about {
        grid-template-columns: 1fr;
    }

    .goal-item {
        flex-direction: column;
        gap: 1rem;
    }

    .contact-form-wrapper-about {
        margin-top: 1.5rem;
    }

    .contact-form-about {
        padding: 1.5rem;
    }
}

/* Стили для поиска по предметам */
.search-container {
    margin: 2rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.search-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), var(--shadow-md);
}

.search-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
    padding: 0.25rem 0;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.clear-search-btn {
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.clear-search-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
    transform: scale(1.1);
}

.search-results-count {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    display: inline-block;
}

.search-results-count.no-results {
    color: var(--danger-color);
    background: rgba(220, 38, 38, 0.1);
}

/* Адаптивность для поиска */
@media (max-width: 768px) {
    .search-container {
        margin: 1.5rem 0;
    }

    .search-wrapper {
        padding: 0.625rem 0.875rem;
    }

    .search-input {
        font-size: 16px; /* Предотвращает зум на iOS */
    }

    .search-results-count {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Social Links */
.social-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.social-link:hover {
    transform: translateX(5px);
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
}

.social-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Specific Social Colors */
.social-link.whatsapp:hover {
    color: #25D366;
    border-color: #25D366;
}

.social-link.telegram:hover {
    color: #0088cc;
    border-color: #0088cc;
}

.social-link.instagram:hover {
    color: #E1306C;
    border-color: #E1306C;
}

/* Footer Social */
.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.footer-social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.footer-social-link:hover {
    background-color: white;
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-social-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}


/* Subscription Plans */
.subscription-plans {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plan-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    border-color: var(--primary-light);
    background-color: var(--bg-secondary);
}

.plan-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.plan-price {
    font-weight: 700;
    color: var(--primary-color);
}

.plan-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--success-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-bottom-left-radius: var(--radius);
    font-weight: 600;
}
