/* =========================================================
   Расписание звонков — Премиум дизайн-система
   Разработчик: Медведев Иван Евгеньевич · medvedevie.ru
   ========================================================= */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-soft: rgba(99, 102, 241, 0.12);
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --success: #10b981;
    --danger: #ef4444;

    --bg-page: radial-gradient(ellipse at top, #667eea 0%, #764ba2 60%, #4c1d95 100%);
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --surface-3: #f3f4f6;
    --surface-glass: rgba(255, 255, 255, 0.7);

    --border: #e5e7eb;
    --border-2: #d1d5db;

    --text-1: #0f172a;
    --text-2: #334155;
    --text-3: #64748b;
    --text-4: #94a3b8;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.18);
    --shadow-primary: 0 12px 32px rgba(99, 102, 241, 0.35);
    --shadow-accent: 0 12px 32px rgba(245, 158, 11, 0.4);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

    --note-bg: #fffbeb;
    --note-border: #f59e0b;
    --note-text: #78350f;
}

[data-theme="dark"] {
    --bg-page: radial-gradient(ellipse at top, #1e1b4b 0%, #0f172a 60%, #020617 100%);
    --surface: #0f172a;
    --surface-2: #1e293b;
    --surface-3: #334155;
    --surface-glass: rgba(15, 23, 42, 0.7);

    --border: #1e293b;
    --border-2: #334155;

    --text-1: #f8fafc;
    --text-2: #e2e8f0;
    --text-3: #94a3b8;
    --text-4: #64748b;

    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.7);
    --shadow-primary: 0 12px 32px rgba(99, 102, 241, 0.45);

    --note-bg: #422006;
    --note-border: #f59e0b;
    --note-text: #fde68a;
}

/* ---------- БАЗА ---------- */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-page);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-1);
    font-size: 15px;
    line-height: 1.5;
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }

::selection { background: var(--primary); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 5px;
    border: 2px solid var(--surface);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ---------- КНОПКИ И ФОРМЫ ---------- */
button, .btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-1);
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}
button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}
button:active, .btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: var(--shadow-primary); }

.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-block   { width: 100%; justify-content: center; padding: 13px; font-size: 14.5px; }

.icon-btn {
    width: 42px; height: 42px; padding: 0;
    justify-content: center; border-radius: 50%; font-size: 18px;
}
.icon-btn:hover { transform: rotate(15deg) scale(1.08); }

input, textarea, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-1);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}
input:not([type=checkbox]):not([type=radio]),
textarea, select { background-color: var(--surface) !important; }

/* ---------- FLASH ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}
.flash-error   { background: #fef2f2; color: #991b1b; border-color: var(--danger); }
.flash-warning { background: #fffbeb; color: #92400e; border-color: var(--accent); }
.flash-success { background: #ecfdf5; color: #065f46; border-color: var(--success); }
[data-theme="dark"] .flash-error   { background: #4c1d1d; color: #fecaca; }
[data-theme="dark"] .flash-warning { background: #422006; color: #fde68a; }
[data-theme="dark"] .flash-success { background: #064e3b; color: #a7f3d0; }

/* =========================================================
   СТРАНИЦЫ АВТОРИЗАЦИИ
   ========================================================= */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
}
.auth-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(245,158,11,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 450px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 44px 36px 34px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeUp 0.6s ease both;
}

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

.auth-header { text-align: center; margin-bottom: 30px; }
.auth-logo {
    font-size: 52px;
    margin-bottom: 10px;
    display: inline-block;
    animation: floatY 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 20px rgba(99, 102, 241, 0.35));
}
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.auth-header h1 { font-size: 22px; margin-bottom: 8px; letter-spacing: -0.03em; }
.auth-header p  { color: var(--text-3); font-size: 14px; margin: 0; }

.auth-form .field { margin-bottom: 18px; }
.auth-form .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.auth-form label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}
.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 11.5px;
    color: var(--text-4);
}
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13.5px;
    color: var(--text-3);
}
.auth-footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: color var(--transition);
}
.auth-footer a:hover { color: var(--primary-dark); text-decoration: underline; }

/* =========================================================
   ОСНОВНОЙ ЛЭЙАУТ
   ========================================================= */
.container {
    max-width: 1440px;
    margin: 28px auto;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeUp 0.4s ease both;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 24px 32px 0;
    position: relative;
    overflow: hidden;
}
.app-header::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.app-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 22px;
    position: relative;
    z-index: 1;
}

.brand { display: flex; align-items: center; gap: 16px; }
.brand-icon {
    font-size: 42px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}
.brand h1 { font-size: 23px; color: #fff; letter-spacing: -0.03em; }
.brand p  { font-size: 13px; opacity: 0.9; margin: 3px 0 0; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-actions .icon-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    text-decoration: none;
    backdrop-filter: blur(6px);
}
.header-actions .icon-btn:hover { background: rgba(255, 255, 255, 0.3); }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all var(--transition);
}
.user-chip:hover { background: rgba(255, 255, 255, 0.22); }
.avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; font-size: 15px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 700; }
.user-nick { font-size: 11px; opacity: 0.85; }

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--surface-2);
    margin: 0 -32px;
    padding: 14px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.toolbar-left { display: flex; gap: 8px; flex-wrap: wrap; }

.clock {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px var(--primary-soft);
}
[data-theme="dark"] .clock { color: var(--primary-light); }

.app-main { padding: 28px 32px 8px; flex: 1; }

/* ---------- COUNTDOWN ---------- */
.countdown-box {
    background: linear-gradient(135deg, var(--primary), #764ba2);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-primary);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.countdown-box::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.countdown-info { position: relative; z-index: 1; }
.countdown-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.95;
    margin-bottom: 6px;
    font-weight: 600;
}
.countdown-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.countdown-timer {
    font-size: 42px;
    font-weight: 800;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.25);
    position: relative;
    z-index: 1;
}
.countdown-box.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    animation: pulseBg 2.2s infinite;
}
.countdown-box.idle { background: linear-gradient(135deg, #64748b, #334155); }
@keyframes pulseBg {
    0%,100% { box-shadow: 0 12px 32px rgba(245, 158, 11, 0.35); }
    50%     { box-shadow: 0 12px 48px rgba(245, 158, 11, 0.75); }
}

/* ---------- SECTION TITLE ---------- */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-2);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}
.badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px var(--primary-soft);
}

/* ---------- LESSONS GRID ---------- */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 1100px) { .lessons-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .lessons-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .lessons-grid { grid-template-columns: 1fr; } }

.lesson-card {
    position: relative;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    cursor: pointer;
    transition: all var(--transition-bounce);
    overflow: hidden;
}
.lesson-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.lesson-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.22);
    border-color: var(--primary-light);
}
.lesson-card:hover::before { opacity: 1; }

.lesson-card.current {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border-color: transparent;
    animation: pulseCard 2.2s infinite;
}
@keyframes pulseCard {
    0%,100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    50%     { box-shadow: 0 0 0 14px rgba(245, 158, 11, 0); }
}
.lesson-card.next {
    border-color: var(--accent);
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}
[data-theme="dark"] .lesson-card.next {
    background: linear-gradient(135deg, #3b2f1a, #2a220f);
}
.lesson-card.finished {
    opacity: 0.55;
    background: var(--surface-3);
}

.lesson-number {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 8px;
}
[data-theme="dark"] .lesson-number { color: var(--primary-light); }
.lesson-card.current .lesson-number { color: rgba(255,255,255,0.95); }
.lesson-card.finished .lesson-number { color: var(--text-4); }

.lesson-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    min-height: 2.6em;
    margin-bottom: 10px;
    color: var(--text-1);
    letter-spacing: -0.01em;
}
.lesson-card.current .lesson-name { color: #fff; }

.lesson-time {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    margin-bottom: 6px;
}
.lesson-card.current .lesson-time { color: #fff; }

.status-label {
    position: absolute;
    top: 12px; right: 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-3);
}
.lesson-card.current .status-label {
    background: rgba(255,255,255,0.3);
    color: #fff;
}
.lesson-card.next .status-label {
    background: var(--accent);
    color: #fff;
}

.lesson-note-preview {
    font-size: 12px;
    margin-top: 10px;
    padding: 7px 10px;
    border-left: 3px solid var(--primary-light);
    background: var(--primary-soft);
    border-radius: 6px;
    color: var(--text-2);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lesson-card.current .lesson-note-preview {
    background: rgba(255,255,255,0.2);
    border-left-color: rgba(255,255,255,0.7);
    color: #fff;
}
.lesson-note-preview.has-note {
    background: var(--note-bg);
    border-left-color: var(--note-border);
    color: var(--note-text);
    font-style: normal;
    font-weight: 600;
    animation: notePulse 2s infinite;
}
@keyframes notePulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    50%     { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}
.lesson-card.finished .lesson-note-preview.has-note { animation: none; opacity: 0.75; }

.note-hint {
    margin-top: 10px;
    font-size: 11px;
    text-align: center;
    color: var(--text-4);
    font-style: italic;
    opacity: 0.7;
}
.lesson-card.current .note-hint { color: rgba(255,255,255,0.85); }

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-4);
}
.empty-state .icon { font-size: 52px; margin-bottom: 12px; }

.privacy-note {
    text-align: center;
    margin-top: 28px;
    font-size: 12.5px;
    color: var(--text-4);
}

/* ---------- FOOTER ---------- */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 32px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-3);
}
.app-footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: color var(--transition);
}
.app-footer a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ---------- MODALS ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(6px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.2s;
}
.modal-overlay.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    color: var(--text-1);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 19px; letter-spacing: -0.02em; }
.close-btn {
    background: none;
    border: none;
    box-shadow: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-3);
    padding: 4px 10px;
    border-radius: 8px;
    transition: all var(--transition);
}
.close-btn:hover { background: var(--surface-3); transform: rotate(90deg); color: var(--text-1); }

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ---------- LESSON DETAIL ---------- */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.detail-row:last-of-type { border-bottom: none; }
.detail-label { color: var(--text-3); font-weight: 600; font-size: 14px; flex-shrink: 0; }
.detail-value { color: var(--text-1); font-weight: 700; text-align: right; }

.detail-status {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
}
.detail-status.current  { background: var(--accent); }
.detail-status.next     { background: #f59e0b; }
.detail-status.finished { background: #94a3b8; }
.detail-status.future   { background: var(--primary); }

.detail-note {
    margin-top: 18px;
    padding: 18px;
    background: var(--surface-2);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    transition: all var(--transition);
}
.detail-note.has-note {
    background: var(--note-bg);
    border-left-color: var(--note-border);
    animation: noteBlockPulse 2s infinite;
}
@keyframes noteBlockPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    50%     { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
}
.detail-note-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 12px;
}
.detail-note.has-note .detail-note-title { color: var(--accent-dark); }
.note-save-status {
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--success);
    opacity: 0;
    transition: opacity var(--transition);
    font-weight: 700;
}
.note-save-status.show { opacity: 1; }

.detail-note textarea {
    min-height: 110px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.55;
    background: var(--surface);
    border-color: var(--border-2);
}

/* ---------- EDITOR ---------- */
.editor-day-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.day-tab {
    padding: 9px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-1);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: none;
}
.day-tab:hover { transform: translateY(-1px); border-color: var(--primary-light); }
.day-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-primary);
}

.editor-lesson {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color var(--transition);
}
.editor-lesson:hover { border-color: var(--primary-light); }
.editor-lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 800;
    color: var(--primary);
    font-size: 13.5px;
    letter-spacing: -0.01em;
}
.remove-btn {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: all var(--transition);
}
.remove-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { margin-bottom: 12px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-2);
}

/* ---------- LOG ---------- */
.log-list { max-height: 440px; overflow-y: auto; }
.log-item {
    padding: 11px 15px;
    border-left: 3px solid var(--primary);
    background: var(--surface-2);
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 13.5px;
    transition: all var(--transition);
}
.log-item:hover { background: var(--surface-3); }
.log-item .time { font-weight: 700; color: var(--primary); }

/* ---------- ABOUT MODAL ---------- */
.modal-about { max-width: 680px; }

.about-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(118,75,162,0.1));
    border-radius: var(--radius-lg);
    margin-bottom: 22px;
    border: 1px solid rgba(99,102,241,0.15);
}
.about-logo {
    font-size: 52px;
    filter: drop-shadow(0 6px 16px rgba(99,102,241,0.4));
}
.about-hero h3 { font-size: 19px; margin-bottom: 4px; letter-spacing: -0.02em; }
.about-tagline { font-size: 13px; color: var(--text-3); margin: 0; }

.about-section { margin-bottom: 22px; }
.about-section h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-2);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.about-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}
.about-list li {
    position: relative;
    padding: 10px 14px 10px 40px;
    background: var(--surface-2);
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-2);
    transition: all var(--transition);
}
.about-list li::before {
    content: '✓';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success);
    font-weight: 800;
    font-size: 14px;
}
.about-list li:hover {
    background: var(--surface-3);
    transform: translateX(4px);
}
.about-list strong { color: var(--text-1); }

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tech-badge {
    padding: 6px 13px;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    transition: all var(--transition);
}
.tech-badge:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}
[data-theme="dark"] .tech-badge { color: var(--primary-light); }

.dev-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary), #764ba2);
    border-radius: var(--radius-lg);
    color: #fff;
    box-shadow: var(--shadow-primary);
    position: relative;
    overflow: hidden;
}
.dev-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.dev-avatar {
    width: 56px; height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
}
.dev-info { position: relative; z-index: 1; }
.dev-name { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.dev-role { font-size: 12.5px; opacity: 0.9; margin-top: 2px; }
.dev-site {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 13px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 4px 11px;
    background: rgba(255,255,255,0.18);
    border-radius: 999px;
    transition: all var(--transition);
}
.dev-site:hover { background: rgba(255,255,255,0.32); transform: translateY(-1px); }

.about-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 18px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-4);
}

/* ---------- TOAST ---------- */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    padding: 15px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    opacity: 0;
    transform: translateY(24px);
    transition: all var(--transition-bounce);
    font-weight: 700;
    font-size: 14px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: linear-gradient(135deg, var(--danger), #b91c1c); }

/* ---------- МОБИЛЬНАЯ АДАПТАЦИЯ ---------- */
@media (max-width: 640px) {
    .container { margin: 0; border-radius: 0; }
    .app-header { padding: 18px 18px 0; }
    .toolbar { margin: 0 -18px; padding: 12px 18px; }
    .app-main { padding: 20px 18px 0; }
    .app-footer { padding: 16px 18px; flex-direction: column; text-align: center; }
    .brand h1 { font-size: 18px; }
    .brand p  { font-size: 12px; }
    .brand-icon { font-size: 34px; }
    .user-name { display: none; }
    .countdown-timer { font-size: 30px; }
    .clock { font-size: 20px; }
    .auth-card { padding: 32px 22px 26px; }
    .auth-form .field-row { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .modal { padding: 22px 18px; }
    .about-hero { flex-direction: column; text-align: center; }
    .dev-card { flex-direction: column; text-align: center; }
    .about-footer { flex-direction: column; gap: 6px; text-align: center; }
    .toast { bottom: 20px; right: 20px; left: 20px; text-align: center; }
}