/**
 * LearnKit — Auth Pages (Login & Register)
 */

/* ── Page layout ─────────────────────────────────────────────────────────── */
.lk-auth-page {
	min-height: 100vh;
	background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 16px;
}

.lk-auth-wrap {
	width: 100%;
	max-width: 480px;
}

/* ── Brand ───────────────────────────────────────────────────────────────── */
.lk-auth-brand {
	text-align: center;
	margin-bottom: 24px;
}

.lk-auth-logo {
	width: 56px;
	height: 56px;
	border-radius: 12px;
	object-fit: contain;
	display: block;
	margin: 0 auto 10px;
	box-shadow: 0 2px 12px rgba(0,0,0,.12);
}

.lk-auth-site-name {
	font-size: 20px;
	font-weight: 700;
	color: #1a1a2e;
	margin: 0;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.lk-auth-card {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 4px 32px rgba(0,0,0,.08);
	padding: 36px 40px;
}

@media (max-width: 520px) {
	.lk-auth-card {
		padding: 28px 20px;
	}
}

.lk-auth-title {
	font-size: 22px;
	font-weight: 700;
	color: #1a1a2e;
	margin: 0 0 6px;
}

.lk-auth-subtitle {
	font-size: 14px;
	color: #888;
	margin: 0 0 24px;
}

/* ── Notice ──────────────────────────────────────────────────────────────── */
.lk-auth-notice {
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
	margin-bottom: 18px;
}

.lk-auth-notice.is-error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.lk-auth-notice.is-success {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

/* ── Fields ──────────────────────────────────────────────────────────────── */
.lk-auth-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.lk-auth-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.lk-auth-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

@media (max-width: 380px) {
	.lk-auth-field-row {
		grid-template-columns: 1fr;
	}
}

.lk-auth-label {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.lk-req {
	color: #ef4444;
}

.lk-auth-label-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.lk-auth-forgot {
	font-size: 12px;
	color: #6366f1;
	text-decoration: none;
}

.lk-auth-forgot:hover {
	text-decoration: underline;
}

/* ── Input ───────────────────────────────────────────────────────────────── */
.lk-auth-input-wrap {
	position: relative;
}

.lk-auth-input-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #9ca3af;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	pointer-events: none;
}
.lk-auth-input-icon svg {
	width: 16px;
	height: 16px;
	display: block;
	flex: 0 0 auto;
}

.lk-auth-input {
	width: 100%;
	box-sizing: border-box;
	/* Comfortable padding that keeps placeholder/value clear of the left
	   icon (16 px wide at left:14 px → reserves up to 30 px) and the right
	   show/hide-password toggle (16 px wide at right:14 px). */
	padding: 11px 44px 11px 44px;
	border: 1.5px solid #e5e7eb;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.4;
	color: #111827;
	background: #fff;
	transition: border-color .2s, box-shadow .2s;
	outline: none;
}

/* Inputs without a left icon (placed directly inside .lk-auth-field, not
   inside .lk-auth-input-wrap) get standard padding back. */
.lk-auth-field > .lk-auth-input {
	padding: 11px 14px;
}

.lk-auth-input:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.lk-auth-input.is-invalid {
	border-color: #ef4444;
}

.lk-auth-toggle-pwd {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	color: #9ca3af;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	line-height: 1;
}
.lk-auth-toggle-pwd svg {
	width: 16px;
	height: 16px;
	display: block;
	flex: 0 0 auto;
}

.lk-auth-toggle-pwd:hover {
	color: #6366f1;
}

/* ── Password strength ───────────────────────────────────────────────────── */
.lk-pwd-strength {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
}

.lk-pwd-bar {
	flex: 1;
	height: 4px;
	background: #e5e7eb;
	border-radius: 2px;
	overflow: hidden;
}

.lk-pwd-bar-fill {
	height: 100%;
	width: 0;
	border-radius: 2px;
	transition: width .3s, background .3s;
}

.lk-pwd-label {
	font-size: 11px;
	font-weight: 600;
	min-width: 48px;
	text-align: right;
}

/* Strength levels */
.lk-pwd-bar-fill.weak   { width: 25%; background: #ef4444; }
.lk-pwd-bar-fill.fair   { width: 50%; background: #f59e0b; }
.lk-pwd-bar-fill.good   { width: 75%; background: #3b82f6; }
.lk-pwd-bar-fill.strong { width: 100%; background: #22c55e; }

.lk-pwd-label.weak   { color: #ef4444; }
.lk-pwd-label.fair   { color: #f59e0b; }
.lk-pwd-label.good   { color: #3b82f6; }
.lk-pwd-label.strong { color: #22c55e; }

/* ── Checkbox row ────────────────────────────────────────────────────────── */
.lk-auth-check-row {
	display: flex;
	align-items: center;
}

.lk-auth-check-label {
	font-size: 13px;
	color: #374151;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
}

.lk-auth-check-label a {
	color: #6366f1;
}

/* ── Role Toggle (register) ──────────────────────────────────────────────── */
.lk-auth-role-toggle {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.lk-role-option {
	cursor: pointer;
}

.lk-role-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.lk-role-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 14px 10px;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	transition: border-color .2s, background .2s;
	text-align: center;
}

.lk-role-option input:checked ~ .lk-role-card {
	border-color: #6366f1;
	background: #f5f3ff;
}

.lk-role-icon { font-size: 22px; }

.lk-role-name {
	font-size: 13px;
	font-weight: 700;
	color: #1f2937;
}

.lk-role-desc {
	font-size: 11px;
	color: #9ca3af;
}

/* ── Submit Button ───────────────────────────────────────────────────────── */
.lk-auth-btn {
	width: 100%;
	padding: 12px;
	background: #6366f1;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: background .2s, opacity .2s;
	margin-top: 4px;
}

.lk-auth-btn:hover:not(:disabled) {
	background: #4f46e5;
}

.lk-auth-btn:disabled {
	opacity: .7;
	cursor: not-allowed;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.lk-btn-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: lk-spin .7s linear infinite;
}

@keyframes lk-spin {
	to { transform: rotate(360deg); }
}

/* ── Forgot password extras ──────────────────────────────────────────────── */
.lk-auth-icon-header {
	text-align: center;
	font-size: 40px;
	margin-bottom: 8px;
}

.lk-fp-success-box {
	text-align: center;
	padding: 12px 0 8px;
}

.lk-fp-success-icon {
	font-size: 48px;
	margin-bottom: 12px;
}

.lk-fp-success-box h3 {
	font-size: 18px;
	margin: 0 0 8px;
	color: #166534;
}

.lk-fp-success-box p {
	font-size: 14px;
	color: #374151;
	margin: 0 0 8px;
}

.lk-auth-hint {
	font-size: 12px !important;
	color: #888 !important;
}

.lk-auth-back-link {
	color: #6366f1;
	text-decoration: none;
	font-size: 13px;
}

.lk-auth-back-link:hover {
	text-decoration: underline;
}

/* ── Switch link ─────────────────────────────────────────────────────────── */
.lk-auth-switch {
	text-align: center;
	font-size: 13px;
	color: #6b7280;
	margin: 20px 0 0;
}

.lk-auth-switch a {
	color: #6366f1;
	font-weight: 600;
	text-decoration: none;
}

.lk-auth-switch a:hover {
	text-decoration: underline;
}
