/**
 * VendoLearning — style frontu logowania i hasła (Etap 3).
 *
 * Celowo neutralne i wąsko zakresowane (.vl-auth), aby wpasować się w motyw klienta
 * (Elementor) bez nadpisywania jego typografii czy kolorystyki globalnej.
 */

.vl-auth {
	max-width: 420px;
	margin: 0 auto;
}

.vl-auth-card {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 24px;
	background: #fff;
}

.vl-auth-title {
	margin: 0 0 12px;
	font-size: 1.4em;
	line-height: 1.2;
}

.vl-auth-text {
	margin: 0 0 16px;
	color: #444;
}

.vl-field {
	margin-bottom: 14px;
}

.vl-field label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

.vl-field input[type="email"],
.vl-field input[type="password"],
.vl-field input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #c4c4c4;
	border-radius: 6px;
	font-size: 1em;
}

.vl-field input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 2px rgba( 37, 99, 235, 0.2 );
}

.vl-field-check label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
}

.vl-field-check input {
	width: auto;
}

.vl-btn {
	display: inline-block;
	padding: 10px 18px;
	border: 0;
	border-radius: 6px;
	background: #2563eb;
	color: #fff;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.vl-btn:hover {
	background: #1d4ed8;
}

.vl-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.vl-btn-secondary {
	background: #6b7280;
}

.vl-btn-secondary:hover {
	background: #4b5563;
}

.vl-links {
	margin: 14px 0 0;
	font-size: 0.92em;
}

.vl-hint {
	margin: 0 0 14px;
	color: #6b7280;
	font-size: 0.9em;
}

.vl-msg {
	margin: 0 0 12px;
	font-size: 0.95em;
	min-height: 1.2em;
}

.vl-msg.vl-ok {
	color: #15803d;
}

.vl-msg.vl-err {
	color: #b91c1c;
}

.vl-notice {
	margin: 0 0 16px;
	padding: 10px 12px;
	border-radius: 6px;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #9a3412;
	font-size: 0.95em;
}


/* ==========================================================================
   Etap 5 — panel kursanta, widok kursu, widok lekcji.
   Style dopisane do istniejącej, neutralnej konwencji .vl-* (Etap 3),
   aby wirtualne strony /panel i /kurs/... wpasowały się w motyw klienta.
   ========================================================================== */

/* Kontener wirtualnych stron. */
.vl-wrap {
	margin: 0 auto;
}

.vl-page {
	max-width: 960px;
	margin: 0 auto;
	padding: 24px 0;
}

.vl-page-title {
	margin: 0 0 8px;
	line-height: 1.2;
}

.vl-page-lead {
	margin: 0 0 20px;
	color: #444;
}

/* Okruszki nawigacyjne. */
.vl-breadcrumbs {
	margin: 0 0 16px;
	font-size: 0.9em;
	color: #6b7280;
}

.vl-breadcrumbs a {
	color: #2563eb;
	text-decoration: none;
}

.vl-breadcrumbs a:hover {
	text-decoration: underline;
}

.vl-sep {
	margin: 0 6px;
	color: #9ca3af;
}

.vl-current {
	color: #374151;
}

/* Nagłówek panelu. */
.vl-dashboard-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin: 0 0 8px;
}

.vl-dashboard-title {
	margin: 0;
	line-height: 1.2;
}

/* Sekcje treści. */
.vl-section {
	margin: 28px 0 0;
}

.vl-section-title {
	margin: 0 0 16px;
	font-size: 1.2em;
}

.vl-empty {
	color: #6b7280;
}

/* Siatka kart kursów na panelu. */
.vl-course-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) );
	gap: 20px;
}

.vl-course-card {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.vl-course-card:hover {
	border-color: #c7d2fe;
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.08 );
}

.vl-course-card-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.vl-course-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	background: #f3f4f6;
	overflow: hidden;
}

.vl-course-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.vl-course-thumb-fallback {
	font-size: 40px;
	width: 40px;
	height: 40px;
	color: #9ca3af;
}

.vl-course-body {
	padding: 16px;
}

.vl-course-name {
	margin: 0 0 12px;
	font-size: 1.05em;
	line-height: 1.3;
}

.vl-course-access {
	margin: 10px 0 0;
	font-size: 0.85em;
	color: #6b7280;
}

/* Paski postępu. */
.vl-progress {
	height: 8px;
	border-radius: 999px;
	background: #e5e7eb;
	overflow: hidden;
}

.vl-progress-lg {
	height: 12px;
}

.vl-progress-bar {
	height: 100%;
	background: #2563eb;
	border-radius: inherit;
	transition: width 0.3s ease;
}

.vl-progress-text {
	margin: 8px 0 0;
	font-size: 0.85em;
	color: #6b7280;
}

/* Widok kursu — sekcja podsumowania. */
.vl-course-overview {
	margin: 0 0 24px;
	padding: 20px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
}

.vl-course-desc {
	margin: 16px 0 0;
	color: #374151;
}

.vl-course-desc :last-child {
	margin-bottom: 0;
}

/* Moduły i lista lekcji. */
.vl-modules {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.vl-module-title {
	margin: 0 0 12px;
	font-size: 1.1em;
	padding-bottom: 8px;
	border-bottom: 1px solid #eaeaea;
}

.vl-lesson-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.vl-lesson-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid #e8e8e8;
	border-radius: 6px;
	margin-bottom: 8px;
	background: #fff;
}

.vl-lesson-item.is-completed {
	background: #f6fdf9;
	border-color: #cdeedd;
}

.vl-lesson-item.is-locked {
	background: #fafafa;
	color: #9ca3af;
}

.vl-lesson-icon {
	flex: 0 0 auto;
	font-size: 20px;
	width: 20px;
	height: 20px;
	color: #6b7280;
}

.vl-lesson-item.is-completed .vl-lesson-icon {
	color: #15803d;
}

.vl-lesson-item.is-locked .vl-lesson-icon {
	color: #9ca3af;
}

a.vl-lesson-title {
	color: #1f2937;
	text-decoration: none;
	font-weight: 600;
}

a.vl-lesson-title:hover {
	color: #2563eb;
}

.vl-lesson-title {
	flex: 1 1 auto;
}

.vl-lesson-note {
	display: inline-block;
	margin-left: 8px;
	font-size: 0.82em;
	font-weight: 400;
	color: #9ca3af;
}

.vl-lesson-badge {
	flex: 0 0 auto;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #15803d;
	background: #dcfce7;
	padding: 3px 8px;
	border-radius: 999px;
}

/* Widok lekcji. */
.vl-lesson-status-done {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	color: #15803d;
	font-weight: 600;
}

.vl-player-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	aspect-ratio: 16 / 9;
	margin: 0 0 24px;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	background: #f8fafc;
	color: #94a3b8;
	text-align: center;
}

.vl-player-placeholder .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
}

.vl-player-note {
	margin: 0;
}

.vl-player-meta {
	margin: 0;
	font-size: 0.85em;
	color: #64748b;
}

.vl-lesson-desc {
	margin: 0 0 24px;
	color: #374151;
}

.vl-lesson-desc :last-child {
	margin-bottom: 0;
}

/* Materiały do pobrania. */
.vl-attachments {
	margin: 0 0 24px;
	padding: 16px 20px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
}

.vl-attachments-title {
	margin: 0 0 12px;
	font-size: 1.05em;
}

.vl-attachments-files {
	list-style: none;
	margin: 0;
	padding: 0;
}

.vl-attachments-files li {
	margin-bottom: 8px;
}

.vl-attachments-files li:last-child {
	margin-bottom: 0;
}

.vl-attachments-files a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #2563eb;
	text-decoration: none;
}

.vl-attachments-files a:hover {
	text-decoration: underline;
}

.vl-attachments-files .dashicons {
	color: #6b7280;
}

/* Nawigacja prev/next w lekcji. */
.vl-lesson-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 24px 0 0;
	padding-top: 20px;
	border-top: 1px solid #eaeaea;
}

.vl-nav-next {
	text-align: right;
}

.vl-btn-sm {
	padding: 7px 14px;
	font-size: 0.9em;
}

.vl-btn-disabled {
	background: #cbd5e1;
	color: #fff;
	cursor: default;
	pointer-events: none;
}

.vl-btn-disabled:hover {
	background: #cbd5e1;
}

/* Wariant powiadomienia: lekcja zablokowana sekwencją. */
.vl-notice-lock {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ===========================================================================
   Etap 6 — odtwarzacz wideo i postęp lekcji (§6.4)
   =========================================================================== */

/* Responsywny kontener 16:9 — wspólny dla iframe (Cloudflare/Vimeo/YouTube)
   i pliku własnego (HTML5). */
.vl-player-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	margin: 0 0 20px;
	border-radius: 8px;
	overflow: hidden;
	background: #000;
}

/* iframe budowany przez JS (Cloudflare/Vimeo/YouTube) oraz osadzenie YouTube. */
.vl-player-frame .vl-iframe,
.vl-player-frame iframe,
.vl-player-frame #vl-yt,
.vl-player-frame #vl-yt iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Plik własny (HTML5). */
.vl-player-frame-html5 .vl-html5 {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #000;
}

/* Stan „brak wideo" — neutralna ramka z ikoną. */
.vl-player-frame-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	aspect-ratio: 16 / 9;
	border: 1px dashed #cbd5e1;
	background: #f8fafc;
	color: #94a3b8;
	text-align: center;
}

.vl-player-frame-empty .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
}

/* Pasek akcji: przycisk „Oznacz jako ukończone" + postęp kursu na żywo. */
.vl-lesson-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin: 0 0 8px;
}

#vl-mark-complete[disabled] {
	background: #16a34a;
	color: #fff;
	cursor: default;
	opacity: 1;
}

#vl-mark-complete[disabled]:hover {
	background: #16a34a;
}

/* Licznik postępu kursu (aktualizowany przez JS). */
.vl-progress-live {
	font-weight: 600;
	color: #475569;
}

.vl-progress-live.is-complete {
	color: #15803d;
}

/* Komunikat statusu pod odtwarzaczem (ok/err). Pusty — niewidoczny. */
.vl-player-msg {
	margin: 0 0 20px;
	font-weight: 600;
}

.vl-player-msg:empty {
	display: none;
}

.vl-player-msg.vl-ok {
	color: #15803d;
}

.vl-player-msg.vl-err {
	color: #b91c1c;
}

/* Bezpiecznik: element z atrybutem hidden pozostaje ukryty mimo stylów motywu. */
#vl-status-done[hidden] {
	display: none;
}

/* ===================================================================
 * Sekcja „Moje certyfikaty" w panelu + przyciski pobrania (Etap 8)
 * =================================================================== */
.vl-cert-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.vl-cert-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid #e2e2e6;
	border-radius: 8px;
	background: #fff;
	margin-bottom: 10px;
}

.vl-cert-item .vl-cert-icon {
	color: #b8860b;
	font-size: 22px;
	width: 22px;
	height: 22px;
	flex: 0 0 auto;
}

.vl-cert-item .vl-cert-name {
	flex: 1 1 auto;
	font-weight: 600;
}

.vl-cert-item .vl-cert-download {
	flex: 0 0 auto;
}

/* Przycisk / podpowiedź pobrania certyfikatu na stronie kursu. */
.vl-cert-download {
	margin-top: 12px;
}

.vl-btn-cert .dashicons {
	vertical-align: text-bottom;
	margin-right: 4px;
}

.vl-cert-hint {
	margin-top: 12px;
	color: #555;
	font-style: italic;
}

/* ==========================================================================
   Dwuetapowe logowanie (2FA) — panel kursanta i krok logowania (Etap 9, §6.6)
   ========================================================================== */

/* Wariant czerwony przycisku — operacje destrukcyjne (wyłączenie 2FA). */
.vl-btn-danger {
	background: #b91c1c;
}

.vl-btn-danger:hover {
	background: #991b1b;
}

.vl-2fa .vl-2fa-status {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 8px;
	font-weight: 600;
}

.vl-2fa .vl-2fa-status-on {
	color: #15803d;
}

.vl-2fa .vl-2fa-status .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
}

/* Kroki konfiguracji (numerowana lista pod przyciskiem „Włącz”). */
.vl-2fa-steps {
	margin: 4px 0 16px 1.2em;
	padding: 0;
	color: #374151;
	font-size: 0.95em;
	line-height: 1.5;
}

/* Pojemnik na kod QR — wstrzykiwany inline SVG. Białe tło pod skan. */
.vl-2fa-qr {
	display: inline-block;
	max-width: 220px;
	width: 100%;
	padding: 12px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	line-height: 0;
}

.vl-2fa-qr svg {
	display: block;
	width: 100%;
	height: auto;
}

/* Sekret do ręcznego wpisania w aplikacji. */
.vl-2fa-secret {
	display: inline-block;
	margin: 0 0 16px;
	padding: 8px 12px;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.05em;
	letter-spacing: 0.15em;
	word-break: break-all;
}

.vl-2fa-setup {
	margin-top: 12px;
}

/* Akcje zarządzania (regeneracja / wyłączenie) — w jednym rzędzie, łamane. */
.vl-2fa-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 12px 0;
}

/* Kody zapasowe — siatka monospaced, czytelna do przepisania/wydruku. */
.vl-2fa-codes {
	margin-top: 16px;
	padding: 14px 16px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
}

.vl-2fa-codes-title {
	margin: 0 0 8px;
	font-size: 1em;
}

.vl-2fa-code-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px 18px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.05em;
	letter-spacing: 0.08em;
}

.vl-2fa-code-list li {
	padding: 4px 0;
}

/* Podtytuł kroku 2FA na ekranie logowania. */
.vl-auth-subtitle {
	margin: 0 0 8px;
	font-size: 1.15em;
}

@media (max-width: 480px) {
	.vl-2fa-code-list {
		grid-template-columns: 1fr;
	}
}

/**
 * Wiadomości administratora w panelu kursanta (Etap 11 — §6.5).
 * Globalna = akcent ostrzegawczy (np. prace techniczne); per-user = box informacyjny.
 */
.vl-message {
	border: 1px solid #e0e0e0;
	border-left-width: 4px;
	border-radius: 8px;
	padding: 14px 16px;
	margin: 0 0 16px;
	background: #fff;
}

.vl-message-global {
	border-left-color: #b26b00;
	background: #fff8ec;
}

.vl-message-user {
	border-left-color: #2271b1;
	background: #f3f8fd;
}

.vl-message-header {
	margin: 0 0 6px;
	font-size: 1.05em;
	line-height: 1.3;
}

.vl-message-body {
	margin: 0;
	color: #333;
}

.vl-message-body p {
	margin: 0 0 8px;
}

.vl-message-body p:last-child {
	margin-bottom: 0;
}

.vl-message-action {
	margin: 12px 0 0;
}


/* ==========================================================================
   Menu kursanta (sidebar na desktopie / sticky pasek + hamburger na mobile).
   Kolory i wymiary sterowane zmiennymi z VL_Appearance::inline_css() (z fallbackami).
   Powłoka .vl-app owija menu + treść; na podstronach treść jest w .vl-app-main > .vl-wrap > .vl-page.
   ========================================================================== */

.vl-app--has-menu {
	display: flex;
	align-items: flex-start;
	gap: 24px;
}

.vl-app-main {
	flex: 1 1 auto;
	min-width: 0;
}

.vl-menu {
	flex: 0 0 auto;
	width: var(--vl-menu-w, 260px);
	box-sizing: border-box;
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + 16px);
	max-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px) - 32px);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px;
	background: var(--vl-menu-bg, #ffffff);
	border: 1px solid var(--vl-menu-border, #e5e7eb);
	border-radius: var(--vl-menu-radius, 10px);
	box-shadow: var(--vl-menu-shadow, none);
	font-size: var(--vl-menu-fs, 15px);
}

.vl-menu-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
}

.vl-menu-logo {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	text-decoration: none;
}

.vl-menu-logo-img {
	display: block;
	width: auto;
	height: auto;
	max-height: var(--vl-logo-max-h, 40px);
	max-width: 100%;
}

.vl-menu-logo-text {
	font-weight: 700;
	font-size: 1.05em;
	color: var(--vl-menu-text, #1f2937);
}

.vl-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--vl-menu-border, #e5e7eb);
	border-radius: 8px;
	background: transparent;
	color: var(--vl-menu-text, #1f2937);
	cursor: pointer;
}

.vl-menu-items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.vl-menu-item {
	margin: 0;
}

.vl-menu-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: var(--vl-menu-radius, 10px);
	border-left: 3px solid transparent;
	color: var(--vl-menu-text, #1f2937);
	text-decoration: none;
	line-height: 1.2;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.vl-menu-link:hover,
.vl-menu-link:focus {
	background: var(--vl-menu-item-hover, #f3f4f6);
	color: var(--vl-menu-text-hover, #111827);
}

.vl-menu-link.is-active {
	background: var(--vl-menu-item-active, #2563eb);
	color: var(--vl-menu-text-active, #ffffff);
	border-left-color: var(--vl-menu-accent, #2563eb);
}

.vl-menu-link .dashicons {
	width: 20px;
	height: 20px;
	font-size: 20px;
	flex: 0 0 auto;
}

.vl-menu-label {
	flex: 1 1 auto;
}

.vl-menu-foot {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--vl-menu-border, #e5e7eb);
}

/* Sekcja „Szybki dostęp" (przyciski na stronie głównej). */
.vl-quicklinks {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.vl-quicklink {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border: 1px solid var(--vl-menu-border, #e5e7eb);
	border-radius: var(--vl-menu-radius, 10px);
	background: #ffffff;
	color: #1f2937;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vl-quicklink:hover,
.vl-quicklink:focus {
	border-color: var(--vl-menu-accent, #2563eb);
	box-shadow: var(--vl-menu-shadow, none);
}

.vl-quicklink .dashicons {
	width: 22px;
	height: 22px;
	font-size: 22px;
	color: var(--vl-menu-accent, #2563eb);
}

/* Mobile: menu jako sticky pasek u góry; pozycje chowane do hamburgera. */
@media (max-width: 782px) {
	.vl-app--has-menu {
		display: block;
	}

	.vl-menu {
		position: sticky;
		top: 0;
		z-index: 100;
		width: auto;
		max-height: none;
		overflow: visible;
		gap: 0;
		margin-bottom: 16px;
		padding: 8px 12px;
		border-width: 0 0 1px 0;
		border-radius: 0;
	}

	.vl-menu-top {
		margin-bottom: 0;
	}

	.vl-menu-toggle {
		display: inline-flex;
	}

	.vl-menu-toggle .dashicons {
		width: 24px;
		height: 24px;
		font-size: 24px;
	}

	.vl-menu-items,
	.vl-menu-foot {
		display: none;
	}

	.vl-menu.is-open .vl-menu-items {
		display: flex;
		margin-top: 8px;
	}

	.vl-menu.is-open .vl-menu-foot {
		display: block;
	}
}
