﻿/* ============================================
   ОГЛАВЛЕНИЕ
   ============================================
   1. RESET и базовые стили
   2. Авторизация
   3. Общие компоненты (header, dashboard, admin)
   4. Кнопка "Вверх"
   5. Кнопка "Старт", "Вернуться"
   6. Таблица картинок (dashboard)
   7. Streak-бейджи
   8. Уведомления (toast)
   9. Инструкция, finished-message
   10. ФАЗА 2 (images, buttons, chart)
   11. Мобильная версия (media queries)
   ============================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Стили авторизации */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 400px;
    max-width: 90%;
}

    .auth-container h1 {
        text-align: center;
        margin-bottom: 30px;
        color: #333;
    }

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    font-family: 'Comfortaa', cursive;
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s;
    color: #64748b;
    border-radius: 14px 14px 0 0;
}

    .tab-btn.active {
        color: #6366f1;
        background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
        border-bottom: 3px solid #6366f1;
    }

/* ===== АВТОРИЗАЦИЯ ===== */
.auth-page {
    display: flex;
    flex-direction: column; /* ← добавляем это: элементы будут друг под другом */
    min-height: 100vh; /* ← страница на всю высоту экрана */
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 420px;
    max-width: 90%;
}

    .auth-container h1 {
        text-align: center;
        margin-bottom: 30px;
        color: #4338ca;
        font-family: 'Nunito', sans-serif;
        font-size: 32px;
        font-weight: 800;
    }

/* Табы */
.auth-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e7ff;
}

.tab-btn {
    font-family: 'Nunito', sans-serif;
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s;
    color: #64748b;
    border-radius: 14px 14px 0 0;
}

    .tab-btn.active {
        color: #6366f1;
        background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
        border-bottom: 3px solid #6366f1;
    }

/* Формы — только одна видна за раз */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 15px;
}

    .auth-form.active {
        display: flex;
    }

    .auth-form input {
        padding: 14px 16px;
        border: 2px solid #e0e7ff;
        border-radius: 14px;
        font-size: 15px;
        font-family: inherit;
        transition: all 0.2s ease;
        outline: none;
    }

        .auth-form input:focus {
            border-color: #a5b4fc;
            box-shadow: 0 0 0 4px rgba(165, 180, 252, 0.2);
        }

    /* Кнопка формы */
    .auth-form button {
        font-family: 'Comfortaa', cursive;
        padding: 14px;
        font-size: 17px;
        font-weight: 700;
        background: linear-gradient(180deg, #a5b4fc 0%, #6366f1 100%);
        color: white;
        border: none;
        border-radius: 16px;
        cursor: pointer;
        transition: all 0.1s ease;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        box-shadow: 0 4px 0 #4338ca, 0 6px 12px rgba(99, 102, 241, 0.3);
        position: relative;
        top: 0;
        margin-top: 5px;
    }

        .auth-form button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 0 #4338ca, 0 8px 16px rgba(99, 102, 241, 0.4);
        }

        .auth-form button:active {
            top: 4px;
            transform: translateY(0);
            box-shadow: 0 0 0 #4338ca, 0 2px 4px rgba(99, 102, 241, 0.3);
        }

/* Сообщение об ошибке */
.error-message {
    color: #e53e3e;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

.error-message {
    color: #e53e3e;
    font-size: 14px;
    text-align: center;
}

/* Общие стили для всех страниц */
.header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

    /* Заголовок страницы dashboard */
    .header h1 {
        font-family: 'Nunito', 'Segoe UI', sans-serif;
        font-size: 28px;
        font-weight: 800;
        color: #4338ca;
        letter-spacing: 0.3px;
        margin: 0;
        text-shadow: 0 1px 2px rgba(102, 126, 234, 0.15);
    }

.dashboard, .test-container, .admin-container {
    background: linear-gradient(180deg, #fef9ff 0%, #eef2ff 100%);
    border-radius: 32px;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
    margin-top: 20px;
    padding: 25px;
}

/* Список картинок */
.images-list {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.image-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    gap: 20px;
}

    .image-item img {
        width: 100px;
        height: 100px;
        object-fit: cover;
        border-radius: 8px;
    }

.image-info {
    flex: 1;
}

.image-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #4338ca;
    letter-spacing: 0.2px;
}

.image-item:hover .image-title::after {
    opacity: 0.6;
}

.checkboxes {
    display: flex;
    gap: 20px;
}

/* ===== КРУГЛЫЕ МЯГКИЕ ЧЕКБОКСЫ ===== */
.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 5px;
}

    .checkbox-label input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 32px;
        height: 32px;
        border: 3px solid #a5b4fc;
        border-radius: 10px;
        background: #f8fafc;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
        box-shadow: 0 2px 0 #c7d2fe;
    }

        .checkbox-label input[type="checkbox"]:hover {
            border-color: #818cf8;
            background: #eef2ff;
            transform: scale(1.05);
        }

        .checkbox-label input[type="checkbox"]:checked {
            animation: pop 0.3s ease;
            background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
            border-color: #6366f1;
            box-shadow: 0 2px 0 #4f46e5, 0 0 12px rgba(129, 140, 248, 0.5);
        }

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

            /* Галочка внутри чекбокса */
            .checkbox-label input[type="checkbox"]:checked::after {
                content: "✓";
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                color: white;
                font-size: 20px;
                font-weight: bold;
                line-height: 1;
                text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            }

/* Чекбокс "Знает" — жёлтая тема */
.checkbox-knows:checked {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%) !important;
    border-color: #d97706 !important;
    box-shadow: 0 2px 0 #b45309, 0 0 12px rgba(245, 158, 11, 0.5) !important;
}

/* Чекбокс "В тест" — зелёная тема */
.checkbox-b:checked {
    background: linear-gradient(135deg, #86efac 0%, #22c55e 100%) !important;
    border-color: #16a34a !important;
    box-shadow: 0 2px 0 #15803d, 0 0 12px rgba(34, 197, 94, 0.5) !important;
}

/* Тестирование */
.test-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
}

.test-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 10px;
}

.progress {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

.image-container img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.vote-btn {
    font-family: 'Comfortaa', cursive;
    padding: 18px 45px;
    font-size: 22px;
    font-weight: 700;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.1s ease;
    color: white;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    top: 0;
}

    /* Кнопка "Правильно" — зелёная */
    .vote-btn.correct {
        background: linear-gradient(180deg, #86efac 0%, #22c55e 100%);
        box-shadow: 0 5px 0 #15803d, 0 8px 15px rgba(34, 197, 94, 0.35);
    }

        .vote-btn.correct:hover {
            background: linear-gradient(180deg, #a7f3d0 0%, #34d399 100%);
            transform: translateY(-2px);
            box-shadow: 0 7px 0 #15803d, 0 10px 20px rgba(34, 197, 94, 0.4);
        }

        .vote-btn.correct:active {
            top: 5px;
            box-shadow: 0 0 0 #15803d, 0 2px 6px rgba(34, 197, 94, 0.3);
        }

    /* Кнопка "Неправильно" — красная */
    .vote-btn.incorrect {
        background: linear-gradient(180deg, #fca5a5 0%, #ef4444 100%);
        box-shadow: 0 5px 0 #b91c1c, 0 8px 15px rgba(239, 68, 68, 0.35);
    }

        .vote-btn.incorrect:hover {
            background: linear-gradient(180deg, #fecaca 0%, #f87171 100%);
            transform: translateY(-2px);
            box-shadow: 0 7px 0 #b91c1c, 0 10px 20px rgba(239, 68, 68, 0.4);
        }

        .vote-btn.incorrect:active {
            top: 5px;
            box-shadow: 0 0 0 #b91c1c, 0 2px 6px rgba(239, 68, 68, 0.3);
        }


/* Админ-панель */
.admin-tab:hover {
    transform: translateY(-1px);
    border-color: #c7d2fe;
    box-shadow: 0 4px 0 #c7d2fe;
}

.admin-tab.active {
    background: linear-gradient(180deg, #a5b4fc 0%, #6366f1 100%);
    color: white;
    border-color: #4338ca;
    box-shadow: 0 3px 0 #4338ca;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

    .admin-tab.active:active {
        top: 3px;
        box-shadow: 0 0 0 #4338ca;
    }

.add-image-form {
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
}

    .add-image-form form {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    .add-image-form input, .add-image-form button {
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 5px;
    }

    .add-image-form button {
        background: #667eea;
        color: white;
        cursor: pointer;
    }

.images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.admin-image-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

    .admin-image-card img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        border-radius: 5px;
    }

    .admin-image-card button {
        margin-top: 10px;
        padding: 5px 10px;
        background: #e53e3e;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }

.stats-table-wrapper {
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

    .stats-table th, .stats-table td {
        padding: 12px;
        text-align: left;
        border-bottom: 1px solid #eee;
    }

    .stats-table th {
        background: #667eea;
        color: white;
    }

.logout-btn {
    font-family: 'Comfortaa', cursive;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(180deg, #fca5a5 0%, #ef4444 100%);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.1s ease;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 3px 0 #b91c1c, 0 5px 10px rgba(239, 68, 68, 0.3);
    position: relative;
    top: 0;
}

    .logout-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 0 #b91c1c, 0 6px 12px rgba(239, 68, 68, 0.35);
    }

    .logout-btn:active {
        top: 3px;
        transform: translateY(0);
        box-shadow: 0 0 0 #b91c1c, 0 2px 4px rgba(239, 68, 68, 0.3);
    }

/* Увеличенные чекбоксы */
.checkbox-label input[type="checkbox"] {
    accent-color: #667eea; /* Цвет галочки */
    width: 20px;
    height: 20px;
    transform: scale(1.2);
    margin-right: 8px;
    cursor: pointer;
}

/* Кнопка "Вверх" - крупная зелёная */
.scroll-top-btn {
    bottom: 40px;
    right: 40px;
    width: 64px;
    height: 64px;
    background: linear-gradient(180deg, #86efac 0%, #10b981 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 34px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 0 #047857, 0 8px 15px rgba(16, 185, 129, 0.35);
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
    position: fixed;
    top: auto;
}

    .scroll-top-btn.show {
        opacity: 1;
        visibility: visible;
    }

    .scroll-top-btn:hover {
        transform: translateY(-3px) scale(1.05);
        background: linear-gradient(180deg, #a7f3d0 0%, #34d399 100%);
        box-shadow: 0 7px 0 #047857, 0 12px 20px rgba(16, 185, 129, 0.45);
    }

    .scroll-top-btn:active {
        transform: translateY(2px) scale(0.98);
        box-shadow: 0 0 0 #047857, 0 3px 6px rgba(16, 185, 129, 0.3);
    }

/* ===== ПАНЕЛЬ СТАРТ + ПОДСКАЗКА ===== */
.actions-top {
    text-align: center;
    margin: 20px 0 30px 0;
    padding: 0 20px;
}

/* Кнопка "Старт" */
.start-btn {
    font-family: 'Comfortaa', cursive;
    padding: 16px 40px;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(180deg, #86efac 0%, #22c55e 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.1s ease;
    min-width: 200px;
    letter-spacing: 0.5px;
    box-shadow: 0 5px 0 #15803d, 0 8px 15px rgba(34, 197, 94, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    top: 0;
}

    .start-btn:hover:not(:disabled) {
        background: linear-gradient(180deg, #a7f3d0 0%, #34d399 100%);
        transform: translateY(-2px);
        box-shadow: 0 7px 0 #15803d, 0 10px 20px rgba(34, 197, 94, 0.4);
    }

    .start-btn:active:not(:disabled) {
        top: 5px;
        transform: translateY(0);
        box-shadow: 0 0 0 #15803d, 0 2px 6px rgba(34, 197, 94, 0.3);
    }

    .start-btn:disabled {
        background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
        color: #94a3b8;
        cursor: not-allowed;
        box-shadow: 0 5px 0 #94a3b8, 0 8px 15px rgba(148, 163, 184, 0.25);
        text-shadow: none;
    }

/* ===== ПОДСКАЗКА ДЛЯ ВЫБОРА 3 КАРТИНОК ===== */
.actions-top {
    text-align: center;
    margin: 20px 0 30px 0;
    padding: 0 20px;
}

/* Кнопка "Старт" */
.start-btn {
    padding: 12px 32px;
    font-size: 18px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 160px;
}

    .start-btn:disabled {
        background: #ccc;
        cursor: not-allowed;
        opacity: 0.6;
    }

    .start-btn:hover:not(:disabled) {
        background: #38a169;
        transform: scale(1.02);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

/* ===== ПОДСКАЗКА ДЛЯ ВЫБОРА 3 КАРТИНОК ===== */
.tip-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

/* ===== ПЛАВАЮЩАЯ ПОДСКАЗКА ПРИ ПРОКРУТКЕ ===== */
.tip-floating {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

    .tip-floating.visible {
        opacity: 1;
        pointer-events: auto;
    }

.tip {
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    width: auto;
    max-width: 340px;
    min-width: 260px;
    padding: 10px 20px;
    border-radius: 40px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: inline-block;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe0b3 100%);
    color: #e65100;
    border-bottom: 3px solid #ff9800;
}

    .tip.active {
        background: linear-gradient(135deg, #ffe6e6 0%, #ffb3b3 100%);
        color: #c62828;
        border-bottom: 3px solid #f44336;
        animation: pulseLight 1.5s infinite;
    }

    .tip.success {
        background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
        color: #2e7d32;
        border-bottom: 3px solid #4caf50;
    }

@keyframes pulseLight {
    0%, 100% {
        opacity: 0.9;
        box-shadow: 0 2px 8px rgba(198, 40, 40, 0.2);
    }

    50% {
        opacity: 1;
        box-shadow: 0 4px 12px rgba(198, 40, 40, 0.4);
        transform: scale(1.01);
    }
}


/* Стили кнопки "Старт" (можно оставить как есть или сделать крупнее) */
.start-btn {
    padding: 12px 32px;
    font-size: 18px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 160px;
}

    .start-btn:disabled {
        background: #ccc;
        cursor: not-allowed;
        opacity: 0.6;
    }

    .start-btn:hover:not(:disabled) {
        background: #38a169;
        transform: scale(1.02);
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }


@media (max-width: 480px) {
    .tip {
        white-space: normal;
        max-width: 260px;
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Кнопка "Вернуться к выбору" - увеличенная */
.return-btn {
    font-family: 'Comfortaa', cursive;
    padding: 18px 40px;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(180deg, #a5b4fc 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.1s ease;
    margin-top: 20px;
    min-width: 240px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 5px 0 #4338ca, 0 8px 15px rgba(99, 102, 241, 0.35);
    position: relative;
    top: 0;
}

    .return-btn:hover {
        transform: translateY(-2px);
        background: linear-gradient(180deg, #c7d2fe 0%, #818cf8 100%);
        box-shadow: 0 7px 0 #4338ca, 0 10px 20px rgba(99, 102, 241, 0.4);
    }

    .return-btn:active {
        top: 5px;
        transform: translateY(0);
        box-shadow: 0 0 0 #4338ca, 0 2px 6px rgba(99, 102, 241, 0.3);
    }


/* ===== ШАПКА ТАБЛИЦЫ КАРТИНОК ===== */
.images-header {
    display: grid;
    grid-template-columns: 100px 1fr 100px 100px 180px;
    gap: 15px;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    color: white;
    border-radius: 24px;
    font-weight: 700;
    font-size: 14px;
    margin: 20px 10px 15px 10px;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.3px;
}

.header-col {
    text-align: center;
}

    .header-col.col-title {
        text-align: left;
        padding-left: 15px;
    }

/* ===== СПИСОК КАРТИНОК ===== */
.images-list {
    background: transparent;
    padding: 0 10px;
    margin-bottom: 20px;
}

/* Карточка-строка картинки */
.image-item {
    display: grid;
    grid-template-columns: 100px 1fr 100px 100px 180px;
    gap: 15px;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: #ffffff;
    border-radius: 24px;
    border: 3px solid #e0e7ff;
    box-shadow: 0 4px 0 #c7d2fe, 0 6px 12px rgba(102, 126, 234, 0.15);
    transition: all 0.25s ease;
}

    /* При наведении — «подпрыгивает» */
    .image-item:hover {
        transform: translateY(-3px);
        border-color: #a5b4fc;
        box-shadow: 0 7px 0 #c7d2fe, 0 10px 20px rgba(102, 126, 234, 0.25);
    }

    /* Чередование оттенков для визуального разделения */
    .image-item:nth-child(even) {
        background: #fefeff;
        border-color: #ddd6fe;
    }

        .image-item:nth-child(even):hover {
            border-color: #c4b5fd;
        }

    .image-item:last-child {
        border-bottom: 3px solid #e0e7ff;
    }

/* Картинка внутри карточки — круглая с обводкой */
.image-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 20px;
    border: 4px solid #fef3c7;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.image-info {
    text-align: left;
    padding-left: 5px;
}

.image-title {
    font-weight: 700;
    font-size: 22px;
    color: #4338ca;
    letter-spacing: 0.2px;
}

.cell {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===== БЕЙДЖ СЧЁТЧИКА ===== */
.streak-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 14px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 18px;
    transition: all 0.25s ease;
    border: 3px solid transparent;
}

    .streak-badge.streak-zero {
        background: #f1f5f9;
        color: #94a3b8;
        border-color: #e2e8f0;
        box-shadow: 0 2px 0 #cbd5e1;
    }

    .streak-badge.streak-low {
        background: #fef3c7;
        color: #d97706;
        border-color: #fcd34d;
        box-shadow: 0 2px 0 #fbbf24;
    }

    .streak-badge.streak-medium {
        background: #fed7aa;
        color: #ea580c;
        border-color: #fb923c;
        box-shadow: 0 2px 0 #f97316;
    }

    .streak-badge.streak-high {
        background: #d1fae5;
        color: #059669;
        border-color: #34d399;
        box-shadow: 0 2px 0 #10b981, 0 0 12px rgba(16, 185, 129, 0.4);
    }

/* ===== УВЕДОМЛЕНИЕ ===== */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #48bb78;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideInUp 0.3s ease-out;
    white-space: nowrap;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== ИНСТРУКЦИЯ НАД КАРТИНКОЙ ===== */
.test-instruction {
    font-size: 18px;
    color: #4a5568;
    text-align: center;
    padding: 12px 20px;
    margin: 15px auto 20px auto;
    max-width: 600px;
    font-style: italic;
}

@media (max-width: 768px) {
    .test-instruction {
        font-size: 16px;
        padding: 12px 16px;
        margin: 15px auto 20px auto;
    }
}


.finished-message {
    text-align: center;
    padding: 40px 20px;
}

    .finished-message h2 {
        font-size: 32px;
        color: #2d3748;
        margin-bottom: 30px;
    }

    .finished-message .return-btn {
        padding: 14px 40px;
        font-size: 18px;
        font-weight: bold;
        background: #667eea;
        color: white;
        border: none;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        min-width: 240px;
    }

        .finished-message .return-btn:hover {
            background: #5a67d8;
            transform: scale(1.02);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .finished-message .return-btn:active {
            transform: scale(0.98);
        }


/* ===== ФАЗА 2 ===== */
.phase2-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.phase2-images {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

.phase2-image-item {
    flex: 1;
    max-width: 300px;
}

    .phase2-image-item img {
        width: 100%;
        height: 250px;
        object-fit: cover;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        transition: transform 0.2s ease;
    }

/* Стимул (название картинки, показывается на 0.3 сек) */
.stimulus-display {
    min-height: 50px;
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    opacity: 0;
    transition: opacity 0.1s ease;
    margin: 10px 0;
    letter-spacing: 1px;
}

    .stimulus-display.visible {
        opacity: 1;
    }

/* Кнопки фазы 2 */
.phase2-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center; /* ← выравнивание по центру */
    margin-top: 30px;
    flex-wrap: wrap;
    min-height: 56px; /* ← фиксируем высоту контейнера */
}


/* ============================================ */
/* КНОПКИ ФАЗЫ 2 — общие и раздельные стили     */
/* ============================================ */

/* Общая база для всех 4 кнопок */
.phase2-btn {
    font-family: 'Comfortaa', cursive;
    font-size: 17px;
    font-weight: 700;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.1s ease;
    color: white;
    min-width: 150px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    padding: 15px 30px;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    top: 0;
}

    /* Общая база — hover/active для всех */
    .phase2-btn:hover {
        transform: translateY(-2px);
        filter: brightness(1.05);
    }

    .phase2-btn:active {
        top: 5px;
        transform: translateY(0);
        filter: brightness(0.95);
    }

    /* Кнопка "Стимул" — синяя */
    .phase2-btn.stimulus {
        background: linear-gradient(180deg, #a5b4fc 0%, #6366f1 100%);
        box-shadow: 0 5px 0 #4338ca, 0 8px 15px rgba(99, 102, 241, 0.35);
    }

        .phase2-btn.stimulus:active {
            box-shadow: 0 0 0 #4338ca, 0 2px 6px rgba(99, 102, 241, 0.3);
        }

    /* Кнопка "Правильно" — зелёная */
    .phase2-btn.correct {
        background: linear-gradient(180deg, #86efac 0%, #22c55e 100%);
        box-shadow: 0 5px 0 #15803d, 0 8px 15px rgba(34, 197, 94, 0.35);
    }

        .phase2-btn.correct:active {
            box-shadow: 0 0 0 #15803d, 0 2px 6px rgba(34, 197, 94, 0.3);
        }

    /* Кнопка "Подсказка" — оранжевая */
    .phase2-btn.hint {
        background: linear-gradient(180deg, #fdba74 0%, #f97316 100%);
        box-shadow: 0 5px 0 #c2410c, 0 8px 15px rgba(249, 115, 22, 0.35);
    }

        .phase2-btn.hint:active {
            box-shadow: 0 0 0 #c2410c, 0 2px 6px rgba(249, 115, 22, 0.3);
        }

    /* Кнопка "Неправильно" — красная */
    .phase2-btn.incorrect {
        background: linear-gradient(180deg, #fca5a5 0%, #ef4444 100%);
        box-shadow: 0 5px 0 #b91c1c, 0 8px 15px rgba(239, 68, 68, 0.35);
    }

        .phase2-btn.incorrect:active {
            box-shadow: 0 0 0 #b91c1c, 0 2px 6px rgba(239, 68, 68, 0.3);
        }


/* Результат */
.phase2-result {
    text-align: center;
    padding: 30px 20px;
}

    .phase2-result h2 {
        font-size: 28px;
        color: #2d3748;
        margin-bottom: 30px;
    }

.chart {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    height: 320px;
    padding: 20px 40px;
    background: #f7fafc;
    border-radius: 16px;
    margin-bottom: 30px;
}

.chart-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 140px;
    height: 100%;
}

.chart-bar-wrapper {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.chart-bar {
    width: 80px;
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: all 0.5s ease;
    min-height: 4px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5px;
}

    .chart-bar.bar-correct {
        background: #48bb78;
    }

    .chart-bar.bar-hint {
        background: #ed8936;
    }

    .chart-bar.bar-incorrect {
        background: #f56565;
    }

.bar-count {
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.chart-label {
    margin-top: 10px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    text-align: center;
}

.chart-percent {
    margin-top: 6px;
    font-size: 16px;  /* ← было 12px, стало 18px */
    font-weight: 700; /* ← жирный */
    color: #2d3748;   /* ← темнее для контраста */
}

/* Мобильная версия */
@media (max-width: 768px) {
    .phase2-images {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .phase2-image-item {
        max-width: 90%;
    }

    .phase2-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-width: 120px;
        height: 48px; /* ← тоже фиксируем на мобильных */
    }

    .stimulus-display {
        font-size: 24px;
    }

    .image-item {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 20px;
        gap: 10px;
        background: #f9fafb;
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .image-thumb {
        margin: 0 auto;
    }

    .cell {
        justify-content: center;
    }

    .streak-badge {
        min-width: 60px;
    }

    .bar-count {
        font-size: 16px;
    }

    .images-header {
        display: none; /* Скрываем шапку на мобильных */
    }

    .chart-percent {
        font-size: 16px; /* ← чуть меньше, но всё ещё жирный */
        font-weight: 700;
    }

    .chart {
        gap: 15px;
        padding: 15px;
        height: 260px;
    }

    .chart-bar {
        width: 50px;
    }

    .actions-top-inner {
        padding: 10px 16px;
        gap: 8px;
    }

    .tip {
        white-space: normal;
        max-width: 260px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .start-btn {
        padding: 10px 24px;
        font-size: 16px;
        min-width: 140px;
    }
}
/* ===== ЮРИДИЧЕСКИЕ СТРАНИЦЫ ===== */
.legal-container {
    max-width: 800px;
    margin: 40px auto;
    background: white;
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: 'Nunito', sans-serif;
    color: #2d3748;
    line-height: 1.7;
}

    .legal-container h1 {
        font-size: 28px;
        color: #4338ca;
        margin-bottom: 10px;
        text-align: center;
    }

    .legal-container h2 {
        font-size: 20px;
        color: #4338ca;
        margin-top: 30px;
        margin-bottom: 10px;
    }

    .legal-container p,
    .legal-container li {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .legal-container ul {
        margin-left: 20px;
        margin-bottom: 15px;
    }

    .legal-container a {
        color: #6366f1;
        text-decoration: underline;
    }

.legal-date {
    text-align: center;
    color: #718096;
    font-size: 14px;
    margin-bottom: 30px;
}

.back-link {
    display: inline-block;
    font-size: 15px;
    color: #6366f1;
    text-decoration: none;
    margin-bottom: 20px;
}

    .back-link:hover {
        text-decoration: underline;
    }

.legal-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #718096;
    font-size: 14px;
}

@media (max-width: 768px) {
    .legal-container {
        margin: 20px 10px;
        padding: 25px 20px;
    }

        .legal-container h1 {
            font-size: 22px;
        }

        .legal-container h2 {
            font-size: 17px;
        }
}

/* ===== ФУТЕР ===== */
.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: auto; /* ← прижимает футер к низу страницы */
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-family: 'Nunito', sans-serif;
}

    .site-footer a {
        color: rgba(255, 255, 255, 0.9);
        text-decoration: underline;
    }

        .site-footer a:hover {
            color: white;
        }

    .site-footer p {
        margin: 5px 0;
    }


/* ===== ЧЕКБОКС СОГЛАСИЯ ===== */
.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #4a5568;
    cursor: pointer;
    line-height: 1.4;
    margin: 10px 0;
    text-align: left; /* Выравниваем текст по левому краю */
    width: 100%;
}

    .consent-label input[type="checkbox"] {
        margin-top: 2px;
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        cursor: pointer;
        accent-color: #6366f1; /* Делает галочку фиолетовой */
    }

    /* Текст внутри label */
    .consent-label span {
        flex: 1;
    }

    .consent-label a {
        color: #6366f1;
        text-decoration: underline;
        white-space: nowrap; /* Запрещаем разрывать сами ссылки (например, "Пользовательское соглашение") */
    }

/* На мобильных устройствах разрешаем перенос ссылок, если не влезают */
@media (max-width: 480px) {
    .consent-label a {
        white-space: normal;
    }
}



.auth-content {
    flex: 1; /* Растягивает блок на всё свободное пространство */
    display: flex;
    justify-content: center; /* Центрирует по горизонтали */
    align-items: center; /* Центрирует по вертикали */
    padding: 20px; /* Отступы для мобильных, чтобы окно не прилипало к краям */
}

/* На всякий случай убедимся, что body работает правильно */
.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* ===== СТРАНИЦА ВЫБОРА РЕБЕНКА ===== */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.child-card {
    background: white;
    padding: 30px 20px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 3px solid transparent;
    transition: all 0.2s;
}

    .child-card:hover {
        border-color: #6366f1;
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
    }

.child-avatar {
    width: 80px;
    height: 80px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    margin: 0 auto 15px auto;
}

.child-name {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.add-child-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    margin: 0 auto;
}

    .add-child-card h3 {
        margin-bottom: 20px;
        color: #4338ca;
    }

    .add-child-card form {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .add-child-card input {
        padding: 12px;
        border: 2px solid #e0e7ff;
        border-radius: 10px;
        font-size: 16px;
    }


/* Ссылка "Сменить" рядом с именем ребенка */
.change-child-link {
    font-size: 14px;
    margin-left: 15px;
    color: #6366f1;
    text-decoration: underline;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
}

    .change-child-link:hover {
        color: #4338ca;
    }