/* ── Каталог курсов ── */
.nca-catalog {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
	margin: 20px 0;
}

.nca-course-card {
	position: relative;
	border: 1px solid #e2e5e9;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	isolation: isolate;
}
.nca-course-card.nca-locked { opacity: 0.85; }

.nca-card-image {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #eef1f5;
	overflow: hidden;
}
.nca-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nca-card-image-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg,#e2e5e9,#f4f6f8); }

.nca-locked .nca-card-image img,
.nca-locked .nca-card-image-placeholder { filter: grayscale(70%) brightness(0.75); }

.nca-lock-overlay {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	background: rgba(16, 24, 40, 0.25);
}
.nca-lock-overlay span { font-size: 32px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }

.nca-duration-badge {
	position: absolute; top: 10px; right: 10px;
	background: #f5a623; color: #fff; font-size: 12px; font-weight: 600;
	padding: 5px 10px; border-radius: 999px;
}

.nca-fav-btn {
	position: absolute; top: 14px; right: 14px;
	width: 32px; height: 32px; border-radius: 50%;
	background: rgba(16,24,40,0.45); color: #fff; border: none;
	font-size: 16px; line-height: 1; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	z-index: 2;
}
.nca-fav-btn.nca-fav-active { background: #e60000; }

.nca-course-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nca-course-title { margin: 0; font-size: 17px; line-height: 1.3; }

.nca-tag {
	display: inline-block;
	font-size: 12px; font-weight: 600;
	padding: 3px 10px; border-radius: 999px;
	background: #e3f6f2; color: #1abc9c;
}
.nca-tag-difficulty-light { background: rgba(255,255,255,0.25); color: #fff; align-self: flex-start; }

.nca-rating { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #555; }
.nca-stars { color: #f5a623; letter-spacing: 1px; }
.nca-rating-light { color: rgba(255,255,255,0.9); }
.nca-rating-light .nca-stars { color: #ffd166; }

.nca-card-meta { font-size: 13px; color: #667085; display: flex; align-items: center; gap: 8px; }
.nca-card-meta-light { color: rgba(255,255,255,0.9); }
.nca-meta-sep { opacity: 0.5; }

/* ── Ховер-панель (только на устройствах с реальным ховером) ── */
.nca-card-hover {
	position: absolute; inset: 0;
	background: #263044;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
	display: flex;
}
.nca-card-hover-inner {
	padding: 52px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	color: #fff;
	width: 100%;
}
.nca-card-hover-inner .nca-course-title { color: #fff; }
.nca-card-excerpt { font-size: 13px; color: rgba(255,255,255,0.9); flex: 1; margin: 0; }

@media (hover: hover) and (pointer: fine) {
	.nca-course-card:not(.nca-locked):hover .nca-card-hover { opacity: 1; pointer-events: auto; }
}
.nca-locked .nca-card-hover { background: #45505a; }

.nca-btn {
	display: inline-block;
	background: #101828;
	color: #fff !important;
	text-decoration: none;
	padding: 9px 16px;
	border-radius: 6px;
	font-size: 14px;
	text-align: center;
	border: none;
	cursor: pointer;
}
.nca-btn:hover { background: #1e293b; }
.nca-btn-disabled { background: rgba(255,255,255,0.25); cursor: not-allowed; }

/* Кнопка и бейдж внутри бирюзовой... то есть теперь тёмно-синей ховер-панели — белые, текст тёмный */
.nca-card-hover .nca-btn {
	background: #fff;
	color: #263044 !important;
}
.nca-card-hover .nca-btn:hover { background: #e7eaf0; }
.nca-card-hover .nca-btn-disabled {
	background: rgba(255,255,255,0.55);
	color: #263044 !important;
	cursor: not-allowed;
}

.nca-notice { padding: 10px 14px; border-radius: 6px; font-size: 14px; margin: 12px 0; }
.nca-notice-warning { background: #fff3cd; color: #8a6100; }

/* ── Бейджи статуса ── */
.nca-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.nca-badge {
	display: inline-block;
	font-size: 12px;
	padding: 3px 9px;
	border-radius: 999px;
	font-weight: 600;
}
.nca-badge-mandatory { background: #fde8e8; color: #b32d2e; }
.nca-badge-passed { background: #e3f6e5; color: #1e7a34; }
.nca-badge-overdue { background: #fff3cd; color: #8a6100; }
.nca-badge-failed { background: #fde8e8; color: #b32d2e; }
.nca-badge-not-started { background: #eef1f5; color: #45505a; }

/* ── Моя аттестация ── */
.nca-my-attestation { border: 1px solid #e2e5e9; border-radius: 8px; padding: 16px; margin: 16px 0; }
.nca-my-attestation h4 { margin-top: 0; }
.nca-my-attestation ul { margin: 0; padding-left: 18px; }
.nca-all-good { color: #1e7a34; font-weight: 600; }

/* ── Страница курса: хлебные крошки и шапка ── */
.nca-course-page { max-width: 900px; margin: 0 auto; padding: 24px 16px; }
.nca-breadcrumbs { font-size: 13px; color: #667085; margin-bottom: 14px; }
.nca-breadcrumbs a { color: #667085; }

.nca-course-header { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 20px; }
.nca-course-header-main { flex: 1; min-width: 260px; }
.nca-course-h1 { margin: 0 0 10px; font-size: 30px; }
.nca-course-meta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; color: #555; margin-bottom: 10px; }
.nca-course-meta-row .nca-instructor-inline { display: flex; align-items: center; gap: 6px; }
.nca-course-meta-row img.nca-instructor-avatar-sm { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

.nca-course-image-side { width: 320px; max-width: 100%; border-radius: 10px; overflow: hidden; }
.nca-course-image-side img { width: 100%; display: block; }

/* ── Вкладки ── */
.nca-tabs-nav { display: flex; gap: 24px; border-bottom: 1px solid #e2e5e9; margin-bottom: 20px; flex-wrap: wrap; }
.nca-tab-btn {
	background: none; border: none; cursor: pointer;
	padding: 10px 2px; font-size: 15px; color: #667085;
	border-bottom: 2px solid transparent;
}
.nca-tab-btn:hover { color: #e60000; }
.nca-tab-btn.nca-tab-active { color: #e60000; border-bottom-color: #e60000; font-weight: 600; }
.nca-tab-panel { display: none; }
.nca-tab-panel.nca-tab-panel-active { display: block; }

/* ── Программа курса: список заголовков уроков ── */
.nca-curriculum-list { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nca-curriculum-item-btn {
	display: flex; align-items: center; gap: 12px; width: 100%;
	background: #fff; border: 1px solid #e2e5e9; border-radius: 8px;
	padding: 12px 16px; font-size: 15px; text-align: left; cursor: pointer;
}
button.nca-curriculum-item-btn:hover { border-color: #263044; }
.nca-ci-disabled { cursor: not-allowed; color: #98a2b3; background: #f7f8fa; }
.nca-ci-done .nca-curriculum-item-btn { border-color: #1e7a34; }
.nca-ci-icon {
	flex: none; width: 26px; height: 26px; border-radius: 50%;
	background: #eef1f5; color: #45505a; font-size: 13px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
}
.nca-ci-done .nca-ci-icon { background: #1e7a34; color: #fff; }
.nca-ci-title { flex: 1; font-weight: 600; }
.nca-ci-quiz-badge {
	flex: none; font-size: 11px; font-weight: 600; text-transform: uppercase;
	color: #263044; background: #eef1f5; padding: 3px 8px; border-radius: 999px;
}

.nca-btn-secondary { background: #eef1f5; color: #263044 !important; }
.nca-btn-secondary:hover { background: #e2e5e9; }
.nca-btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Кнопка-гейт и пошаговый тест ── */
.nca-quiz-gate { margin: 16px 0; }
.nca-quiz-passed-note {
	margin: 16px 0; padding: 12px 14px; border-radius: 8px;
	background: #e3f6e5; color: #1e7a34; font-weight: 600; font-size: 14px;
}
.nca-quiz-progress { height: 6px; border-radius: 999px; background: #eef1f5; overflow: hidden; margin-bottom: 8px; }
.nca-quiz-progress-fill { display: block; height: 100%; width: 0; background: #263044; transition: width .25s ease; }
.nca-quiz-step-count { font-size: 13px; color: #667085; margin-bottom: 14px; }
.nca-quiz-step-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.nca-quiz-step-nav .nca-quiz-btn-next,
.nca-quiz-step-nav .nca-quiz-submit { margin-left: auto; }

/* ── Просмотрщик урока (полноэкранная панель) ── */
body.nca-lv-body-lock { overflow: hidden; }
.nca-lesson-viewer {
	display: none;
	position: fixed; inset: 0; z-index: 99999;
	background: #fff;
	flex-direction: column;
}
.nca-lesson-viewer.nca-lv-open { display: flex; }

.nca-lv-header {
	flex: none;
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px;
	background: #263044; color: #fff;
	padding: 16px 24px;
}
.nca-lv-header-title { margin: 0; font-size: 18px; color: #fff; }
.nca-lv-close {
	flex: none;
	background: transparent; border: none; color: #fff;
	font-size: 20px; line-height: 1; cursor: pointer; opacity: 0.85;
	width: 32px; height: 32px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
}
.nca-lv-close:hover { opacity: 1; background: rgba(255,255,255,0.12); }

.nca-lv-body { flex: 1; display: flex; min-height: 0; }

.nca-lv-sidebar {
	flex: none; width: 300px; max-width: 40vw;
	border-right: 1px solid #e2e5e9;
	overflow-y: auto; padding: 16px 0;
}
.nca-lv-sidebar-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #98a2b3; padding: 0 16px 12px; }
.nca-lv-sidebar-list { list-style: none; margin: 0; padding: 0; }
.nca-lv-sidebar-btn {
	display: flex; align-items: center; gap: 10px; width: 100%;
	background: none; border: none; border-left: 3px solid transparent;
	padding: 10px 16px; font-size: 14px; text-align: left; cursor: pointer; color: #344054;
}
button.nca-lv-sidebar-btn:hover { background: #f7f8fa; }
.nca-lv-si-active .nca-lv-sidebar-btn { background: #f7f8fa; border-left-color: #e60000; color: #101828; font-weight: 600; }
.nca-lv-si-done .nca-ci-icon { background: #1e7a34; color: #fff; }
.nca-lv-si-locked .nca-lv-sidebar-btn { color: #98a2b3; cursor: not-allowed; }

.nca-lv-content { flex: 1; overflow-y: auto; padding: 28px 32px 60px; max-width: 820px; }
.nca-lv-lesson-title { margin: 0 0 18px; font-size: 24px; }
.nca-lv-lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid #e2e5e9; }

@media (max-width: 782px) {
	.nca-lv-body { flex-direction: column; }
	.nca-lv-sidebar { width: 100%; max-width: none; max-height: 40vh; border-right: none; border-bottom: 1px solid #e2e5e9; }
	.nca-lv-content { padding: 20px 16px 40px; }
}

/* ── Модалка результата теста урока (по центру экрана) ── */
.nca-qrm { display: none; position: fixed; inset: 0; z-index: 100000; align-items: center; justify-content: center; padding: 20px; }
.nca-qrm.nca-qrm-open { display: flex; }
.nca-qrm-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, 0.55); }
.nca-qrm-box {
	position: relative;
	background: #fff; border-radius: 12px; padding: 28px;
	max-width: 420px; width: 100%;
	box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
	text-align: center;
}
.nca-qrm-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.nca-qrm.nca-qrm-pass .nca-qrm-title { color: #1e7a34; }
.nca-qrm.nca-qrm-fail .nca-qrm-title { color: #b32d2e; }
.nca-qrm-text { font-size: 14px; color: #555; margin-bottom: 22px; }
.nca-qrm-actions { display: flex; flex-direction: column; gap: 10px; }
.nca-qrm-actions .nca-btn { width: 100%; }

/* ── Программа курса (curriculum) ── */
.nca-lesson { border: 1px solid #e2e5e9; border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.nca-lesson-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.nca-lesson-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.nca-lesson.nca-lesson-done { border-color: #1e7a34; background: #f4fbf5; }
.nca-mark-lesson-btn {
	background: #eef1f5; border: none; border-radius: 6px; padding: 6px 12px;
	font-size: 13px; cursor: pointer; white-space: nowrap;
}
.nca-lesson.nca-lesson-done .nca-mark-lesson-btn { background: #1e7a34; color: #fff; }
.nca-lesson-badge-quiz { font-size: 12px; color: #667085; }

.nca-lesson.nca-lesson-locked { background: #f7f8fa; }
.nca-lesson.nca-lesson-locked .nca-lesson-content,
.nca-lesson.nca-lesson-locked .nca-quiz-form { display: none; }
.nca-lesson-locked-note { font-size: 13px; color: #8a6100; margin: 6px 0 0; }

/* ── Тест (общий для урока и курса) ── */
.nca-quiz-question { margin-bottom: 16px; }
.nca-quiz-question-text { font-weight: 600; margin-bottom: 8px; }
.nca-quiz-option { display: block; margin-bottom: 4px; font-size: 14px; }
.nca-quiz-meta { color: #555; font-size: 14px; }
.nca-quiz-result { margin-top: 16px; padding: 14px; border-radius: 8px; font-size: 15px; }
.nca-quiz-result.nca-result-pass { background: #e3f6e5; color: #1e7a34; }
.nca-quiz-result.nca-result-fail { background: #fde8e8; color: #b32d2e; }

/* ── Преподаватель ── */
.nca-instructor-card { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.nca-instructor-photo { width: 120px; height: 120px; border-radius: 8px; object-fit: cover; background: #eef1f5; }
.nca-instructor-name { margin: 0 0 4px; font-size: 20px; }
.nca-instructor-title { color: #667085; margin: 0 0 12px; }

/* ── Отзывы ── */
.nca-reviews-summary { display: flex; gap: 24px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.nca-reviews-avg { font-size: 40px; font-weight: 700; color: #e60000; }
.nca-reviews-bars { flex: 1; min-width: 200px; }
.nca-reviews-bar-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.nca-reviews-bar-track { flex: 1; height: 6px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.nca-reviews-bar-fill { height: 100%; background: #f5a623; }
.nca-review-item { display: flex; gap: 12px; margin-bottom: 20px; }
.nca-review-avatar { width: 44px; height: 44px; border-radius: 50%; }
.nca-review-author { font-weight: 600; margin: 0; }
.nca-review-stars { color: #f5a623; font-size: 13px; }
.nca-review-text { margin: 4px 0 0; color: #333; }

.nca-review-form { border: 1px solid #e2e5e9; border-radius: 8px; padding: 16px; margin-top: 20px; }
.nca-review-stars-input { font-size: 24px; color: #d0d5dd; cursor: pointer; margin-bottom: 10px; }
.nca-review-star { cursor: pointer; }
.nca-review-star.nca-star-on { color: #f5a623; }
.nca-review-form textarea { width: 100%; min-height: 80px; margin-bottom: 10px; }

/* ── Баннер обязательной аттестации ── */
.nca-att-banner {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	background: #101828;
	color: #fff;
	z-index: 9998;
	padding: 12px 16px;
}
.nca-att-banner-inner {
	max-width: 900px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.nca-att-banner-text { flex: 1; font-size: 14px; }
.nca-att-banner-link {
	background: #e60000; color: #fff !important; text-decoration: none;
	padding: 7px 14px; border-radius: 6px; font-size: 14px; white-space: nowrap;
}
.nca-att-banner-close {
	background: transparent; border: none; color: #fff; font-size: 16px; cursor: pointer; opacity: 0.7;
}
.nca-att-banner-close:hover { opacity: 1; }
body.nca-att-banner-open { padding-bottom: 56px; }

@media (max-width: 600px) {
	.nca-catalog { grid-template-columns: 1fr; }
	.nca-course-header { flex-direction: column-reverse; }
	.nca-course-image-side { width: 100%; }
}
