
body {
  font-family: 'El Messiri', sans-serif; /* Основной шрифт */
    margin: 0;
    padding: 0;
}
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
	    box-sizing: border-box;
}
.header {
    padding: 16px 0;
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 12px;
    column-gap: 20px;
}
.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo {
    height: 78px;
    vertical-align: middle;
}
a.login-btn {
    border: 1px solid black;
    padding: 10px 15px;
    border-radius: 10px;
}

/* Поиск тестов — между логотипом и блоком аккаунта/класса */
.header-search {
    position: relative;
    display: flex;
    align-items: stretch;
    flex: 0 1 380px;
}
.header-search input {
    flex: 1;
    min-width: 0;
    height: 46px;
    box-sizing: border-box;
    border: 1.5px solid #E3DED7;
    border-right: none;
    border-radius: 12px 0 0 12px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    background: #fff;
    transition: border-color 0.2s;
}
.header-search input:focus { border-color: var(--main-orange); }
.header-search button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border: none;
    background: var(--accent-gradient);
    color: #fff;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    transition: opacity 0.2s;
}
.header-search button:hover { opacity: 0.9; }

/* Выпадающий список живых результатов (см. js в public-footer.php) */
.header-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(42, 67, 101, 0.18);
    overflow: hidden;
    z-index: 500;
    max-height: 380px;
    overflow-y: auto;
}
.header-search-results.active { display: block; }
.header-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--dark-blue);
    border-bottom: 1px solid #F0EDE8;
}
.header-search-result:last-child { border-bottom: none; }
.header-search-result:hover { background: #FAF7F3; }
.header-search-result-icon { font-size: 1.3rem; flex-shrink: 0; }
.header-search-result-name { font-size: 0.92rem; font-weight: 600; }
.header-search-result-meta { font-size: 0.78rem; color: #8A8377; margin-top: 2px; margin-left: 10px; }
.header-search-empty,
.header-search-more {
    display: block;
    padding: 12px 14px;
    font-size: 0.85rem;
    color: #8A8377;
    text-align: center;
    text-decoration: none;
}
.header-search-more { color: var(--main-orange); font-weight: 600; background: #FAF7F3; }
.header-search-more:hover { text-decoration: underline; }

/* .nav — на мобильном это реальная коробка (выезжающая панель по
   гамбургеру, см. медиа-запрос ниже), но на десктопе она нам не нужна как
   отдельный визуальный блок — display:contents "растворяет" её, и
   .header-account/.nav-links становятся обычными элементами .header-top,
   наравне с логотипом и поиском (иначе они тащились одним куском). */
.nav {
    display: contents;
}
.header-account {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-links {
    flex: 1 0 100%;
    order: 10;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    background: #F6F4EF;
    border-radius: 12px;
    padding: 2px 6px;
    margin-top: 6px;
}
.nav-links a {
    border-right: 1px solid rgba(42, 67, 101, 0.14);
}
.nav-links a:last-child { border-right: none; }
.nav a {
    color: black;
    text-decoration: none;
}
.hero {
    background: #f7f7f7a1;
    text-align: left;
    padding: 60px 20px;
}
.hero h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
}
.hero p {
    font-size: 1.2em;
    margin-bottom: 30px;
}
.btn {
    background-color: #f67b2d;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
}
.features {
    background: #fff;
    padding: 40px 0;
}
.feature-list {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}
.feature {
    text-align: center;
    width: 30%;
}
.feature img {
    max-width: 70%;
}
.login-btn {
    background: #f67b2d;
    color: white!important;
    border: none!important;
    padding: 12px 25px!important;
    margin-left: 15px;
    transition: all 0.3s;
}
.tests-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.tests-blocks .test {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}
.footer {
    background: var(--dark-blue, #2A4365);
    color: #E7ECF5;
    padding: 44px 0 20px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 28px;
    text-align: left;
}
.footer-col h3 {
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    margin: 0 0 12px;
}
.footer-col p {
    margin: 0 0 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #C7D2E6;
}
.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-col li {
    margin-bottom: 8px;
}
.footer-col a {
    color: #C7D2E6;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-col a:hover {
    color: var(--main-orange);
    text-decoration: underline;
}
.footer-support-link {
    display: inline-block;
    margin-top: 4px;
    padding: 8px 16px;
    background: var(--accent-gradient);
    color: #fff !important;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none !important;
}
.footer-bottom {
    text-align: center;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.82rem;
    color: #9FADC7;
}
.footer-bottom a {
    color: #C7D2E6;
    text-decoration: underline;
}
@media (max-width: 700px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 22px;
    }
}
/* Основные акценты */
:root {
    --main-orange: #F67B2D;
    --dark-blue: #2A4365;
    --accent-gradient: linear-gradient(135deg, #F67B2D 0%, #FF9F4D 100%);
}

/* Навигация */
.nav a {
    color: var(--dark-blue);
    position: relative;
    padding: 10px 15px;
    transition: all 0.3s;
}

.nav a:hover {
    color: var(--main-orange);
}

.nav a:not(.login-btn):hover::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--main-orange);
    border-radius: 2px;
}

/* Активный пункт меню */
.nav a.active {
    font-weight: 700;
    color: var(--main-orange);
}

/* Блоки тестов */
.test {
    background: white;
    border: 2px solid var(--dark-blue);
    border-radius: 20px;
    padding: 25px;
    position: relative;
    overflow: hidden;
	text-align: center;
}

.test::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 5px;
}

.subject-icon {
    width: 80px;
    height: 80px;
    background: #FFF5EF;
    border-radius: 50%;
    margin: 0 auto 20px;
    padding: 15px;
}

.subject {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    color: var(--dark-blue);
    margin: 15px 0;
}

.class-number {
    font-family: 'El Messiri', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--main-orange);
    display: block;
    line-height: 1;
}

/* Декоративные элементы */
.decor-line {
    height: 4px;
    background: var(--accent-gradient);
    width: 100px;
    margin: 20px 0;
}

/* Ховер-эффекты */
.test:hover {
    box-shadow: 0 10px 30px rgba(246, 123, 45, 0.15);
    transform: translateY(-5px);
}

/* Адаптивная сетка */
.tests-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

/* Кнопка входа */
.login-btn {
    background: var(--accent-gradient);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.3s;
}

.login-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(246, 123, 45, 0.3);
}

.image img {
    max-width: 80%;
}
/* Стили для гамбургера */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1000;
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark-blue);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* ===== Адаптивная шапка =================================================
 * Один консолидированный блок вместо трёх дублирующих друг друга (раньше
 * .nav переопределялась трижды на одном и том же брейкпоинте — из-за
 * каскада и .header{overflow:hidden} пункты меню при сужении окна просто
 * обрезались/пропадали, а не переносились и не уходили в гамбургер).
 * Брейкпоинт поднят до 1180px — при 8+ пунктах в навбаре (предметы,
 * рейтинг, аккаунт, переключатель класса) этого места мало уже на
 * ноутбучных экранах ~1280px, и раньше они просто обрезались.
 * ========================================================================= */
@media (max-width: 1180px) {
    .hamburger {
        display: block;
        order: 2;
    }

    .header-top {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .logo { height: 56px; }

    .header-search {
        order: 5;
        flex: 1 1 100%;
        max-width: none;
    }

    .nav {
        /* На десктопе .nav — display:contents (растворена), здесь снова
           настоящая коробка — выезжающая панель по гамбургеру. */
        display: flex;
        order: 3;
        position: fixed;
        right: -100%;
        top: 0;
        height: 100vh;
        width: 82%;
        max-width: 320px;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 80px 20px 20px;
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
        gap: 0;
        margin-left: 0;
    }

    .nav.active {
        right: 0;
    }

    /* На мобильном .header-account и .nav-links — просто два вертикальных
       блока внутри одной выезжающей панели, без фона/разделителей десктопа
       (у каждой ссылки уже своя карточка-кнопка, см. .nav a ниже). Сбрасываем
       десктопные flex-basis/order/margin — там это работало против .header-top. */
    .header-account,
    .nav-links {
        flex: none;
        order: initial;
        margin-top: 0;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        background: none;
        padding: 0;
        border-radius: 0;
        gap: 0;
    }
    .nav-links a { border-right: none; }

    .nav a {
        width: 100%;
        box-sizing: border-box;
        margin: 4px 0;
        padding: 14px;
        border-radius: 8px;
        text-align: center;
        background: #f8f8f8;
    }

    .nav a.login-btn,
    .nav a.login-btn.account-link {
        background: var(--accent-gradient) !important;
        color: #fff !important;
        justify-content: center;
        margin-top: 16px;
    }
    .nav a.login-btn .account-icon,
    .nav a.login-btn .account-text {
        color: #fff !important;
    }

    .grade-switcher-wrap {
        width: 100%;
        margin: 10px 0 0 !important;
        box-sizing: border-box;
        order: 10;
    }
    .grade-switcher { flex: 1; width: 100%; }

    /* Анимация гамбургера */
    .hamburger.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    .hamburger.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* Затемнение фона за выезжающим меню */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 998;
}
@media (max-width: 1180px) {
    .menu-overlay.active { display: block; }
}

@media (max-width: 480px) {
    .container { padding: 0 10px; }
    .logo { height: 44px; }
    .nav { max-width: 280px; padding: 70px 16px 16px; }
    .account-text { display: none; }
    .account-icon { font-size: 1.4rem; }
    a.login-btn.account-link { padding: 10px 14px !important; }
}

/* ========================================================================
   Общий рефреш: карточки, формы входа/регистрации, профиль, юридические
   страницы, переключатель класса — переиспользуют существующую палитру
   (--main-orange / --dark-blue / --accent-gradient) вместо новой.
   ======================================================================== */

body {
    background: #FBF7F2;
    color: #2A2A2A;
}

.hero {
    background: transparent;
}

.hero h1 {
    font-family: 'Oswald', sans-serif;
    color: var(--dark-blue);
}

.container.narrow {
    max-width: 560px;
}

/* Карточки предметов/тестов — мягче тень, аккуратнее hover */
.test {
    box-shadow: 0 4px 14px rgba(42, 67, 101, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.test:hover {
    box-shadow: 0 14px 34px rgba(246, 123, 45, 0.18);
}
.test .subject {
    font-weight: 600;
}
.test .forClass {
    color: #7a7a7a;
    font-size: 0.95rem;
}

/* Уведомления */
.alert-box {
    padding: 14px 18px;
    border-radius: 12px;
    margin: 16px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}
.alert-error { background: #FDEDEC; color: #B3261E; border: 1px solid #F5C6C3; }
.alert-success { background: #E9F7EF; color: #1E7D3B; border: 1px solid #BFE6CC; }
.alert-info { background: #EEF3FB; color: #2A4365; border: 1px solid #CBDBF5; }

/* Формы входа/регистрации/профиля */
.auth-form, .legal-text {
    background: #fff;
    border-radius: 18px;
    padding: 28px 30px;
    box-shadow: 0 6px 24px rgba(42, 67, 101, 0.08);
    margin: 20px 0;
}
.legal-text { max-width: 100%; margin: 0 auto; }
.legal-text h2 { color: var(--dark-blue); font-family: 'Oswald', sans-serif; margin-top: 28px; }
.legal-text ul { padding-left: 20px; }
.parent-guide { max-width: 80%; margin-left: auto; margin-right: auto; }

.form-row {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-row label {
    font-weight: 600;
    color: var(--dark-blue);
    font-size: 0.9rem;
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"] {
    padding: 11px 14px;
    border: 1.5px solid #E3DED7;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-row input:focus {
    outline: none;
    border-color: var(--main-orange);
}
.form-row input:disabled { background: #F5F3F0; color: #999; }
.checkbox-row label { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 0.9rem; }
.checkbox-row input { margin-top: 3px; }

.auth-method-choice { display: flex; gap: 18px; flex-wrap: wrap; }
.auth-method-choice label { display: flex; align-items: center; gap: 6px; font-weight: 400; }

button.login-btn, a.login-btn {
    border-radius: 12px !important;
    cursor: pointer;
    font-size: 1rem;
    border: none;
}
.secondary-btn { background: #EEE !important; color: var(--dark-blue) !important; }
.link-btn {
    background: none;
    border: none;
    color: var(--main-orange);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 0.95rem;
}

/* Переключатель класса в шапке */
.grade-switcher-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #E3DED7;
    border-radius: 10px;
    padding: 0 4px 0 12px;
    background: #fff;
}
.grade-switcher-icon { font-size: 1.1rem; line-height: 1; flex-shrink: 0; }
.grade-switcher {
    background: #fff;
    cursor: pointer;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--dark-blue);
}

/* Выбор класса в профиле — карточки с лисой */
.grade-picker {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.grade-option {
    position: relative;
    width: 100px;
    border: 2px solid #E3DED7;
    border-radius: 14px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    font-weight: 400 !important;
}
.grade-option:hover { transform: translateY(-2px); }
.grade-option.selected, .grade-option:has(input:checked) {
    border-color: var(--main-orange);
    background: #FFF5EF;
}
.grade-option input { position: absolute; top: 8px; right: 8px; }
.grade-option img { width: 100%; border-radius: 8px; }
.grade-option span { display: block; margin-top: 6px; font-size: 0.85rem; color: var(--dark-blue); }

.totp-setup { background: #FFF9F3; border: 1px dashed var(--main-orange); border-radius: 14px; padding: 18px; margin: 16px 0; }
.totp-secret {
    font-family: monospace;
    font-size: 1.2rem;
    letter-spacing: 2px;
    background: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    display: inline-block;
    border: 1px solid #E3DED7;
}

.table-simple { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(42,67,101,0.06); }
.table-simple th, .table-simple td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #F0EDE8; }
.table-simple th { background: #FAF7F3; color: var(--dark-blue); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }

.text-muted { color: #999; }
.mt-4 { margin-top: 2rem; }
.topic-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Профили детей в ЛК */
.profile-card { background: #fff; border: 1.5px solid #E3DED7; border-radius: 14px; padding: 16px 18px; margin: 14px 0; }
.profile-card.profile-active { border-color: var(--main-orange); box-shadow: 0 4px 14px rgba(246,123,45,0.12); }
.profile-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.profile-card-head img { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; background: #FFF5EF; }
.badge-active { display: inline-block; margin-left: 8px; padding: 2px 8px; background: var(--main-orange); color: #fff; border-radius: 10px; font-size: 0.7rem; vertical-align: middle; }
.profile-edit-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 14px; }
.profile-edit-form .form-row { margin-bottom: 0; }
.profile-edit-form input[type="text"], .profile-edit-form select { padding: 8px 10px; border: 1.5px solid #E3DED7; border-radius: 8px; width: 100%; box-sizing: border-box; }
.profile-card-actions { margin-top: 10px; display: flex; gap: 12px; align-items: center; }
.profile-stats-line { font-size: 0.82rem; color: #8A8377; margin-top: 4px; }
.achievements-gallery { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.achievement-chip { display: inline-flex; align-items: center; gap: 4px; background: #F3FBF5; border: 1px solid #CFEEDA; color: #1E5A3E; border-radius: 999px; padding: 4px 10px; font-size: 0.78rem; font-weight: 600; }

/* Аккаунт в шапке — иконка + текст, на узких экранах только иконка */
.account-link { display: flex !important; align-items: center; gap: 6px; }
.account-icon { font-size: 1.1rem; line-height: 1; }
a.login-btn.account-link { padding: 10px 18px !important; }

/* Хлебные крошки */
.breadcrumbs { padding: 14px 0 0; font-size: 0.85rem; }
.breadcrumbs .container { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.breadcrumbs a { color: #7a7a7a; text-decoration: none; }
.breadcrumbs a:hover { color: var(--main-orange); text-decoration: underline; }
.breadcrumbs .crumb-sep { color: #ccc; }
.breadcrumbs .crumb-current { color: var(--dark-blue); font-weight: 600; }