/* Основные переменные для цветовой схемы */
:root {
    --primary-color: #003366;
    --secondary-color: #0066cc;
    --accent-color: #ffd700;
    --text-primary: #ffffff;
    --text-secondary: #e6f2ff;
    --gradient-primary: linear-gradient(135deg, #003366 0%, #0066cc 50%, #004080 100%);
    --shadow-light: 0 4px 20px rgba(0, 51, 102, 0.3);
    --shadow-strong: 0 8px 40px rgba(0, 51, 102, 0.5);
}

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    background: var(--gradient-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Стартовый экран: по умолчанию скрыт, показывается только с классом active */
#loading-screen {
    display: none;
}

/* Когда loading-screen активен, применяем полноэкранный оверлей */
.screen.active#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--gradient-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.8s ease-in-out;
}

/* loading-content */
.loading-content {
    text-align: center;
    max-width: 600px;
    padding: 40px 20px;
    animation: slideInUp 1.2s ease-out;
}

.government-logo {
    width: 150px;
    height: 135px;
    margin: 0 auto 30px;
    background-color: transparent;  /*прозрачный фон */
    background-image: url('logo_kc.png'); /* логотип в той же папке static */
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;  /*подгоняем размер логотипа внутри круга */
    /*border-radius: 80%;  при необходимости можно убрать */
    display: block;
    /* box-shadow: var(--shadow-strong);*/
    animation: pulse 2s infinite;
    overflow: hidden;
}

.government-logo::before { content: none; }

.main-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 1.5s ease-out 0.3s both;
}

.subtitle {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 40px;
    animation: fadeInScale 1.5s ease-out 0.6s both;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 7px solid rgba(255, 255, 255, 0.3);
    border-top: 7px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.loading-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 20px;
    animation: fadeInOut 2s ease-in-out infinite;
}

/* Стили для основных экранов */
.screen {
    display: none;
    min-height: 100vh;
    padding: 40px 20px;
    background: var(--gradient-primary);
}

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

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

.welcome-header {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-light);
}

.welcome-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: left;
    backdrop-filter: blur(5px);
}

.welcome-card h2 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.welcome-card p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.competency-list {
    margin: 20px 0;
    padding-right: 0;
}

.competency-item {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

.competency-item input {
    margin-right: 10px;
}

.welcome-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.welcome-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.user-greeting {
    font-size: 18px;
    color: var(--accent-color);
    font-weight: 600;
}

/* Стили для кнопок */
.btn {
    background: linear-gradient(45deg, var(--accent-color), #ffed4e);
    color: var(--primary-color);
    border: none;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 15px;
    min-width: 250px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
    filter: brightness(110%);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Стили для ошибок */
.error-message {
    background: linear-gradient(45deg, #ff4757, #ff6b7d);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    box-shadow: var(--shadow-light);
}

/* Экран опроса: выравнивание по колонке */
#survey-screen .main-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Онбординг оверлей */
.onboarding-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 1200;
    display: none;
    padding: 30px 15px;
    overflow-y: auto;
}
.onboarding-overlay.active { display: block; }
.onboarding-content {
    max-width: 820px;
    margin: 0 auto;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 30px 25px 35px;
    backdrop-filter: blur(8px);
}
.onboarding-content h1 {
    font-size: 26px;
    margin-bottom: 18px;
    color: var(--accent-color);
}
.onboarding-content h2 {
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--accent-color);
}
.onboarding-content p, .onboarding-content li {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-secondary);
}
.onboarding-close {
    display: inline-block;
    margin-top: 25px;
}

/* Кнопки онбординга на главном экране */
.onboarding-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 20px;
}
.onboarding-buttons .btn-mini {
    min-width: unset;
    padding: 10px 18px;
    font-size: 14px;
    letter-spacing: .5px;
    margin: 0;
    background: rgba(255,255,255,0.18);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 10px;
}
.onboarding-buttons .btn-mini:hover {
    background: rgba(255,255,255,0.28);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

/* Адаптивность */
@media (max-width: 768px) {
    .main-title {
        font-size: 24px;
    }

    .subtitle {
        font-size: 16px;
    }

    .welcome-title {
        font-size: 28px;
    }

    .welcome-subtitle {
        font-size: 18px;
    }

    .btn {
        padding: 15px 30px;
        font-size: 16px;
        min-width: 200px;
    }

    .government-logo {
        width: 100px;
        height: 100px;
        background-size: 70% 70%;
    }

    .government-logo::before { content: none; }
}

@media (max-width: 480px) {
    .loading-content,
    .welcome-header {
        padding: 20px;
    }

    .main-title {
        font-size: 20px;
    }

    .welcome-title {
        font-size: 24px;
    }

    .government-logo {
        width: 80px;
        height: 80px;
        background-size: 72% 72%;
    }
}
