:root {
    color-scheme: light;
    font-family: 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
    --gradient: linear-gradient(120deg, #1f3c88 0%, #4f46e5 50%, #9333ea 100%);
    --surface: rgba(255, 255, 255, 0.96);
    --surface-muted: rgba(255, 255, 255, 0.78);
    --text: #0f172a;
    --text-muted: #5b6b88;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --accent: #facc15;
    --success: #22c55e;
    --border: rgba(255, 255, 255, 0.45);
    --shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
}

* {
    box-sizing: border-box;
}

a {
    color: inherit;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--gradient);
    color: var(--text);
    font-family: 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 6vw, 70px);
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.22), rgba(15, 23, 42, 0.12));
}

.auth-card {
    width: min(420px, 100%);
    padding: clamp(28px, 6vw, 42px);
    border-radius: 26px;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(247, 250, 255, 0.92));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    text-align: center;
}

.auth-card h1 {
    margin: 0;
    font-size: clamp(26px, 5vw, 32px);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.subtitle {
    color: var(--text-muted);
    margin: 14px 0 32px;
    font-size: 15px;
    line-height: 1.6;
}

.form {
    display: grid;
    gap: 20px;
    text-align: left;
}

.form label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.form input,
.form select {
    width: 100%;
    padding: 15px 18px;
    border-radius: 16px;
    border: 1px solid rgba(79, 70, 229, 0.28);
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.form input:focus,
.form select:focus {
    border-color: rgba(79, 70, 229, 0.6);
    outline: none;
    box-shadow: 0 20px 36px rgba(79, 70, 229, 0.18);
    transform: translateY(-1px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 24px;
    border-radius: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease;
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(120deg, #4f46e5, #6366f1);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 40px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.alert {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 2px solid;
    font-weight: 500;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.22);
    color: #991b1b;
}

.auth-footer {
    margin-top: 30px;
    font-size: 14px;
    color: rgba(15, 23, 42, 0.72);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

.cabinet-body {
    background: var(--gradient);
    min-height: auto !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Убираем лишнюю пустоту внизу страницы */
.cabinet-body main,
.cabinet-body .container,
.cabinet-body .cabinet-main {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.cabinet-body > *:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.cabinet-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background: transparent;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cabinet-header .container {
    width: min(1120px, 94vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 0 10px 0;
    gap: 12px;
}

.cabinet-header .container .profile-section {
    margin-left: 0;
    padding-left: 0;
    flex-shrink: 0;
    margin-right: auto;
    order: 1;
}

.cabinet-header .container .header-lang {
    order: 2;
    margin-left: auto;
    margin-right: 12px;
}

.cabinet-header .container .burger-menu {
    order: 3;
}

/* Профиль слева */
.profile-section {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    margin-left: 0;
    padding-left: 0;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    padding: 8px;
    display: none;
    z-index: 1001;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.profile-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.profile-dropdown-item:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.profile-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 4px 0;
}

/* Язык по центру */
.header-lang {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-lang select {
    padding: 6px 28px 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    color: #fff !important;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.header-lang select option {
    background: #1f2937;
    color: #fff;
    padding: 8px;
}

.header-lang select:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.header-lang select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.25);
}

/* Бургер-меню справа */
.burger-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
}

.burger-menu span {
    width: 24px;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
    position: fixed;
    top: 60px;
    right: 0;
    width: 280px;
    max-width: 90vw;
    height: calc(100vh - 60px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-item {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 15px;
    transition: background 0.2s ease;
}

.mobile-menu-item:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.mobile-menu-item--admin {
    background: rgba(79, 70, 229, 0.06);
    font-weight: 600;
}

.mobile-menu-item.logout {
    color: #ef4444;
}

.mobile-menu-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.mobile-menu-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 12px 0;
}

@media (max-width: 768px) {
    .burger-menu {
        display: flex;
    }
    
    .nav-links {
        display: none;
    }
    
    .header-lang {
        order: 2;
    }
    
    .profile-section {
        order: 1;
        margin-left: 0;
        padding-left: 0;
    }
    
    .burger-menu {
        order: 3;
    }
    
    .cabinet-header .container {
        padding: 8px 10px 8px 0;
    }
    
    .profile-name {
        display: none;
    }
    
    .profile-role {
        display: none;
    }
}

@media (min-width: 769px) {
    .mobile-menu {
        display: block;
        visibility: visible;
        opacity: 1;
    }
    
    .burger-menu {
        display: flex;
    }
}

.cabinet-header .container {
    width: min(1120px, 94vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 12px;
}

.cabinet-header .container .profile-section {
    margin-left: 0;
    flex-shrink: 0;
}

.brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* Оранжевый кружок убран */

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 16px);
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #ffffff;
}

.nav-links .logout {
    color: var(--accent);
}

.lang-switcher form {
    margin: 0;
}

.lang-switcher select {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

.lang-switcher select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.7);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.container {
    width: min(1120px, 94vw);
    margin: 0 auto;
    padding: 5px 7px 0;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.welcome {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow);
    padding: 9px 11px;
    margin-bottom: 9px;
}

.welcome h1 {
    margin: 0 0 10px;
    font-size: clamp(20px, 4vw, 28px);
}

.lead {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.75;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
}

.module-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.module-card {
    background: var(--surface);
    border-radius: 18px;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 180px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}

.module-card h3 {
    margin: 0;
    font-size: 18px;
}

.module-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 15px;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 42px rgba(79, 70, 229, 0.24);
}

.materials {
    margin-top: 16px;
}

.material-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: grid;
    gap: 8px;
}

.material-list li {
    background: var(--surface-muted);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    padding: 10px 12px;
    backdrop-filter: blur(12px);
}

.download-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
}

.pill-link {
    font-weight: 600;
    color: var(--primary);
}

.module-header {
    display: grid;
    gap: 10px;
    background: var(--surface);
    border-radius: 20px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow);
}

.module-header-compact {
    background: linear-gradient(120deg, #4f46e5, #9333ea);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.module-title-compact {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-header-compact {
    margin-bottom: 16px;
}

.module-title-inline {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.module-title-inline:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.lesson-title-inline {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.lesson-list ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: grid;
    gap: 8px;
}

.lesson-item {
    background: var(--surface-muted);
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    backdrop-filter: blur(14px);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}

.lesson-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 32px rgba(79, 70, 229, 0.16);
}

.lesson-item.completed .status {
    background: var(--success);
}

.lesson-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
}

.lesson-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.lesson-title-wrapper h3 {
    flex: 1;
    margin: 0 0 6px;
}

.lesson-complete-checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.lesson-complete-toggle-form {
    margin: 8px 0;
}

.lesson-complete-toggle-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.lesson-complete-toggle-btn:hover {
    transform: scale(1.1);
}

.lesson-complete-toggle-btn:active {
    transform: scale(0.95);
}

.lesson-complete-checkmark-large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0;
    border: 3px solid;
    transition: all 0.2s ease;
}

.lesson-complete-checkmark-large.completed {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-color: #22c55e;
}

.lesson-complete-checkmark-large.pending {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border-color: #9ca3af;
}

.lesson-complete-toggle-btn:hover .lesson-complete-checkmark-large.completed {
    background: rgba(34, 197, 94, 0.25);
    border-color: #16a34a;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.lesson-complete-toggle-btn:hover .lesson-complete-checkmark-large.pending {
    background: rgba(156, 163, 175, 0.25);
    border-color: #6b7280;
    box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.2);
}

.status {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.25);
    margin-top: 6px;
    flex-shrink: 0;
    display: block;
}

.lesson-item .lesson-title-wrapper h3,
.lesson-item h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.lesson-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.lesson-page .lesson-content {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    padding: 12px 14px;
    display: grid;
    gap: 10px;
    box-shadow: var(--shadow);
}

.video-wrapper {
    position: relative;
    padding-top: 56.25%;
    border-radius: 24px;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.lesson-text {
    font-size: 16px;
    line-height: 1.78;
    color: var(--text);
}

.lesson-text h2, .lesson-text h3, .lesson-text h4 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--text);
}

.lesson-text h2 {
    font-size: 24px;
}

.lesson-text h3 {
    font-size: 20px;
}

.lesson-text h4 {
    font-size: 18px;
}

.lesson-text strong, 
.lesson-text b,
.lesson-text p strong,
.lesson-text p b,
.lesson-text * strong,
.lesson-text * b,
div.lesson-text strong,
div.lesson-text b,
div.lesson-text * strong,
div.lesson-text * b {
    font-weight: 700 !important;
    font-weight: bold !important;
    color: var(--text) !important;
    color: #0f172a !important;
    font-family: inherit !important;
    display: inline !important;
}

.lesson-text em, .lesson-text i {
    font-style: italic;
}

.lesson-text ul, .lesson-text ol {
    margin: 12px 0;
    padding-left: 24px;
}

.lesson-text li {
    margin: 6px 0;
}

/* Стили из Skool для выделенного блока */
.lesson-text div[style*="rgba(250, 227, 172"] {
    font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif !important;
    line-height: 1.6 !important;
}

.lesson-text div[style*="rgba(250, 227, 172"] p {
    font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif !important;
    color: #202124 !important;
    margin: 8px 0 !important;
}

.lesson-text div[style*="rgba(250, 227, 172"] ul {
    font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif !important;
    list-style: none !important;
    padding-left: 0 !important;
}

.lesson-text div[style*="rgba(250, 227, 172"] li {
    font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif !important;
    color: #202124 !important;
    margin: 8px 0 !important;
}

.lesson-status {
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    background: rgba(79, 70, 229, 0.12);
    color: #312e81;
}

.lesson-status.completed {
    background: rgba(34, 197, 94, 0.12);
    color: #14532d;
}

.lesson-status.pending {
    background: rgba(156, 163, 175, 0.12);
    color: #374151;
}

.lesson-text p {
    margin-bottom: 8px;
}

.lesson-resources ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.lesson-resources a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(79, 70, 229, 0.08);
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.lesson-resources a:hover {
    background: rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
}

.lesson-resources a::before {
    content: '🔗';
    font-size: 14px;
}

.alert-success {
    background: rgba(255, 255, 255, 0.95);
    color: #22c55e;
    border-color: #22c55e;
}

.alert-error {
    background: rgba(255, 255, 255, 0.95);
    color: #ef4444;
    border-color: #ef4444;
}

.lesson-navigation {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.lesson-nav-btn {
    flex: 1;
    min-width: 140px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lesson-nav-btn:hover:not([style*="opacity"]) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.lesson-nav-prev {
    justify-content: flex-start;
}

.lesson-nav-next {
    justify-content: flex-end;
}

@media (max-width: 600px) {
    .lesson-navigation {
        flex-direction: column;
        gap: 8px;
    }
    
    .lesson-navigation > div {
        display: flex;
        gap: 6px;
        width: 100%;
    }
    
    .lesson-nav-btn {
        flex: 1;
        width: auto;
        min-width: 0;
    }
    
    .lesson-nav-prev,
    .lesson-nav-next {
        justify-content: center;
    }
}

.lesson-comments {
    margin-top: 12px;
    padding: 8px 0;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
}

.lesson-comments h2,
.lesson-comments h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
}

.lesson-comments h3 {
    font-size: 13px;
    margin-bottom: 6px;
}

.comment-actions {
    margin-top: 4px;
    display: flex;
    gap: 6px;
}

.btn-sm {
    font-size: 12px;
    padding: 4px 8px;
}

.comment-edit-form {
    margin-top: 4px;
}

.comment-edit-form textarea {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-family: inherit;
    resize: vertical;
    min-height: 50px;
    margin-bottom: 4px;
    font-size: 13px;
}

.profile-card {
    background: transparent !important;
    color: #ffffff !important;
}

.profile-card .profile-page-title {
    background: transparent !important;
    padding-top: 0;
    margin-top: 0;
    margin-bottom: 24px;
}

.profile-card .profile-section-block {
    background: rgba(79, 70, 229, 0.95) !important;
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
}

.profile-card h1,
.profile-card h2,
.profile-card h3,
.profile-card strong {
    color: #ffffff !important;
}

.profile-card p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Profile Page Styles */
.profile-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 32px;
    line-height: 1.2;
}

.profile-section-block {
    margin-bottom: 40px;
}

.profile-section-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 16px;
    line-height: 1.3;
}

.profile-subsection-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
}

.profile-info-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(79, 70, 229, 0.2);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    border: 3px solid rgba(79, 70, 229, 0.2);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.profile-avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.profile-avatar-upload-btn:hover {
    background: #4338ca;
    transform: scale(1.1);
}

.profile-info-text {
    flex: 1;
    min-width: 200px;
}

.profile-email {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
    word-break: break-word;
}

.profile-member-since {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.profile-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-card .btn-outline {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.profile-card .btn-outline:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.profile-card .btn-primary {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.profile-card .btn-primary:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon svg {
    flex-shrink: 0;
}

.profile-empty-state {
    background: rgba(255, 255, 255, 0.15);
    padding: 48px 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    backdrop-filter: blur(10px);
}

.profile-empty-state p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    font-size: 16px;
}

.profile-products-card,
.profile-orders-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.profile-products-list,
.profile-orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-product-item,
.profile-order-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.profile-product-item:hover,
.profile-order-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-product-info,
.profile-order-info {
    flex: 1;
    min-width: 0;
}

.profile-product-name,
.profile-order-name {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
    font-size: 16px;
}

.profile-product-meta,
.profile-order-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
}

.profile-product-price,
.profile-order-amount {
    color: rgba(255, 255, 255, 0.85);
}

.profile-product-status,
.profile-order-status {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: rgba(34, 197, 94, 0.3);
    color: #ffffff;
}

.status-paid {
    background: rgba(34, 197, 94, 0.3);
    color: #ffffff;
}

.status-pending {
    background: rgba(251, 191, 36, 0.3);
    color: #ffffff;
}

.profile-order-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 6px;
}

.profile-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.profile-action-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 24px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
    backdrop-filter: blur(10px);
}

.profile-action-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.profile-action-card svg {
    color: #ffffff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .profile-page-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .profile-section-block {
        margin-bottom: 32px;
    }

    .profile-section-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .profile-info-card {
        padding: 20px;
    }

    .profile-avatar-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .profile-avatar-image,
    .profile-avatar-placeholder {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }

    .profile-avatar-upload-btn {
        width: 32px;
        height: 32px;
    }

    .profile-email {
        font-size: 18px;
    }

    .profile-actions-grid {
        grid-template-columns: 1fr;
    }

    .profile-action-card {
        padding: 20px;
    }

    .profile-product-item,
    .profile-order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .profile-product-item .btn,
    .profile-order-item .btn {
        width: 100%;
        justify-content: center;
    }
}

.comment-form textarea {
    width: 100%;
    min-height: 50px;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.03);
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    color: var(--text);
}

.comment-form textarea:focus {
    outline: none;
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: none;
}

.comment-history {
    display: grid;
    gap: 4px;
    margin-top: 8px;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 4px;
}

.comment-list li {
    background: transparent;
    border-radius: 0;
    padding: 6px 8px;
    border: none;
    border-left: 2px solid rgba(148, 163, 184, 0.15);
}

.comment-list li.my-comment {
    background: transparent;
    border-left-color: rgba(148, 163, 184, 0.25);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    flex-wrap: wrap;
}

.comment-meta strong {
    color: var(--text-muted);
    font-weight: 500;
}

.comment-meta span:not(.comment-badge) {
    color: var(--text-muted);
    font-size: 11px;
}

.comment-badge {
    background: transparent;
    color: var(--text-muted);
    padding: 0;
    border-radius: 0;
    font-size: 11px;
    font-weight: 400;
}

.comment-meta-old {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 6px;
}

/* TODO(lesson-comments): адаптировать блок комментариев под мобайл при появлении длинных списков. */

.progress-form {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 820px) {
    .cabinet-header {
        padding: 0;
    }
    
    .cabinet-header .container {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 6px;
        align-items: center;
    }
    
    .brand {
        font-size: 15px;
    }
    
    .brand::before {
        width: 22px;
        height: 22px;
    }
    
    .nav-links {
        gap: 6px;
    }
    
    .nav-links a {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    .lang-switcher select {
        padding: 4px 6px;
        font-size: 11px;
    }

    .lesson-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-form {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    body {
        background: linear-gradient(160deg, #312e81, #4f46e5 60%, #9333ea);
    }

    .auth-card {
        padding: 20px;
    }
    
    .cabinet-header .container {
        padding: 5px 8px;
        gap: 4px;
    }
    
    .container {
        padding: 3px 5px 0 !important;
        padding-bottom: 0 !important;
    }
    
    .welcome {
        padding: 7px 9px !important;
        margin-bottom: 7px !important;
    }
    
    .module-card {
        padding: 7px 9px !important;
        margin-bottom: 7px !important;
    }
    
    .lesson-comments {
        padding: 7px 9px !important;
        margin-top: 9px !important;
    }
    
    .nav-links {
        gap: 4px;
    }
    
    .nav-links a {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .lang-switcher select {
        padding: 3px 5px;
        font-size: 10px;
    }

    .module-card,
    .lesson-item,
    .welcome,
    .lesson-page .lesson-content {
        border-radius: 14px;
        padding: 8px 10px;
    }
    
    .lesson-page .lesson-content {
        gap: 8px;
    }
    
    .lesson-navigation {
        margin-top: 8px;
        gap: 6px;
    }
    
    .container {
        padding: 4px 6px 0;
        padding-bottom: 0 !important;
    }
    
    .welcome {
        padding: 10px 12px;
        margin-bottom: 10px;
    }
    
    .lesson-comments {
        padding: 10px 12px;
        margin-top: 12px;
    }
    
    .module-card {
        padding: 10px 12px;
        min-height: 150px;
    }
    
    .lesson-item {
        padding: 8px 10px;
    }
    
    .module-header {
        padding: 10px 12px;
    }

    .module-header-compact {
        padding: 10px 12px;
    }

    .module-title-compact {
        font-size: 16px;
    }

    .lesson-title-inline {
        font-size: 18px;
    }

    .module-title-inline {
        font-size: 13px;
    }
}
