/* 
 * Linavos Mokymo Centras - Testing Platform
 * Brand-aligned color scheme
 */

/* CSS Variables */
:root {
    /* Brand Colors */
    --brand-primary: #1a3a6e;      /* Linavos dark blue */
    --brand-secondary: #2a4a7e;    /* Lighter blue */
    --brand-accent-yellow: #f7b731; /* Star yellow */
    --brand-accent-green: #2d8f4e;  /* Star green */
    --brand-accent-red: #d63031;    /* Star red */
    
    /* Background Colors */
    --bg-primary: #0d1a2d;         /* Dark navy background */
    --bg-secondary: #132238;        /* Slightly lighter navy */
    --bg-card: #1a3050;            /* Card background */
    --bg-card-hover: #1f3a5c;      /* Card hover */
    --bg-input: #162a45;           /* Input background */
    
    /* Text Colors */
    --text-primary: #f0f4f8;
    --text-secondary: #a0b4c8;
    --text-muted: #607890;
    
    /* Accent Colors */
    --accent-primary: #4a9fff;      /* Bright blue accent */
    --accent-secondary: #3a8fef;
    --accent-glow: rgba(74, 159, 255, 0.25);
    
    /* Status Colors */
    --success: #2ecc71;
    --error: #e74c3c;
    --warning: #f7b731;
    
    /* Border */
    --border-color: rgba(74, 159, 255, 0.15);
    --border-hover: rgba(74, 159, 255, 0.3);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4a9fff 0%, #2a7fdf 100%);
    --gradient-brand: linear-gradient(135deg, #1a3a6e 0%, #2a5a9e 100%);
    --gradient-dark: linear-gradient(180deg, #132238 0%, #0d1a2d 100%);
    --gradient-card: linear-gradient(145deg, rgba(26, 48, 80, 0.9), rgba(19, 34, 56, 0.95));
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);
    
    /* Typography */
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Effects */
.bg-gradient {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(74, 159, 255, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(26, 58, 110, 0.2), transparent);
    pointer-events: none;
    z-index: -3;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(74, 159, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 159, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -2;
}

.bg-noise {
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: -1;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: flex;
}

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

/* ===== LOGIN SCREEN ===== */
#login-screen {
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.logo-section {
    text-align: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 100px;
    background: transparent;
    border-radius: var(--radius-lg);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-icon {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.brand-subtitle {
    font-size: 1rem;
    color: var(--accent-primary);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.login-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    margin-bottom: 1.75rem;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.card-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Input Styles */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-right: 3rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-primary);
    transition: var(--transition-normal);
}

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

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    background: linear-gradient(135deg, #5aafff 0%, #3a8fef 100%);
}

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

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-arrow {
    transition: transform var(--transition-fast);
}

.btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* Loading State */
.btn.loading .btn-text,
.btn.loading .btn-arrow {
    opacity: 0;
}

.btn.loading .btn-loader {
    opacity: 1;
}

.btn-loader {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
}

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

/* Error Message */
.error-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.875rem;
    display: none;
}

.error-message.visible {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-footer {
    text-align: center;
}

.login-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== START SCREEN ===== */
#start-screen {
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.start-container {
    width: 100%;
    max-width: 500px;
}

.info-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--accent-glow);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
}

.info-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.code-display {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-primary);
}

.info-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.status-badge.new {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-primary);
}

.status-badge.review {
    background: rgba(255, 217, 61, 0.15);
    color: var(--warning);
}

.info-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 217, 61, 0.1);
    border: 1px solid rgba(255, 217, 61, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    color: var(--warning);
    font-size: 0.875rem;
}

.info-notice svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Result Preview on Start Screen */
.result-preview {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(46, 204, 113, 0.05));
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: var(--radius-md);
}

.result-preview-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--success);
    font-size: 0.95rem;
}

.result-preview-content svg {
    flex-shrink: 0;
}

.result-preview-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.info-actions {
    display: flex;
    gap: 1rem;
}

.info-actions .btn {
    flex: 1;
}

/* ===== TEST SCREEN ===== */
#test-screen {
    flex-direction: column;
}

.test-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    padding: 1rem;
}

/* Test Header */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    margin-bottom: 1.5rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Review Badge */
.review-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: rgba(247, 183, 49, 0.15);
    color: var(--warning);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Legend Hint - Bottom tooltip */
.legend-hint {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    position: relative;
}

.legend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.legend-toggle:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.legend-popup {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

.legend-hint:hover .legend-popup,
.legend-popup:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.legend-popup-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    min-width: 240px;
}

.legend-popup-content::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--bg-card);
}

.legend-popup-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.legend-popup-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-popup-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-dot-correct {
    background: var(--success);
}

.legend-dot-incorrect {
    background: var(--error);
}

.legend-dot-missed {
    background: var(--warning);
}

.question-counter {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.question-counter .separator {
    color: var(--text-muted);
    margin: 0 0.25rem;
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-primary);
    padding: 0.5rem 1rem;
    background: var(--accent-glow);
    border-radius: var(--radius-sm);
}

.timer.warning {
    color: var(--warning);
    background: rgba(255, 217, 61, 0.15);
}

.timer.danger {
    color: var(--error);
    background: rgba(255, 107, 107, 0.15);
    animation: pulse 1s ease infinite;
}

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

/* Question Area */
.question-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.question-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
}

.question-number {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--accent-glow);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.question-image {
    margin-top: 1rem;
}

.question-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Answer Options */
.answers-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
}

.answer-option:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.answer-option.selected {
    border-color: var(--accent-primary);
    background: rgba(74, 159, 255, 0.1);
}

.answer-checkbox {
    position: relative;
    flex-shrink: 0;
}

.answer-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition-fast);
}

.checkmark::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 3px;
    opacity: 0;
    transform: scale(0);
    transition: var(--transition-fast);
}

.answer-option.selected .checkmark {
    border-color: var(--accent-primary);
}

.answer-option.selected .checkmark::after {
    opacity: 1;
    transform: scale(1);
}

.answer-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    cursor: pointer;
}

.answer-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-input);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.answer-option.selected .answer-letter {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.answer-text {
    flex: 1;
    padding-top: 0.25rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===== REVIEW MODE STATES ===== */

/* Correct answer that user selected - green letter, green checkbox */
.answer-option.correct-selected {
    border-color: var(--success);
    background: rgba(46, 204, 113, 0.1);
}

.answer-option.correct-selected .answer-letter {
    background: var(--success);
    color: white;
}

.answer-option.correct-selected .checkmark {
    border-color: var(--success);
    background: var(--success);
}

.answer-option.correct-selected .checkmark::after {
    background: white;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 1;
    transform: scale(1);
}

/* Correct answer that user missed - green letter, yellow/warning checkbox */
.answer-option.correct-missed {
    border-color: var(--success);
    background: rgba(46, 204, 113, 0.05);
}

.answer-option.correct-missed .answer-letter {
    background: var(--success);
    color: white;
}

.answer-option.correct-missed .checkmark {
    border-color: var(--warning);
    background: var(--warning);
}

.answer-option.correct-missed .checkmark::after {
    background: var(--bg-primary);
    width: 10px;
    height: 3px;
    border-radius: 2px;
    opacity: 1;
    transform: scale(1);
}

/* Wrong answer that user selected - normal letter, red checkbox */
.answer-option.incorrect-selected {
    border-color: var(--error);
    background: rgba(231, 76, 60, 0.1);
}

.answer-option.incorrect-selected .answer-letter {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.answer-option.incorrect-selected .checkmark {
    border-color: var(--error);
    background: var(--error);
}

.answer-option.incorrect-selected .checkmark::after {
    background: white;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 1;
    transform: scale(1);
}

.answer-option.disabled {
    pointer-events: none;
}

.answer-image {
    margin-top: 0.75rem;
    margin-left: calc(28px + 0.75rem + 24px + 1rem);
}

.answer-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Test Footer */
.test-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    margin-top: 1.5rem;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-nav:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.btn-nav-primary {
    background: var(--accent-glow);
    border-color: transparent;
    color: var(--accent-primary);
}

.btn-nav-primary:hover:not(:disabled) {
    background: var(--gradient-primary);
    color: var(--bg-primary);
}

.btn-finish {
    background: var(--gradient-primary);
    color: white;
    padding: 0.875rem 2rem;
}

.btn-finish:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    background: linear-gradient(135deg, #5aafff 0%, #3a8fef 100%);
}

/* ===== RESULTS SCREEN ===== */
#results-screen {
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.results-container {
    width: 100%;
    max-width: 480px;
}

.results-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.results-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    background: var(--accent-glow);
    border-radius: 50%;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.results-icon.fail {
    background: rgba(255, 107, 107, 0.15);
    color: var(--error);
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.results-score {
    margin-bottom: 2rem;
}

.score-circle {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto;
}

.score-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.score-bg {
    fill: none;
    stroke: var(--bg-input);
    stroke-width: 8;
}

.score-fill {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease;
}

.score-fill.fail {
    stroke: var(--error);
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.results-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.detail-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.results-actions .btn {
    width: 100%;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 1001;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    border-color: rgba(255, 107, 107, 0.3);
    background: rgba(255, 107, 107, 0.1);
    color: var(--error);
}

.toast.success {
    border-color: rgba(0, 212, 170, 0.3);
    background: rgba(0, 212, 170, 0.1);
    color: var(--success);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .test-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-left {
        width: 100%;
        justify-content: space-between;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .progress-bar {
        flex: 1;
        max-width: 150px;
    }
    
    .timer {
        width: auto;
    }
    
    .test-footer {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .btn-nav {
        flex: 1;
        min-width: 120px;
    }
    
    .btn-finish {
        order: -1;
        width: 100%;
    }
    
    .results-details {
        grid-template-columns: 1fr;
    }
    
    .info-actions {
        flex-direction: column;
    }
    
    .legend-popup {
        left: 50%;
        transform: translateX(-50%) scale(0.95);
    }
    
    .legend-hint:hover .legend-popup {
        transform: translateX(-50%) scale(1);
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .login-card,
    .info-card,
    .results-card {
        padding: 1.5rem;
    }
    
    .question-card {
        padding: 1rem;
    }
    
    .answer-option {
        padding: 0.875rem 1rem;
    }
    
    .answer-image {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* Keyboard Navigation Focus Styles */
*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}
