/* On Duty — loading overlay, form entrance, images, buttons */

/* ── Screen loader ───────────────────────────────────────────── */

.screen-loader {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	background: rgba(10, 12, 18, 0.55);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity 0.28s ease;
}

body.page-id-1060 .screen-loader,
body.page-id-115 .screen-loader {
	top: var(--od-header-height, 88px);
	height: calc(100% - var(--od-header-height, 88px));
	z-index: 500;
}

.screen-loader.is-visible {
	opacity: 1;
}

html.onduty-theme-light .screen-loader {
	background: rgba(238, 241, 246, 0.72);
}

.screen-loader__panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	padding: 28px 36px;
	border-radius: 12px;
	background: rgba(20, 22, 30, 0.92);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
	animation: odLoaderPanelIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

html.onduty-theme-light .screen-loader__panel {
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.screen-loader__text {
	margin: 0;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: #fafbfc;
}

html.onduty-theme-light .screen-loader__text {
	color: #1a1d24;
}

.loader-ring {
	width: 52px;
	height: 52px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: #007aff;
	border-radius: 50%;
	animation: screenLoaderSpin 0.75s linear infinite;
}

html.onduty-theme-light .loader-ring {
	border-color: rgba(0, 122, 255, 0.15);
	border-top-color: #007aff;
}

body.onduty-loading {
	overflow: hidden;
}

/* ── Auth page entrance (login / register standalone) ───────── */

/* Always visible — do not hide until JS runs (was causing blank login/register pages) */
.onduty-login-standalone,
.onduty-register-standalone,
.onduty-hr-standalone {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: no-preference) {
	.onduty-login-standalone.onduty-animate-in,
	.onduty-hr-standalone.onduty-animate-in {
		animation: odAuthPageIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.onduty-hr-standalone.onduty-animate-in .onduty-hr-dashboard {
		animation: odTitleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.onduty-animate-in .wizard-auth-title,
	.onduty-animate-in .wizard-register-title {
		animation: odTitleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
	}

	.onduty-animate-in .wizard-auth-subtitle,
	.onduty-animate-in .wizard-register-subtitle {
		animation: odTitleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
	}

	.onduty-animate-in .login-from-wrapper,
	.onduty-animate-in .register-from-wrapper {
		animation: odTitleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.onduty-animate-in .from-field-wrapper {
		animation: odFieldIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
	}

	.onduty-animate-in .from-field-wrapper:nth-child(1) { animation-delay: 0.08s; }
	.onduty-animate-in .from-field-wrapper:nth-child(2) { animation-delay: 0.12s; }
	.onduty-animate-in .from-field-wrapper:nth-child(3) { animation-delay: 0.16s; }
	.onduty-animate-in .from-field-wrapper:nth-child(4) { animation-delay: 0.2s; }
	.onduty-animate-in .from-field-wrapper:nth-child(5) { animation-delay: 0.24s; }
	.onduty-animate-in .from-field-wrapper:nth-child(6) { animation-delay: 0.28s; }
	.onduty-animate-in .from-field-wrapper:nth-child(7) { animation-delay: 0.32s; }

	.onduty-animate-in .field-btn-wrapper.wizard-btn-wrapper {
		animation: odFieldIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.36s both;
	}

	.onduty-animate-in p.account-wrapper {
		animation: odFieldIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both;
	}
}

/* Wizard step 6 auth panels (hidden until shown; standalone login/register always visible) */
.onduty-auth-panel {
	opacity: 0;
	transform: translateY(12px);
}

.onduty-login-standalone .onduty-auth-panel,
.onduty-register-standalone .onduty-auth-panel,
.onduty-auth-panel.onduty-auth-panel--visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: no-preference) {
	.wizard-step-6 .onduty-auth-panel.onduty-auth-panel--visible {
		animation: odAuthPageIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
	}
}

/* ── Form inputs focus ───────────────────────────────────────── */

.from-field-wrapper input:focus,
.from-field-wrapper input:focus-visible {
	outline: none;
	border-color: #007aff !important;
	box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.22);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.from-field-wrapper input {
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* ── Submit buttons loading state ────────────────────────────── */

button.login-btn.is-loading,
button.register-btn.is-loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
	min-width: 160px;
}

button.login-btn.is-loading::after,
button.register-btn.is-loading::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 22px;
	height: 22px;
	margin: -11px 0 0 -11px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: screenLoaderSpin 0.65s linear infinite;
}

/* ── Success / error messages ────────────────────────────────── */

.wizard-message.login-message,
.wizard-message.register-message {
	animation: odMessageIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Wizard step backgrounds (fade in when step becomes active) ─ */

.wizard-step.wizard-step-3,
.wizard-step.wizard-step-4,
.wizard-step.wizard-step-5 {
	background-color: transparent;
}

.wizard-step.wizard-step-3.active,
.wizard-step.wizard-step-4.active,
.wizard-step.wizard-step-5.active {
	animation: odStepBgIn 0.55s ease 0.1s both;
}

/* ── Wizard images ───────────────────────────────────────────── */

.wizard-step.active img.onduty-img-reveal,
.wizard-step.active .vehicle-card label img,
.wizard-step-1 img {
	animation: odImageIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.vehicle-card label {
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.vehicle-card label:hover {
	transform: translateY(-2px);
}

.vehicle-card input[type="radio"]:checked + label {
	animation: odCardPulse 0.4s ease;
}

/* Only one wizard step in layout (prevents double height / double backgrounds) */
#onduty-wizard > .wizard-step:not(.active) {
	display: none !important;
}

#onduty-wizard > .wizard-step.active {
	display: block !important;
}

.wizard-step.exit-left,
.wizard-step.exit-right {
	display: none !important;
}

/* ── Login ↔ Register toggle (wizard step 6) ─────────────────── */

.login-wrapper.onduty-panel-exit,
.register-wrapper.onduty-panel-exit {
	animation: odPanelOut 0.22s ease forwards;
}

.login-wrapper.onduty-panel-enter,
.register-wrapper.onduty-panel-enter {
	animation: odPanelIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Keyframes ───────────────────────────────────────────────── */

@keyframes screenLoaderSpin {
	to { transform: rotate(360deg); }
}

@keyframes odLoaderPanelIn {
	from {
		opacity: 0;
		transform: scale(0.92) translateY(8px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

@keyframes odAuthPageIn {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes odTitleIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes odFieldIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes odImageIn {
	from {
		opacity: 0;
		transform: scale(0.97);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes odStepBgIn {
	from {
		opacity: 0.4;
	}
	to {
		opacity: 1;
	}
}

@keyframes odMessageIn {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes odPanelOut {
	to {
		opacity: 0;
		transform: translateY(-8px);
	}
}

@keyframes odPanelIn {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes odCardPulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.02); }
	100% { transform: scale(1); }
}

/* ── Reduced motion ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.screen-loader,
	.screen-loader__panel,
	.loader-ring,
	.onduty-login-standalone,
	.onduty-register-standalone,
	.onduty-animate-in .from-field-wrapper,
	.onduty-animate-in .field-btn-wrapper,
	.onduty-animate-in p.account-wrapper,
	.wizard-step.active img,
	.wizard-message,
	.login-wrapper,
	.register-wrapper,
	.wizard-step.wizard-step-3.active,
	.wizard-step.wizard-step-4.active,
	.wizard-step.wizard-step-5.active,
	.wizard-truck-bg,
	.wizard-truck {
		animation: none !important;
		transition: none !important;
		opacity: 1 !important;
		transform: none !important;
	}

	.wizard-truck-bg.is-visible {
		opacity: 1 !important;
		visibility: visible !important;
	}

	.screen-loader.is-visible {
		opacity: 1;
	}
}

/* ── Email verification pending panel ─────────────────────────── */

.onduty-verify-pending {
	text-align: center;
	padding: 8px 4px 16px;
}

.onduty-verify-pending__icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: rgba(6, 106, 171, 0.12);
	color: #066aab;
	font-size: 34px;
	line-height: 72px;
}

.onduty-verify-pending__title {
	margin: 0 0 12px;
	font-size: 22px;
	font-weight: 700;
	color: #111827;
}

.onduty-verify-pending__intro,
.onduty-verify-pending__hint {
	margin: 0 0 14px;
	font-size: 15px;
	line-height: 1.6;
	color: #374151;
}

.onduty-verify-pending__actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: stretch;
	width: 100%;
	max-width: 320px;
	margin: 16px auto 0;
}

.onduty-verify-otp-btn,
.onduty-verify-resend-btn,
.onduty-send-login-otp-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 50px;
	padding: 14px 20px;
	border-radius: 35px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: normal;
	text-align: center;
	cursor: pointer;
	box-shadow: none;
	transform: none;
	margin: 0;
	transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.onduty-verify-otp-btn {
	background: #007aff;
	color: #fff;
	border: none;
}

.onduty-verify-otp-btn:hover:not(:disabled) {
	background: #0066d6;
	transform: translateY(-1px);
}

.onduty-verify-resend-btn,
.onduty-send-login-otp-btn {
	background: #fff;
	color: #066aab;
	border: 2px solid #066aab;
}

.onduty-verify-resend-btn:hover:not(:disabled),
.onduty-send-login-otp-btn:hover:not(:disabled) {
	background: #f0f7ff;
	transform: none;
}

.onduty-verify-resend-btn.is-cooldown,
.onduty-verify-resend-btn:disabled,
.onduty-send-login-otp-btn.is-cooldown,
.onduty-send-login-otp-btn:disabled {
	background: #eef2f7;
	color: #64748b;
	border-color: #cbd5e1;
	opacity: 1;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.onduty-verify-resend-btn:active,
.onduty-verify-otp-btn:active,
.onduty-send-login-otp-btn:active {
	transform: none;
	box-shadow: none;
}

.onduty-btn-label {
	display: block;
	width: 100%;
}

.onduty-verify-resend-btn {
	width: 100%;
	min-width: 0;
}

.onduty-verify-login-link {
	font-size: 14px;
	font-weight: 600;
	color: #066aab;
	text-decoration: none;
}

html.onduty-theme-dark .onduty-verify-pending__title {
	color: #f3f4f6;
}

html.onduty-theme-dark .onduty-verify-pending__intro,
html.onduty-theme-dark .onduty-verify-pending__hint {
	color: #d1d5db;
}

.onduty-verify-otp-block {
	max-width: 320px;
	margin: 20px auto 0;
	text-align: left;
}

.onduty-verify-otp-block label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #111827;
}

.onduty-otp-input {
	width: 100%;
	padding: 14px 16px;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: 8px;
	text-align: center;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	color: #111827;
}

.onduty-verify-otp-btn {
	width: 100%;
	margin-top: 12px;
}

.onduty-login-mode-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 18px;
}

.onduty-login-mode {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: transparent;
	color: #374151;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.onduty-login-mode.is-active {
	background: #066aab;
	border-color: #066aab;
	color: #fff;
}

.onduty-send-login-otp-btn {
	width: 100%;
}

html.onduty-theme-dark .onduty-verify-otp-btn {
	color: #fff;
}

html.onduty-theme-dark .onduty-verify-resend-btn,
html.onduty-theme-dark .onduty-send-login-otp-btn {
	background: #1f2937;
	color: #93c5fd;
	border-color: #3b82f6;
}

html.onduty-theme-dark .onduty-verify-resend-btn.is-cooldown,
html.onduty-theme-dark .onduty-verify-resend-btn:disabled,
html.onduty-theme-dark .onduty-send-login-otp-btn.is-cooldown,
html.onduty-theme-dark .onduty-send-login-otp-btn:disabled {
	background: #111827;
	color: #94a3b8;
	border-color: #374151;
}

html.onduty-theme-dark .onduty-verify-otp-block label,
html.onduty-theme-dark .onduty-otp-input {
	color: #f3f4f6;
}

html.onduty-theme-dark .onduty-otp-input {
	background: #1f2937;
	border-color: #4b5563;
}

html.onduty-theme-dark .onduty-login-mode {
	color: #d1d5db;
	border-color: #4b5563;
}
