/**
 * Early course retake.
 */

.learndash-wrapper .ld-course-status.ld-course-status-enrolled:has(.sab-early-retake--course) {
	flex-wrap: wrap;
	align-items: center;
}

.learndash-wrapper .ld-course-status.ld-course-status-enrolled:has(.sab-early-retake--course) .ld-progress {
	flex: 1 1 auto;
	min-width: 220px;
}

.learndash-wrapper .ld-course-status.ld-course-status-enrolled:has(.sab-early-retake--course) .ld-status {
	flex: 0 0 auto;
}

.learndash-wrapper .ld-course-status .sab-early-retake--course {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	flex: 1 0 100%;
	width: 100%;
	box-sizing: border-box;
	margin: 16px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--theme-color-bd_color, #e2e7ed);
	border-radius: 0;
	background: transparent;
}

.learndash-wrapper .ld-course-status .sab-early-retake--course .sab-early-retake__hint {
	margin: 0;
	flex: 1 1 280px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--theme-color-text, #6b6b6b);
}

.learndash-wrapper .ld-course-status .sab-early-retake--course .sab-early-retake__button {
	flex: 0 0 auto;
}

.sab-early-retake__button,
.sab-early-retake-modal__confirm {
	display: inline-block;
	padding: 12px 24px;
	background-color: #f08c1d;
	color: #ffffff;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.2;
	text-decoration: none;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.sab-early-retake__button:hover,
.sab-early-retake__button:focus,
.sab-early-retake-modal__confirm:hover,
.sab-early-retake-modal__confirm:focus {
	background-color: #d97a0f;
	color: #ffffff;
}

.sab-early-retake__button:disabled,
.sab-early-retake-modal__confirm:disabled {
	opacity: 0.7;
	cursor: wait;
}

.sab-early-retake__hint {
	margin: 0.6rem 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: #6b6b6b;
}

.sab-early-retake--certificates .sab-early-retake__button {
	padding: 0.4em 0.9em;
	font-size: 0.85rem;
	white-space: nowrap;
}

.sab-early-retake--certificates.sab-early-retake--pending .sab-early-retake__hint {
	margin: 0;
	font-size: 0.8rem;
}

.sab-cert-retake-hint {
	display: block;
	margin-top: 0.25em;
	font-size: 11px;
	line-height: 1.3;
	color: #6b6b6b;
}

@media (max-width: 767px) {
	.learndash-wrapper .ld-course-status .sab-early-retake--course {
		flex-direction: column;
		align-items: stretch;
	}

	.learndash-wrapper .ld-course-status .sab-early-retake--course .sab-early-retake__button {
		width: 100%;
		text-align: center;
	}
}

html.sab-early-retake-modal-open,
body.sab-early-retake-modal-open {
	overflow: hidden;
}

.sab-early-retake-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
}

.sab-early-retake-modal[hidden] {
	display: none !important;
}

.sab-early-retake-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 24, 31, 0.55);
}

.sab-early-retake-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 520px;
	max-height: calc(100vh - 48px);
	overflow: auto;
	padding: 28px 28px 24px;
	background: #ffffff;
	border-radius: 10px;
	box-shadow: 0 18px 48px rgba(20, 24, 31, 0.22);
	box-sizing: border-box;
	outline: none;
}

.sab-early-retake-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #576168;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.sab-early-retake-modal__close:hover,
.sab-early-retake-modal__close:focus {
	background: #f3f5f7;
	color: #1d2327;
}

.sab-early-retake-modal__title {
	margin: 0 36px 12px 0;
	font-size: 1.25rem;
	line-height: 1.3;
	color: #1d2327;
}

.sab-early-retake-modal__body {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.55;
	color: #3d454c;
}

.sab-early-retake-modal__body p {
	margin: 0 0 10px;
}

.sab-early-retake-modal__body ul {
	margin: 0;
	padding-left: 1.2em;
}

.sab-early-retake-modal__body li + li {
	margin-top: 8px;
}

.sab-early-retake-modal__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
}

.sab-early-retake-modal__cancel {
	display: inline-block;
	padding: 12px 20px;
	background: #ffffff;
	color: #3d454c;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.2;
	border: 1px solid #cfd6dd;
	border-radius: 6px;
	cursor: pointer;
}

.sab-early-retake-modal__cancel:hover,
.sab-early-retake-modal__cancel:focus {
	background: #f3f5f7;
	color: #1d2327;
}

@media (max-width: 767px) {
	.sab-early-retake-modal__actions {
		flex-direction: column-reverse;
	}

	.sab-early-retake-modal__cancel,
	.sab-early-retake-modal__confirm {
		width: 100%;
		text-align: center;
	}
}
