/* Corner lock icon — wax-seal badge */
#unlock-toggle {
	position: fixed;
	top: 20px;
	right: 30px;
	z-index: 10001;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 2px solid rgba(255,255,255,0.7);
	border-radius: 50%;
	color: #ffffff !important;
	cursor: pointer;
	padding: 0;
	opacity: 0.85;
	box-shadow: none;
	transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, border-color 0.3s ease-in-out, background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

#unlock-toggle:hover,
#unlock-toggle:focus {
	opacity: 1;
	transform: scale(1.08);
	background: rgba(255,255,255,0.12);
}

#unlock-toggle.is-unlocked {
	border-color: rgba(255,255,255,0.7);
	color: #ffffff !important;
}

#unlock-toggle.is-unlocked:hover,
#unlock-toggle.is-unlocked:focus {
	background: rgba(255,255,255,0.12);
}

.lock-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.lock-icon.lock-open {
	display: none;
}

#unlock-toggle.is-unlocked .lock-icon.lock-closed {
	display: none;
}

#unlock-toggle.is-unlocked .lock-icon.lock-open {
	display: block;
}

/* Locked content placeholders */
.locked-content {
	position: relative;
}

.locked-content .locked-inner {
	filter: blur(6px);
	user-select: none;
	pointer-events: none;
	transition: filter 0.4s ease-in-out;
}

.locked-content.unlocked .locked-inner {
	filter: none;
	pointer-events: auto;
}

.lock-hint {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: 1.1rem;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	pointer-events: auto;
	cursor: pointer;
	z-index: 2;
	padding: 1em;
}

.locked-content.unlocked .lock-hint {
	display: none;
}

/* Skeleton placeholder bars for fields that are empty until Firebase fills them in */
.locked-content .skeleton-text:empty {
	display: block;
	height: 0.85em;
	margin: 0.5em 0;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.18);
}

.locked-content .skeleton-text:empty:nth-of-type(3n+1) { width: 92%; }
.locked-content .skeleton-text:empty:nth-of-type(3n+2) { width: 78%; }
.locked-content .skeleton-text:empty:nth-of-type(3n) { width: 65%; }

h4.skeleton-text:empty { height: 1.1em; width: 45%; }
h3.skeleton-text:empty { height: 1.2em; width: 60%; }

/* Unlock overlay (ported from the original password screen) */
#unlock-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.8);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	font-family: "Inconsolata", monospace;
	transition: background 0.3s ease-in-out;
}

#unlock-overlay.open {
	display: flex;
}

#unlock-overlay.error {
	background: rgba(190, 89, 115, 0.85);
}

#unlock-overlay.success {
	background: rgba(0, 166, 115, 0.85);
}

#unlock-close {
	position: absolute;
	top: 0.9rem;
	right: 0.9rem;
	background: none;
	border: none;
	box-shadow: none;
	height: auto;
	line-height: 1;
	padding: 0;
	color: #fff;
	font-size: 28px;
	cursor: pointer;
	opacity: 0.6;
	z-index: 100002;
}

#unlock-close:hover {
	opacity: 1;
}

#unlock-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	position: relative;
	z-index: 100001;
	width: 24rem;
	max-width: calc(100% - 3rem);
	padding: 2.5rem 2rem;
	background-color: rgba(10, 10, 10, 0.95);
	border-radius: 0.375rem;
	box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
}

#unlock-overlay.error #unlock-panel,
#unlock-overlay.success #unlock-panel {
	display: none;
}

#unlock-panel #logo {
	display: block;
	margin: 0 auto 0.5em;
	width: 100px;
	height: 100px;
	object-fit: cover;
	border-radius: 50%;
	border: 2px solid white;
}

.login-tabs {
	display: flex;
	gap: 1.75em;
	margin-bottom: 0.25em;
}

.login-tab {
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	box-shadow: none;
	color: white;
	font-family: inherit;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.45;
	cursor: pointer;
	padding: 0 0 0.4em;
	transition: opacity 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.login-tab:hover,
.login-tab:focus {
	opacity: 0.8;
	box-shadow: none;
}

.login-tab.active {
	opacity: 1;
	border-bottom-color: white;
}

#unlock-panel #email-input,
#unlock-panel .password-field {
	width: 260px;
}

#unlock-panel #email-input,
#unlock-panel #password-input {
	background: transparent;
	border: none;
	border-bottom: 1px solid white;
	border-radius: 0;
	color: white;
	font-family: inherit;
	font-size: inherit;
	padding: 0.6em 0 0.4em;
	height: 2.5em;
	line-height: 1.5;
	text-align: center;
	outline: none;
	box-shadow: none;
	caret-color: white;
	box-sizing: border-box;
}

#unlock-panel #email-input:focus,
#unlock-panel #password-input:focus {
	background: transparent;
	border-bottom-color: white;
	box-shadow: none;
}

#unlock-panel #email-input::placeholder,
#unlock-panel #password-input::placeholder {
	color: white;
	opacity: 1;
	text-align: center;
}

/* Hide native browser password-reveal/credential icons — we use our own eye toggle */
#unlock-panel #password-input::-ms-reveal,
#unlock-panel #password-input::-ms-clear {
	display: none;
}

#unlock-panel #password-input::-webkit-credentials-auto-fill-button,
#unlock-panel #password-input::-webkit-contacts-auto-fill-button {
	visibility: hidden;
	display: none !important;
	pointer-events: none;
	position: absolute;
	right: 0;
}

/* Neutralize the browser's yellow/blue autofill highlight */
#unlock-panel #email-input:-webkit-autofill,
#unlock-panel #password-input:-webkit-autofill,
#unlock-panel #email-input:-webkit-autofill:hover,
#unlock-panel #password-input:-webkit-autofill:hover,
#unlock-panel #email-input:-webkit-autofill:focus,
#unlock-panel #password-input:-webkit-autofill:focus {
	-webkit-text-fill-color: #fff;
	-webkit-box-shadow: 0 0 0 1000px rgba(10, 10, 10, 0.95) inset;
	box-shadow: 0 0 0 1000px rgba(10, 10, 10, 0.95) inset;
	caret-color: #fff;
	transition: background-color 9999s ease-in-out 0s;
}

.password-field {
	position: relative;
}

.password-field #password-input {
	width: 100%;
	padding-right: 1.8em;
}

.eye-toggle {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	box-shadow: none;
	color: white;
	opacity: 0.5;
	cursor: pointer;
	padding: 0.25em;
	display: flex;
	align-items: center;
	justify-content: center;
}

.eye-toggle:hover,
.eye-toggle:focus {
	opacity: 1;
}

#unlock-submit {
	margin-top: 0.75em;
	background: transparent;
	border: 1px solid #fff;
	box-shadow: none;
	color: #fff;
	font-family: inherit;
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	padding: 0.75em 2.5em;
	cursor: pointer;
	transition: background 0.2s ease-in-out, color 0.2s ease-in-out;
}

#unlock-submit:hover,
#unlock-submit:focus {
	background: #fff;
	color: #000;
	box-shadow: none;
}

.unlock-toast {
	position: fixed;
	top: 55px;
	right: 30px;
	z-index: 10002;
	background: rgba(0, 0, 0, 0.85);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 4px;
	padding: 0.5em 1em;
	font-size: 0.8em;
	pointer-events: none;
	animation: toast-fade 2s ease forwards;
}

@keyframes toast-fade {
	0% { opacity: 0; transform: translateY(-6px); }
	15% { opacity: 1; transform: none; }
	80% { opacity: 1; }
	100% { opacity: 0; }
}

#unlock-overlay .status {
	display: none;
	color: #fff;
	text-align: center;
	font-size: 30px;
	z-index: 100001;
}

#unlock-overlay.error #unlock-error,
#unlock-overlay.success #unlock-success {
	display: block;
}

.unlock-circle {
	position: fixed;
	width: 200px;
	height: 200px;
	margin: -100px;
	background: #fff;
	border-radius: 50%;
	animation: unlock-circle 1s ease-out forwards;
	transform: scale(0.1);
	opacity: 0.6;
	z-index: 100001;
	pointer-events: none;
}

@keyframes unlock-circle {
	100% {
		transform: scale(10);
		opacity: 0;
	}
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Print only the CV article when downloading as PDF */
@media print {
	body.print-cv {
		background: #fff !important;
	}

	body.print-cv #bg,
	body.print-cv #header,
	body.print-cv #footer,
	body.print-cv #unlock-toggle,
	body.print-cv #unlock-overlay,
	body.print-cv .lock-hint,
	body.print-cv #cv-download-wrap {
		display: none !important;
	}

	body.print-cv #wrapper,
	body.print-cv #main {
		display: block !important;
		padding: 0 !important;
	}

	body.print-cv #main article {
		display: none !important;
	}

	body.print-cv #main article#cv {
		display: block !important;
		opacity: 1 !important;
		transform: none !important;
		max-width: 100% !important;
		background: #fff !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	body.print-cv #cv,
	body.print-cv #cv * {
		color: #000 !important;
	}

	body.print-cv #cv .locked-inner {
		filter: none !important;
	}

	body.print-cv #cv .collapsible-content {
		display: block !important;
	}

	body.print-cv #cv .bar {
		background: #bbb !important;
	}
}
