:root {
    --bg: #B4C4F7;
    --deep: #3A2F71;
    --mid: #596EB1;
    --accent: #90EECA;
    --white: #ffffff;
    --text: #3A2F71;
    --radius: 20px;
    --shadow: 0 10px 30px rgba(58, 47, 113, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; }

body { background-color: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }

/* Навигация */
nav {
    background: var(--white);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.logo { font-weight: 800; font-size: 1.4rem; color: var(--deep); text-decoration: none; cursor: pointer; }

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--mid); font-weight: 600; cursor: pointer; transition: 0.3s; }
.nav-links a:hover { color: var(--deep); }

.menu-toggle { display: none; font-size: 1.8rem; cursor: pointer; color: var(--deep); }

.auth-btn { background: var(--deep); color: white !important; padding: 8px 18px; border-radius: 25px; }
.btn-admin { border: 2px solid var(--deep); padding: 6px 15px; border-radius: 20px; }

/* Контейнеры */
.container { max-width: 1100px; margin: 30px auto; padding: 0 20px; }
.narrow-container { max-width: 500px; }
.margin-top { margin-top: 30px; }

/* Карточки и сетка */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }

.card { background: var(--white); border-radius: var(--radius); padding: 25px; box-shadow: var(--shadow); position: relative; }
.hero-card { text-align: center; padding: 60px 20px; }
.hero-card h1 { font-size: 3rem; margin-bottom: 15px; color: var(--deep); }

/* Кнопки и формы */
.btn { padding: 12px 24px; border-radius: 12px; border: none; font-weight: 700; cursor: pointer; transition: 0.3s; display: inline-block; text-align: center; }
.btn-primary { background: var(--accent); color: var(--deep); }
.btn-primary:hover { background: #76dab3; }
.btn-text { background: none; border: none; cursor: pointer; font-weight: 600; margin-top: 10px; }
.danger { color: #ff6b6b; }
.full-width { width: 100%; margin-top: 10px; }

input, textarea, select { width: 100%; padding: 12px; border: 2px solid #f0f2f7; border-radius: 12px; margin-bottom: 12px; font-size: 1rem; }
.input-row { display: flex; gap: 10px; }

/* Изображения */
.news-card-img { width: 100%; height: 200px; object-fit: cover; border-radius: 12px; margin-bottom: 15px; }

/* Профиль и Аватар */
.avatar-wrapper { position: relative; width: 120px; height: 120px; margin: 0 auto 20px; }
#p-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid var(--accent); }
.avatar-edit-label { position: absolute; bottom: 0; right: 0; background: var(--deep); color: white; width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 5px; }

/* Утилиты */
.hidden { display: none !important; }
.page { display: none; animation: fadeIn 0.4s ease-out; }
.page.active { display: block; }
.centered { text-align: center; }
.center-text { margin-top: 15px; font-size: 0.9rem; }
.center-text a { color: var(--mid); cursor: pointer; text-decoration: underline; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Адаптивность для телефонов */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-links {
        display: none; flex-direction: column; position: absolute;
        top: 70px; left: 0; width: 100%; background: white;
        padding: 30px; gap: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }
    .nav-links.active { display: flex; }
    .hero-card h1 { font-size: 2.2rem; }
    .grid { grid-template-columns: 1fr; }
}

footer { background: var(--deep); color: white; text-align: center; padding: 40px; margin-top: auto; border-radius: 40px 40px 0 0; }