/**
 * Preview Gate for Tutor LMS - front-end styles.
 *
 * Many rules use !important deliberately. Tutor LMS ships its own form
 * styling built for a full-width page, and themes commonly style bare
 * <button> and <input> elements globally. Without raising specificity the
 * embedded form is unreadable inside a narrow card or popup.
 */

.rptl-card,
.rptl-modal {
	--rptl-ink: #0f172a;
	--rptl-muted: #64748b;
	--rptl-line: #cbd5e1;
	--rptl-accent: #1e2a78;
	--rptl-radius: 14px;
}

/* Hide any player the theme renders outside the_content() for a guest on a
   locked lesson. The real block is server-side; this only tidies the view. */
body.rptl-locked-lesson .tutor-lesson-video-wrap,
body.rptl-locked-lesson .tutor-video-player,
body.rptl-locked-lesson video,
body.rptl-locked-lesson iframe {
	display: none !important;
}

/* ---------- Locked lesson card ---------- */

.rptl-card {
	max-width: 520px;
	margin: 3rem auto;
	padding: 2.5rem 2rem;
	text-align: center;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--rptl-radius);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}

.rptl-eyebrow {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #047857;
	background: #ecfdf5;
	border-radius: 999px;
	padding: 4px 12px;
	margin-bottom: 1rem;
}

.rptl-card-title,
.rptl-modal h3 {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	line-height: 1.3;
	color: var(--rptl-ink);
}

.rptl-card-text,
.rptl-modal > p {
	color: var(--rptl-muted);
	font-size: 0.95rem;
	line-height: 1.6;
	margin: 0 auto 1.5rem;
	max-width: 42ch;
}

/* ---------- Tabs ---------- */

.rptl-auth {
	text-align: left;
}

.rptl-tabs {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: #f1f5f9;
	border-radius: 10px;
	padding: 4px;
	margin-bottom: 1.5rem;
}

.rptl-auth .rptl-tabs .rptl-tab {
	position: relative;
	z-index: 1;
	-webkit-appearance: none;
	appearance: none;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.9rem !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	color: var(--rptl-muted) !important;
	padding: 0.7rem 0.5rem !important;
	margin: 0 !important;
	width: 100%;
	min-height: 0 !important;
	border-radius: 7px !important;
	transition: color 0.2s ease;
}

.rptl-auth .rptl-tabs .rptl-tab:hover,
.rptl-auth .rptl-tabs .rptl-tab.is-active {
	color: var(--rptl-ink) !important;
}

.rptl-auth .rptl-tabs .rptl-tab:focus-visible {
	outline: 2px solid var(--rptl-accent);
	outline-offset: 2px;
}

.rptl-tab-indicator {
	position: absolute;
	top: 4px;
	left: 4px;
	width: calc(50% - 4px);
	height: calc(100% - 8px);
	background: #fff;
	border-radius: 7px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.rptl-tabs[data-active="register"] .rptl-tab-indicator {
	transform: translateX(100%);
}

.rptl-panel[hidden] {
	display: none !important;
}

/* ---------- Embedded Tutor LMS forms ---------- */

.rptl-panel .tutor-login-wrap,
.rptl-panel .tutor-registration-wrap,
.rptl-panel form {
	max-width: 100% !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	border: 0 !important;
	background: none !important;
}

/* Tutor repeats its own headings and switch-form links inside each form.
   The tabs already do that job, and the links are rewired by the script to
   switch tabs rather than navigate away. */
.rptl-panel form > h2,
.rptl-panel .tutor-login-form-title,
.rptl-panel .tutor-registration-form-title {
	display: none !important;
}

.rptl-panel .tutor-form-control,
.rptl-panel input[type="text"],
.rptl-panel input[type="tel"],
.rptl-panel input[type="email"],
.rptl-panel input[type="password"] {
	width: 100% !important;
	box-sizing: border-box !important;
	height: auto !important;
	padding: 0.7rem 0.85rem !important;
	font-size: 0.95rem !important;
	line-height: 1.4 !important;
	border: 1px solid var(--rptl-line) !important;
	border-radius: 8px !important;
	background: #fff !important;
	color: var(--rptl-ink) !important;
	box-shadow: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rptl-panel .tutor-form-control:focus,
.rptl-panel input[type="text"]:focus,
.rptl-panel input[type="tel"]:focus,
.rptl-panel input[type="email"]:focus,
.rptl-panel input[type="password"]:focus {
	border-color: var(--rptl-accent) !important;
	box-shadow: 0 0 0 3px rgba(30, 42, 120, 0.12) !important;
	outline: none !important;
}

.rptl-panel input::placeholder {
	color: #94a3b8;
	opacity: 1;
}

.rptl-panel label,
.rptl-panel .tutor-label {
	font-size: 0.82rem !important;
	font-weight: 600 !important;
	color: var(--rptl-ink) !important;
	margin-bottom: 0.35rem !important;
	display: inline-block;
}

/* Tighten Tutor's page-level field spacing for the narrower container. */
.rptl-panel .tutor-input-field,
.rptl-panel .tutor-mb-8 {
	margin-bottom: 0.9rem !important;
}

.rptl-panel .tutor-mb-3 {
	margin-bottom: 0.35rem !important;
}

.rptl-panel input[type="checkbox"] {
	width: auto !important;
	margin-inline-end: 0.5rem;
	vertical-align: middle;
}

.rptl-panel input[type="checkbox"] + label,
.rptl-panel .tutor-checkbox + label {
	font-weight: 500 !important;
	font-size: 0.85rem !important;
	color: var(--rptl-muted) !important;
	margin-bottom: 0 !important;
}

.rptl-panel button[type="submit"],
.rptl-panel input[type="submit"],
.rptl-panel .tutor-btn-primary {
	width: 100% !important;
	padding: 0.8rem 1.25rem !important;
	margin-top: 0.35rem !important;
	font-size: 0.95rem !important;
	font-weight: 600 !important;
	border-radius: 8px !important;
	background: var(--rptl-accent) !important;
	border: 0 !important;
	color: #fff !important;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.rptl-panel button[type="submit"]:hover,
.rptl-panel input[type="submit"]:hover,
.rptl-panel .tutor-btn-primary:hover {
	opacity: 0.9;
}

/* Label generated for a field that ships without one, for example a phone
   field added by another plugin. width/flex-basis keep it on its own line
   even when the surrounding wrapper is a flex or grid container. */
.rptl-generated-label {
	display: block;
	width: 100%;
	flex: 0 0 100%;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--rptl-ink);
	margin-bottom: 0.35rem;
}

/* ---------- Popup ---------- */

.rptl-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	z-index: 100000;
	align-items: flex-start;
	justify-content: center;
	padding: 1.5rem 1rem;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.rptl-overlay.is-open {
	display: flex;
}

.rptl-modal {
	position: relative;
	background: #fff;
	width: 100%;
	max-width: 440px;
	margin: auto;
	border-radius: 16px;
	padding: 2rem 1.75rem;
	text-align: center;
	box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
	animation: rptl-pop 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* The signup form is tall. Keep the popup on screen and scroll inside it
   rather than letting it run past the viewport. */
.rptl-modal .rptl-panel {
	max-height: min(52vh, 460px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-inline-end: 4px;
}

.rptl-modal .rptl-panel::-webkit-scrollbar {
	width: 6px;
}

.rptl-modal .rptl-panel::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 999px;
}

@keyframes rptl-pop {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {

	.rptl-modal {
		animation: none;
	}

	.rptl-tab-indicator {
		transition: none;
	}
}

.rptl-close {
	position: absolute;
	top: 12px;
	inset-inline-end: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0 !important;
	background: none !important;
	border: 0 !important;
	border-radius: 8px !important;
	cursor: pointer;
	color: var(--rptl-muted);
	transition: background 0.15s ease, color 0.15s ease;
}

.rptl-close:hover {
	background: #f1f5f9 !important;
	color: var(--rptl-ink);
}

@media (max-width: 480px) {

	.rptl-card {
		padding: 1.75rem 1.25rem;
		margin: 2rem auto;
	}

	.rptl-modal {
		padding: 1.75rem 1.25rem;
	}

	.rptl-modal .rptl-panel {
		max-height: 46vh;
	}
}

/* ---------- Curriculum badges ---------- */

.rptl-preview-badge {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #047857;
	background: #d1fae5;
	border-radius: 999px;
	padding: 2px 10px;
	margin-inline-start: 8px;
	vertical-align: middle;
}

.rptl-unit-badge {
	display: inline-flex;
	align-items: center;
	font-size: 12px;
	font-weight: 700;
	color: #92400e;
	background: #fef3c7;
	border-radius: 999px;
	padding: 3px 12px;
	margin-inline-start: 10px;
	vertical-align: middle;
}

.rptl-unit-has-preview {
	background: #fffbeb !important;
}
