/* ============================================
   LIQUID GLASS — компонент стекла
   ============================================ */

:root {
    color-scheme: light;
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, 0.12);
    --text: #1c1c1e;
    --text-2: rgba(60, 60, 67, 0.62);
    --glass-bg: rgba(255, 255, 255, 0.42);
    --glass-border: rgba(255, 255, 255, 0.55);
    --glass-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    --blur: blur(24px) saturate(180%);
    --r-xl: 26px;
    --r-lg: 18px;
    --r-md: 14px;
    --r-sm: 10px;
    --success: #30d158;
    --warning: #ff9f0a;
    --error: #ff453a;
    --info: #64d2ff;
}

/* --- КОМПОНЕНТ СТЕКЛА: использовать везде, где нужно стекло --- */
.glass,
.glass-card {
    position: relative;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    box-shadow:
        var(--glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        inset 0 -1px 0 rgba(255, 255, 255, 0.25);
}

/* Блик сверху — даёт ощущение толщины стекла */
.glass::before,
.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 32%);
    pointer-events: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: #f5f6f8;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.hidden { display: none !important; }
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

h1, h2, h3 { letter-spacing: -0.02em; }

.text-center { text-align: center; }
.text-secondary { color: var(--text-2); }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
.p-1 { padding: 1.5rem; }

.section-title { margin: 1.25rem 0.5rem 1rem; font-size: 1.35rem; font-weight: 700; }

/* ============ AUTH ============ */

#authScreen.screen {
    display: block;
}

.auth-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    min-height: 100vh; /* как минимум на полный экран, но может быть и больше */
}

/* ===== ПК: длинная цитата (>3 строк) переносится в левую колонку ===== */
@media (min-width: 900px) {
    #authScreen.screen {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #authScreen .auth-quote-side {
        display: none;
        width: 380px;
        padding: 2rem;
        box-sizing: border-box;
    }

    #authScreen .auth-quote-side .auth-quote {
        font-size: 1.3rem;
        text-align: right;
    }

    #authScreen .auth-quote-side .auth-quote-author {
        font-size: 0.95rem;
        text-align: right;
    }

    #authScreen.has-long-quote {
        display: flex;
        gap: 2rem;
    }

    #authScreen.has-long-quote .auth-quote-side { display: block; }
    #authScreen.has-long-quote .auth-container .auth-quote,
    #authScreen.has-long-quote .auth-container .auth-quote-author { display: none; }
}

.auth-container h1 {
    text-align: center;
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--text);
}

/* ===== Цитата на экране входа ===== */
/* Боковая цитата видна только на ПК (>=900px) для длинных цитат.
   По умолчанию скрыта, чтобы не дублировалась с основной. */
.auth-quote-side { display: none; }

.auth-quote {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(0.85rem, 3.2vh, 1.15rem);
    line-height: 1.4;
    text-align: center;
    color: #000;
    margin-bottom: 0.4rem;
    word-break: normal;
}

.auth-quote-author {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: 0.8rem;
    text-align: center;
    color: #000;
    opacity: 0.7;
    margin-bottom: 1rem;
}

.quote-word {
    display: inline-block;
    white-space: nowrap; /* слово никогда не разрывается между строк */
}

.quote-ch {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    animation: quoteCharIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ===== Выбор предметов (кирпичики) ===== */
#subjectsList {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.subject-btn {
    padding: 0.55rem 1.1rem;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    color: #333;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.2;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.subject-btn:hover {
    border-color: #0a84ff;
    background: rgba(10, 132, 255, 0.08);
    color: #0a84ff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(10, 132, 255, 0.15);
}

.subject-btn:active {
    transform: scale(0.96);
}

.subject-btn.active {
    border-color: #0a84ff;
    background: #0a84ff;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(10, 132, 255, 0.35);
}

.subject-btn.active:hover {
    background: #0a74e0;
    color: #fff;
    transform: translateY(-1px);
}

@keyframes quoteCharIn {
    0%   { opacity: 0; transform: translateY(10px) scale(0.9); }
    60%  { opacity: 1; transform: translateY(-3px) scale(1.05); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-form {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    padding: 1.4rem 1.5rem;
    border-radius: var(--r-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.65);
    animation: fadeIn 0.4s ease;
    flex-shrink: 0;
}

.auth-form h2 { margin-bottom: 1rem; text-align: center; font-size: 1.2rem; }

.auth-form input,
.role-form input {
    width: 100%;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.9rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text);
    transition: all 0.2s;
}

.auth-form input:focus,
.role-form input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ============ BUTTONS ============ */

.btn-primary {
    width: 100%;
    padding: 0.95rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--r-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
    box-shadow: 0 4px 14px rgba(10, 132, 255, 0.3);
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.97); }

.btn-glass {
    padding: 0.95rem 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    color: var(--text);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.btn-glass:hover { background: rgba(255, 255, 255, 0.75); }
.btn-glass:active { transform: scale(0.97); }

.btn-small { padding: 0.5rem 1rem; font-size: 0.85rem; }

.btn-danger-small {
    width: 32px; height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 69, 58, 0.14);
    color: var(--error);
    cursor: pointer;
}

.auth-switch { text-align: center; margin-top: 1.2rem; color: var(--text-2); font-size: 0.9rem; }
.auth-switch a { color: var(--accent); cursor: pointer; text-decoration: none; font-weight: 600; }

/* ============ ROLE SELECTOR (стекло) ============ */

.role-selector {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.4);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 0.35rem;
    border-radius: var(--r-md);
    border: 1px solid var(--glass-border);
}

.role-btn {
    flex: 1;
    padding: 0.7rem 0.25rem;
    border: none;
    background: transparent;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    transition: all 0.25s;
}

.role-btn.active {
    background: white;
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============ SUBJECT CHIPS (удобный выбор предметов) ============ */

.subjects-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.25rem;
    margin-top: 0.75rem;
}

.subject-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    transition: all 0.2s;
}

.subject-chip .chip-check { display: none; font-size: 0.8em; }

.subject-chip.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 3px 10px rgba(10, 132, 255, 0.3);
}

.subject-chip.selected .chip-check { display: inline; }

.chips-counter {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-2);
    text-align: right;
}

/* ============ HEADER ============ */

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid var(--glass-border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.25rem;
    max-width: 640px;
    margin: 0 auto;
}

.header-content h2 { font-size: 1.15rem; font-weight: 700; }
.header-actions { display: flex; gap: 0.4rem; }

.icon-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    font-size: 1.05rem;
    cursor: pointer;
    width: 38px; height: 38px;
    border-radius: 50%;
    transition: all 0.2s;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.85); }
.icon-btn:active { transform: scale(0.92); }

/* ============ CONTENT ============ */

.content-area { padding: 1rem 1rem 110px; max-width: 640px; margin: 0 auto; }

.view { display: none; animation: fadeIn 0.35s ease; }
.view.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ BOTTOM NAV (стекло) ============ */

.bottom-nav {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    max-width: 480px;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255,255,255,0.65);
    display: flex;
    padding: 6px;
    z-index: 100;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0.55rem 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-2);
    border-radius: 20px;
    transition: all 0.25s;
}

.nav-btn.active {
    background: rgba(10, 132, 255, 0.1);
    color: var(--accent);
}

.nav-icon { line-height: 1; }
.nav-icon svg { width: 22px; height: 22px; }
.nav-label { font-size: 0.68rem; font-weight: 600; }

/* ============ FEED ============ */

.feed-container {
    height: calc(100vh - 190px);
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.feed-container::-webkit-scrollbar { display: none; }

.feed-item {
    height: auto;
    background: #ffffff;
    border: 1px solid #eceef1;
    margin-bottom: 0.75rem;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.feed-item-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.feed-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.feed-meta { flex: 1; min-width: 0; }
.feed-meta h3 { font-size: 0.95rem; font-weight: 700; }
.feed-meta span { font-size: 0.75rem; color: var(--text-2); }

.feed-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-2);
    flex-shrink: 0;
}

.feed-type-badge svg { width: 14px; height: 14px; color: var(--accent); }

.feed-content { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.feed-content h4 { font-size: 1.25rem; margin-bottom: 0.5rem; font-weight: 700; }
.feed-content p { font-size: 1rem; line-height: 1.55; color: var(--text-2); white-space: pre-line; }

.feed-image { 
    margin-top: 1rem; 
    border-radius: var(--r-lg); 
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.feed-image:hover {
    transform: scale(1.01);
}

.feed-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    color: #666;
}

.action-btn svg { width: 16px; height: 16px; }
.action-btn:hover { background: rgba(0, 0, 0, 0.04); }
.action-btn:active { transform: scale(0.95); }
.action-btn.danger { color: var(--error); }

/* Лайк без обводки, с анимацией переворота.
   Анимация запускается программно через класс .like-anim (см. feed.js),
   а не через :active — на тач-экранах :active снимается почти мгновенно
   и анимация обрывается на середине. */
.like-btn {
    padding: 0.4rem 0.8rem;
}

.like-btn.like-anim {
    animation: heartFlip 0.6s cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes heartFlip {
    0% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.15); }
    100% { transform: rotateY(360deg) scale(1); }
}

/* График успеваемости (sparkline) рядом с оценкой */
.grade-sparkline-container {
    display: inline-block;
    margin-top: 0.5rem;
    margin-left: 1rem;
    padding: 0.5rem;
    background: rgba(10, 132, 255, 0.08);
    border-radius: 8px;
    font-size: 0.75rem;
    color: #0a84ff;
}

.grade-sparkline {
    vertical-align: middle;
    filter: drop-shadow(0 1px 2px rgba(10, 132, 255, 0.2));
}

.like-btn.liked { 
    color: #ff375f; 
}

/* ============ JOURNAL ============ */

.quarter-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    background: rgba(255, 255, 255, 0.4);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 0.35rem;
    border-radius: var(--r-md);
    border: 1px solid var(--glass-border);
}

.quarter-tab {
    flex: 1;
    padding: 0.6rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    transition: all 0.25s;
}

.quarter-tab.active { background: white; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.subjects-list { display: flex; flex-direction: column; gap: 0.9rem; }

.subject-card {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.subject-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.subject-name { font-size: 1.05rem; font-weight: 700; }
.subject-average { font-size: 1.2rem; font-weight: 800; color: var(--accent); }

.grades-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.grade-badge {
    position: relative;
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.grade-badge:hover { transform: scale(1.12); }
.grade-badge:active { transform: scale(0.95); }

/* Кнопка-стрелка раскрытия всех оценок (телефон) */
.grades-expand {
    width: 42px; height: 42px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: #f0f1f3;
    color: var(--text-2);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.grades-expand:hover { background: #e6e8eb; }
.grades-expand svg { width: 20px; height: 20px; }
.grades-extra { display: contents; }

.grade-5 { background: var(--success); }
.grade-4 { background: var(--accent); }
.grade-3 { background: var(--warning); }
.grade-2 { background: var(--error); }
.grade-1 { background: #8e2323; }
.grade-0, .grade-undefined, .grade-null { background: #d1d1d6; color: #3a3a3c; font-size: 0.7rem; } /* Ошибочная оценка */

/* Сдвоенная оценка (5/3): две половины разного цвета в одном бейдже */
.grade-badge.grade-double {
    width: auto;
    min-width: 42px;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--success) 0%, var(--success) 50%, var(--warning) 50%, var(--warning) 100%);
    font-size: 0.95rem;
}

/* ============ HOMEWORK ============ */

.homework-card {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 1.3rem;
    margin-bottom: 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.homework-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.7rem; }
.homework-subject { font-size: 1.05rem; font-weight: 700; color: var(--accent); }
.homework-date { font-size: 0.8rem; color: var(--text-2); margin-top: 0.5rem; }
.homework-description { line-height: 1.55; margin-bottom: 0.7rem; white-space: pre-line; }

.homework-file {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--accent-soft);
    border-radius: 999px;
    text-decoration: none;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
}

.homework-file-preview {
    display: inline-block;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    margin-top: 0.5rem;
    margin-right: 0.5rem;
    cursor: pointer;
    object-fit: cover;
    transition: transform 0.2s ease;
    border: 1px solid var(--glass-border);
}

.homework-file-preview:hover {
    transform: scale(1.05);
}

/* ============ PROFILE ============ */

.profile-card {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.profile-header { display: flex; align-items: center; gap: 1.1rem; }
.profile-avatar {
    width: 74px; height: 74px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
}

.profile-info h2 { font-size: 1.3rem; font-weight: 700; }
.profile-info p { color: var(--text-2); font-size: 0.9rem; margin-top: 0.2rem; }

.profile-section { margin-top: 1.2rem; }
.profile-section h3 {
    font-size: 0.78rem;
    margin-bottom: 0.6rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 0.92rem;
}

.profile-item:last-child { border-bottom: none; }
.profile-label { color: var(--text-2); }
.profile-value { font-weight: 600; }

.birthday-countdown {
    background: var(--accent);
    color: white;
    padding: 1.6rem;
    border-radius: var(--r-xl);
    text-align: center;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.35);
}

.birthday-countdown h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.birthday-countdown .days { font-size: 3rem; font-weight: 800; line-height: 1.1; }
.birthday-countdown p { font-size: 0.9rem; opacity: 0.9; }

.create-post {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.create-post textarea {
    width: 100%;
    min-height: 110px;
    padding: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 0.9rem;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text);
}

.create-post textarea:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,0.85); }

.file-input-wrapper { position: relative; display: inline-block; margin-bottom: 0.9rem; }
.file-input-wrapper input[type=file] { position: absolute; left: -9999px; }

.file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
}

/* ============ LOADING / MODAL ============ */

.loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.3);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 46px; height: 46px;
    border: 4px solid rgba(255, 255, 255, 0.7);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.25rem;
}

.modal-content {
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: 2rem 1.5rem;
    max-width: 480px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlide 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.65);
}

@keyframes modalSlide {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-2);
}

/* ============ TEACHER ============ */

.setup-card { text-align: center; padding: 3rem 1.5rem; margin-top: 2rem; }
.setup-icon { margin-bottom: 1rem; display: flex; justify-content: center; }
.setup-icon svg { width: 56px; height: 56px; color: var(--accent); }
.setup-card h2 { font-size: 1.45rem; margin-bottom: 0.5rem; }
.setup-card p { margin-bottom: 1.8rem; }

.setup-buttons { display: flex; gap: 0.8rem; justify-content: center; }
.setup-buttons .btn-primary { width: auto; padding: 0.95rem 2.5rem; }

.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 0.5rem;
    max-height: 340px;
    overflow-y: auto;
    margin: 1rem 0;
}

.class-chip input { display: none; }

.class-chip span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.4rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.class-chip input:checked + span {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 3px 10px rgba(10, 132, 255, 0.3);
}

.class-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

.day-column {
    background: rgba(255, 255, 255, 0.4);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: var(--r-lg);
    padding: 1rem;
    margin-bottom: 0.8rem;
}

.day-title {
    font-weight: 700;
    margin-bottom: 0.7rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
}

.lesson-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.9rem;
    background: #ffffff;
    border: none;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.lesson-item:last-child { margin-bottom: 0; }
.lesson-time { font-size: 0.8rem; color: var(--text-2); margin-top: 0.15rem; }
.lesson-subject { font-weight: 600; }

.day-edit { margin-bottom: 1.2rem; }
.day-edit-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }

.class-selector select,
.subject-selector select,
.form-group select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    font-size: 1rem;
    margin-top: 0.4rem;
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--text);
}

.class-selector label,
.subject-selector label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.student-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.55);
    border-radius: var(--r-md);
    cursor: pointer;
}

/* ============ PLUS ============ */

.plus-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }

.plus-option {
    padding: 1.6rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
    font-size: 0.95rem;
}

.plus-option:hover { transform: translateY(-3px); }
.plus-option:active { transform: scale(0.97); }

.plus-option-icon { display: flex; justify-content: center; margin-bottom: 0.6rem; }
.plus-option-icon svg { width: 28px; height: 28px; color: var(--accent); }

/* ============ FORMS ============ */

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 600; color: var(--text-2); font-size: 0.85rem; }

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text);
    font-family: inherit;
}

.form-group textarea { min-height: 100px; resize: vertical; }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.85);
}

.form-row { display: flex; gap: 0.8rem; }
.form-row .form-group { flex: 1; }

/* ============ CLASS CODES ============ */

.class-codes { display: grid; gap: 0.9rem; margin: 1.2rem 0; }

.class-code-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.4rem;
    border-radius: var(--r-lg);
    text-align: center;
}

.class-code-item h4 { color: var(--text-2); font-size: 0.9rem; margin-bottom: 0.4rem; }

.code-display {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.4rem;
}

/* ============ GLASS SELECT (стеклянные выпадающие списки) ============ */

.gselect { position: relative; margin-top: 0.4rem; }

.gselect-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: background 0.2s;
}

.gselect-btn:hover { background: rgba(255, 255, 255, 0.7); }

.gselect-btn svg {
    width: 16px; height: 16px;
    color: var(--text-2);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.gselect.open .gselect-btn svg { transform: rotate(180deg); }

.gselect-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    max-height: 240px;
    overflow-y: auto;
    z-index: 300;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
}

.gselect.open .gselect-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.gselect-option {
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s;
}

.gselect-option:hover { background: rgba(10, 132, 255, 0.1); }

.gselect-option.selected {
    color: var(--accent);
    font-weight: 700;
    background: rgba(10, 132, 255, 0.12);
}

