/* ==================== HTML TEST STYLES ==================== */
/* Кольори Koodi: pink #FF4E99, orange #FF9F00, lime #C6DF2B, blue #009DFF */
/* HTML: #E34F26 */

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

body {
    font-family: 'Rubik', sans-serif;
    background: #faf9f7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== FLYING SQUARES ==================== */
.flying-squares {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.flying-square {
    position: absolute;
    border-radius: 10px;
    opacity: 0;
    animation: floatUp linear infinite;
}

.flying-square:nth-child(1) { width: 50px; height: 50px; background: #E34F26; left: 5%; animation-duration: 22s; animation-delay: 0s; }
.flying-square:nth-child(2) { width: 35px; height: 35px; background: #FF9F00; left: 15%; animation-duration: 18s; animation-delay: -4s; }
.flying-square:nth-child(3) { width: 70px; height: 70px; background: #C6DF2B; left: 30%; animation-duration: 28s; animation-delay: -8s; }
.flying-square:nth-child(4) { width: 25px; height: 25px; background: #FF4E99; left: 45%; animation-duration: 20s; animation-delay: -2s; }
.flying-square:nth-child(5) { width: 45px; height: 45px; background: #009DFF; left: 60%; animation-duration: 25s; animation-delay: -6s; }
.flying-square:nth-child(6) { width: 60px; height: 60px; background: #E34F26; left: 75%; animation-duration: 23s; animation-delay: -10s; }
.flying-square:nth-child(7) { width: 30px; height: 30px; background: #C6DF2B; left: 85%; animation-duration: 19s; animation-delay: -3s; }
.flying-square:nth-child(8) { width: 55px; height: 55px; background: #FF4E99; left: 95%; animation-duration: 26s; animation-delay: -7s; }

@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    5% { opacity: 0.15; }
    95% { opacity: 0.15; }
    100% { transform: translateY(-150px) rotate(360deg); opacity: 0; }
}

/* ==================== LOGIN WARNING ==================== */
.login-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #E34F26, #FF4E99);
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

.login-warning i {
    font-size: 1.1rem;
}

.login-warning__link {
    color: white;
    background: rgba(255,255,255,0.2);
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.login-warning__link:hover {
    background: rgba(255,255,255,0.3);
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ==================== HEADER ==================== */
.test-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background: transparent;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #131010;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.3s;
    border: 2px solid #131010;
}

.back-btn:hover {
    background: #131010;
    color: white;
}

.header-logo img {
    height: 125px;
}

/* ==================== TEST CONTAINER ==================== */
.test-container {
    position: relative;
    z-index: 10;
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
}

.test-screen {
    animation: fadeIn 0.4s ease;
}

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

/* ==================== INTRO SCREEN ==================== */
.test-intro {
    text-align: center;
}

.intro-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.test-intro h1 {
    font-size: 2.5rem;
    color: #131010;
    margin-bottom: 15px;
}

.test-intro > p {
    font-size: 1.15rem;
    color: #666;
    margin-bottom: 40px;
}

.intro-levels {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.intro-level {
    background: white;
    padding: 25px 30px;
    border-radius: 16px;
    border: 3px solid #131010;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    transition: all 0.3s;
}

.intro-level:hover {
    transform: translateY(-5px);
}

.intro-level--junior { background: #C6DF2B20; }
.intro-level--middle { background: #009DFF20; }
.intro-level--senior { background: #FF4E9920; }

.intro-level__icon {
    font-size: 2rem;
}

.intro-level__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #131010;
}

.intro-level__desc {
    font-size: 0.85rem;
    color: #666;
}

.intro-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}

.intro-info__item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 1rem;
}

.intro-info__item i {
    color: #E34F26;
}

.start-test-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #E34F26;
    color: white;
    border: 3px solid #131010;
    padding: 18px 45px;
    border-radius: 14px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Rubik', sans-serif;
}

.start-test-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(227, 79, 38, 0.3);
}

/* ==================== QUESTION SCREEN ==================== */
.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #E34F26, #FF9F00);
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 10%;
}

.progress-text {
    font-weight: 600;
    color: #131010;
    min-width: 60px;
    text-align: right;
}

.question-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    border: 3px solid #131010;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.question-number {
    display: inline-block;
    background: #E34F26;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.4rem;
    color: #131010;
    margin-bottom: 30px;
    line-height: 1.5;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #faf9f7;
    border: 2px solid #e0e0e0;
    padding: 18px 24px;
    border-radius: 14px;
    font-size: 1.05rem;
    color: #131010;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-family: 'Rubik', sans-serif;
}

.answer-btn:hover {
    border-color: #E34F26;
    background: #E34F2610;
}

.answer-btn.selected {
    border-color: #E34F26;
    background: #E34F2620;
}

.answer-btn.correct {
    border-color: #C6DF2B;
    background: #C6DF2B30;
}

.answer-btn.incorrect {
    border-color: #FF4E99;
    background: #FF4E9930;
}

.answer-letter {
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid #131010;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.answer-btn.selected .answer-letter {
    background: #E34F26;
    color: white;
}

.answer-btn.correct .answer-letter {
    background: #C6DF2B;
}

.answer-btn.incorrect .answer-letter {
    background: #FF4E99;
    color: white;
}

/* ==================== NAVIGATION ==================== */
.question-nav {
    display: flex;
    justify-content: flex-end;
    margin-top: 25px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Rubik', sans-serif;
    border: 3px solid #131010;
}

.nav-btn--next {
    background: #E34F26;
    color: white;
}

.nav-btn--next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(227, 79, 38, 0.3);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== RESULT SCREEN ==================== */
.test-result {
    text-align: center;
}

.result-card {
    background: white;
    border-radius: 24px;
    padding: 50px 40px;
    border: 3px solid #131010;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.result-level {
    font-size: 3rem;
    color: #131010;
    margin-bottom: 10px;
}

.result-score {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.result-description {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 35px;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.result-card--junior { background: linear-gradient(135deg, #C6DF2B20, white); }
.result-card--middle { background: linear-gradient(135deg, #009DFF20, white); }
.result-card--senior { background: linear-gradient(135deg, #FF4E9920, white); }

.start-learning-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #E34F26;
    color: white;
    border: 3px solid #131010;
    padding: 18px 40px;
    border-radius: 14px;
    font-size: 1.15rem;
    box-shadow: 4px 4px 0 #1a1a2e;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Rubik', sans-serif;
    margin-bottom: 20px;
}

.start-learning-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(227, 79, 38, 0.3);
}

.start-learning-btn--junior { background: #C6DF2B; color: #131010; }
.start-learning-btn--middle { background: #009DFF; color: white; }
.start-learning-btn--senior { background: #FF4E99; color: white; }

.retake-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #666;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Rubik', sans-serif;
}

.retake-btn:hover {
    color: #131010;
}

/* ==================== CONFETTI ==================== */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .test-header {
        padding: 15px 20px;
    }
    
    .back-btn span {
        display: none;
    }
    
    .test-container {
        padding: 20px 15px;
    }
    
    .intro-icon {
        font-size: 4rem;
    }
    
    .test-intro h1 {
        font-size: 1.8rem;
    }
    
    .intro-levels {
        flex-direction: column;
        align-items: center;
    }
    
    .intro-level {
        width: 100%;
        max-width: 280px;
    }
    
    .question-card {
        padding: 25px 20px;
    }
    
    .question-text {
        font-size: 1.15rem;
    }
    
    .answer-btn {
        padding: 14px 18px;
        font-size: 0.95rem;
    }
    
    .result-card {
        padding: 35px 25px;
    }
    
    .result-level {
        font-size: 2.2rem;
    }
}