/* ============================================================
   Оформление личного кабинета (использует бренд-переменные из styles.css)
   ============================================================ */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(241, 247, 251, .9); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.app-header .header-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.app-header .brand-name { font-size: 1.2rem; }
.app-nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.app-nav a { color: var(--color-muted); font-weight: 700; font-size: .95rem; }
.app-nav a:hover { color: var(--color-primary); }
.app-user { color: var(--color-muted); font-size: .9rem; }

.app-main { max-width: 900px; margin: 0 auto; padding: 40px 24px 80px; }
.app-title { margin-bottom: 6px; }
.app-sub { color: var(--color-muted); margin-bottom: 28px; }

/* Экран авторизации */
.auth-wrap { max-width: 440px; margin: 8vh auto; padding: 0 20px; }
.auth-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 22px; background: var(--color-primary-soft); border-radius: var(--radius-pill); padding: 4px; }
.auth-tab { flex: 1; text-align: center; padding: 10px; border-radius: var(--radius-pill); font-weight: 800; color: var(--color-muted); cursor: pointer; border: 0; background: transparent; font-family: var(--font-body); font-size: .95rem; }
.auth-tab.is-active { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-note { text-align: center; margin-top: 16px; color: var(--color-muted); font-size: .85rem; }

/* Сетка модулей */
.module-list { display: grid; gap: 14px; }
.module-card { display: block; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 22px 24px; transition: transform .2s, box-shadow .2s; }
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.module-card .tag { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: var(--color-accent); margin-bottom: 8px; }
.module-card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.module-card p { color: var(--color-muted); margin: 0; font-size: .95rem; }
.module-meta { margin-top: 12px; color: var(--color-muted); font-size: .85rem; font-weight: 700; }
.section-label { font-family: var(--font-heading); color: var(--color-primary); font-size: 1.35rem; margin: 28px 0 14px; }
.section-label:first-child { margin-top: 0; }

/* Список уроков */
.lesson-list { display: grid; gap: 10px; }
.lesson-row { display: flex; align-items: center; gap: 14px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 16px 20px; transition: border-color .2s; }
.lesson-row:hover { border-color: var(--color-primary); }
.lesson-row .idx { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--color-primary-soft); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; }
.lesson-row .info { flex: 1; }
.lesson-row .info b { display: block; font-size: 1rem; }
.lesson-row .info span { color: var(--color-muted); font-size: .85rem; }
.lesson-row .done { color: var(--color-accent); font-weight: 900; }

/* Плеер урока */
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0e1c2c; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: #cfe1f0; font-weight: 700; text-align: center; padding: 20px; }

.back-link { display: inline-block; margin-bottom: 18px; color: var(--color-primary); font-weight: 700; }
.notice { background: var(--color-accent-soft); border: 1px solid #e6d3a0; border-radius: var(--radius); padding: 22px 24px; color: #6b551d; margin-bottom: 24px; }
.notice h3 { color: #6b551d; margin-bottom: 6px; }

/* ====== Закрытые (неоплаченные) модули ====== */
.module-card.is-locked { position: relative; border-style: dashed; background: linear-gradient(180deg, #f4f7fa 0%, #eef3f8 100%); }
.module-card.is-locked h3 { color: var(--color-muted); }
.module-card.is-locked p { color: #9fb0c0; }
.module-card.is-locked::after { content: ""; position: absolute; inset: 0; background: rgba(216, 227, 236, .28); border-radius: var(--radius); pointer-events: none; }
.lock-badge { position: absolute; top: 16px; right: 18px; width: 34px; height: 34px; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .95rem; z-index: 1; }
.locked-cta { position: relative; z-index: 1; margin-top: 12px; color: var(--color-primary); font-weight: 800; font-size: .9rem; }

/* ====== Комментарии и комьюнити ====== */
.comments { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--color-border); }
.comments h2 { font-size: 1.5rem; margin-bottom: 18px; }
.comment-form, .post-form { margin: 0 0 22px; }
.comment-form textarea, .post-form textarea { width: 100%; padding: 13px 15px; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 1rem; background: #fff; color: var(--color-text); resize: vertical; margin-bottom: 10px; }
.comment-form textarea:focus, .post-form textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.cform-status { margin-left: 12px; color: #B4442E; font-size: .85rem; font-weight: 700; }
.comment-list { display: grid; gap: 10px; }
.comment, .post { position: relative; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 14px 16px; }
.post { padding: 20px 22px; margin-bottom: 16px; }
.comment .meta, .post .meta { font-size: .82rem; color: var(--color-muted); margin-bottom: 5px; }
.comment .meta b, .post .meta b { color: var(--color-text); font-weight: 800; }
.comment .body, .post .body { white-space: pre-wrap; line-height: 1.5; }
.comment .del, .post .del { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: #B4442E; font-size: .8rem; cursor: pointer; padding: 2px 4px; }
.comment .del:hover, .post .del:hover { text-decoration: underline; }
.post-comments { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--color-border); }
.post-comments .comment-form textarea { rows: 2; }
