/**
 * File: assets/css/minimal-lock-front.css
 *
 * Styles for the front-end lock screen (Minimal Lock).
 * - Clean centered layout
 * - Accessible focus states
 * - Better error visibility
 * - Motion-reduced friendly animations
 * - Optional dark-mode tweaks
 *
 * @package   Minimal_Lock
 */

/* --- A11y helpers --- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	-webkit-clip-path: inset(50%);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	white-space: nowrap;
}

/* --- Global reset / base --- */
html {
	box-sizing: border-box;
}
*,
*::before,
*::after {
	box-sizing: inherit;
}

.minimal-lock-body {
	margin: 0;
	padding: 0;
	background-color: #f9f9f9;
	color: #444;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.5;
}

/* --- Layout --- */
.minimal-lock-container {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 20px;
}

.minimal-lock-form-wrapper {
	width: 100%;
	max-width: 380px;
	text-align: center;
}

/* --- Elements --- */
.minimal-lock-logo {
	max-width: 80%;
	height: auto;
	margin: 0 auto 24px auto;
	display: block;
}

.minimal-lock-message {
	font-size: 16px;
	line-height: 1.6;
	color: #555;
	margin-bottom: 20px;
}

.minimal-lock-password-field {
	width: 100%;
	font-size: 18px;
	padding: 14px 16px;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	text-align: center;
	box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
	transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.minimal-lock-password-field:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34,113,177,.15);
	background-color: #fff;
}

.minimal-lock-password-field.error-border {
	border-color: #d63638;
}

/* Remember row */
.minimal-lock-remember-row {
	margin-top: 14px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
}

.minimal-lock-remember-row input[type="checkbox"] {
	width: 16px;
	height: 16px;
	cursor: pointer;
}

.minimal-lock-remember-row label {
	font-size: 14px;
	color: #555;
	cursor: pointer;
}

/* Submit button (shown only if enabled in settings) */
.minimal-lock-submit-button {
	width: 100%;
	margin-top: 18px;
	padding: 12px 20px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid #2271b1;
	background-color: #2271b1;
	color: #fff;
	border-radius: 6px;
	transition: transform .06s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.minimal-lock-submit-button:hover,
.minimal-lock-submit-button:focus {
	background-color: #1e639a;
	border-color: #1e639a;
	box-shadow: 0 0 0 3px rgba(34,113,177,.15);
	outline: none;
}

.minimal-lock-submit-button:active {
	transform: translateY(1px);
}

/* Error message */
.minimal-lock-error {
	margin-top: 14px;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 14px;
	background-color: #fef3f3;
	border: 1px solid #d63638;
	color: #9d1f1f;
	text-align: left;
}

/* Shake animation for wrong password */
@keyframes ml-shake {
	0%, 100% { transform: translateX(0); }
	10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
	20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.shake {
	animation: ml-shake .6s;
}

/* Motion-reduced preference */
@media (prefers-reduced-motion: reduce) {
	.shake { animation: none; }
	.minimal-lock-submit-button { transition: none; }
	.minimal-lock-password-field { transition: none; }
}

/* Dark mode tweaks */
@media (prefers-color-scheme: dark) {
	.minimal-lock-body {
		background-color: #111315;
		color: #e6e6e6;
	}
	.minimal-lock-message { color: #c7c7c7; }
	.minimal-lock-password-field {
		background-color: #1a1d20;
		color: #e6e6e6;
		border-color: #3a3f46;
		box-shadow: none;
	}
	.minimal-lock-password-field:focus {
		border-color: #3b8bd9;
		box-shadow: 0 0 0 3px rgba(59,139,217,.25);
		background-color: #1d2023;
	}
	.minimal-lock-remember-row label { color: #d0d0d0; }
	.minimal-lock-submit-button {
		background-color: #3b8bd9;
		border-color: #3b8bd9;
	}
	.minimal-lock-submit-button:hover,
	.minimal-lock-submit-button:focus {
		background-color: #2e74b7;
		border-color: #2e74b7;
	}
	.minimal-lock-error {
		background-color: rgba(214,54,56,.1);
		border-color: #d64648;
		color: #ffb3b6;
	}
}