:root {
    /* Цвета Движения Первых из брендбука */
    --brand-red: #d90912;
    --brand-blue: #3366CC;
    --brand-black: #000000;
    --brand-white: #ffffff;
    
    /* Дополнительные оттенки */
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border: #e0e0e0;
    
    /* Шрифты (аналоги Pervye) */
    --font-heading: 'Montserrat', 'Arial Black', sans-serif;
    --font-body: 'Open Sans', 'Arial', sans-serif;
    --font-code: 'Fira Code', 'Courier New', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

.content-locked > *:not(#loginModal) { display: none !important; }

/* Header с логотипом Движения */
.header {
    background: var(--brand-white);
    border-bottom: 3px solid var(--brand-red);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo .brand-icon {
    width: 40px;
    height: 40px;
    background: var(--brand-red);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
}

.logo-text {
    color: var(--brand-black);
}

.logo-text .highlight {
    color: var(--brand-red);
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a:not(.btn) {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav a:not(.btn):hover {
    color: var(--brand-red);
}

/* Кнопки в стиле Движения */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--brand-red);
    color: white;
}

.btn-primary:hover {
    background: #b80810;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 9, 18, 0.3);
}

.btn-secondary {
    background: var(--brand-blue);
    color: white;
}

.btn-secondary:hover {
    background: #2952a3;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--brand-red);
    color: var(--brand-red);
}

.btn-outline:hover {
    background: var(--brand-red);
    color: white;
}

.btn-block { width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* Hero секция */
.hero {
    padding: 5rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--brand-white) 0%, #f0f0f0 100%);
    border-bottom: 4px solid var(--brand-red);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--brand-black);
    line-height: 1.2;
}

.hero h1 .accent {
    color: var(--brand-red);
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    font-family: var(--font-body);
}

.hero-note {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Карточки */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(217, 9, 18, 0.15);
    border-color: var(--brand-red);
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--brand-black);
}

.card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-box {
    background: var(--brand-white);
    border: 3px solid var(--brand-red);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-box h3 {
    font-family: var(--font-heading);
    color: var(--brand-red);
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand-red);
}

.tab-switcher {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.3s;
    font-family: var(--font-heading);
}

.tab-btn.active {
    color: var(--brand-red);
    border-bottom: 3px solid var(--brand-red);
}

.demo-hint {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fff3f3;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.6;
    border-left: 4px solid var(--brand-red);
}

/* Поиск и фильтрация */
.search-filter-section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    margin: 3rem auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border: 2px solid var(--border);
}

.search-filter-section h2 {
    font-family: var(--font-heading);
    color: var(--brand-red);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.search-filter-header {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(217, 9, 18, 0.1);
}

.filter-select {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}

.filter-select:focus {
    outline: none;
    border-color: var(--brand-red);
}

.submit-material-btn {
    background: linear-gradient(135deg, #FFD43B 0%, #f0c419 100%);
    color: #1e293b;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-heading);
}

.submit-material-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 212, 59, 0.3);
}

/* Структура курсов и модулей */
.course-structure {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    border: 2px solid var(--border);
}

.course-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--brand-red);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--brand-red);
}

.module {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 4px solid var(--brand-blue);
}

.module-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--brand-blue);
    margin-bottom: 1rem;
    font-weight: 700;
}

.lesson-list {
    list-style: none;
}

.lesson-item {
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-main);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    cursor: pointer;
}

.lesson-item:hover {
    background: #fff3f3;
    transform: translateX(5px);
}

.lesson-item.completed {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.lesson-item .lesson-name {
    font-weight: 600;
    color: var(--text-primary);
}

.lesson-item .lesson-status {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    background: var(--brand-red);
    color: white;
    font-weight: 600;
}

.lesson-item.completed .lesson-status {
    background: #4caf50;
}

/* Личный кабинет */
.profile-section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    border: 2px solid var(--border);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: var(--brand-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    font-weight: 800;
    font-family: var(--font-heading);
}

.profile-info h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.profile-info p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.role-badge {
    display: inline-block;
    background: var(--brand-red);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: var(--bg-main);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand-red);
    font-family: var(--font-heading);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Таблица модерации */
.mod-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.mod-table th, .mod-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.mod-table th {
    background: var(--bg-main);
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.pending {
    background: #fff3cd;
    color: #856404;
}

.badge.approved {
    background: #d4edda;
    color: #155724;
}

.badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Модальное окно для форм */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--brand-white);
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Футер с логотипом Движения */
.footer {
    background: var(--brand-black);
    color: var(--brand-white);
    padding: 3rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-logo .red { color: var(--brand-red); }

.footer p {
    color: #999;
    font-size: 0.9rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .grid-3 { grid-template-columns: 1fr; }
    .search-filter-header { flex-direction: column; }
    .profile-header { flex-direction: column; text-align: center; }
}