/* Login and other website pages (issue #3).
   "html:root" outranks the plain ":root" in Frappe's login bundle, which loads after this file. */
html:root {
	--demoq-blue: #2c6ba8;
	--demoq-blue-dark: #215283;
	--primary: var(--demoq-blue);
	--primary-color: var(--demoq-blue);
	--brand-color: var(--demoq-blue);
	--btn-primary: var(--demoq-blue);
}

/* Frappe v16 "espresso" buttons read their colours from --bt-* variables */
html:root .es-button {
	--bt-solid-bg: var(--demoq-blue);
	--bt-solid-bg-hover: var(--demoq-blue-dark);
	--bt-solid-bg-active: var(--demoq-blue-dark);
	--bt-solid-fg: #fff;
}

html:root .page-card-head img.app-logo {
	height: 56px;
	max-height: 56px;
	width: auto;
	max-width: 100%;
}

/* Microsoft-style font (see demoq_captain.css) */
html:root {
	--font-stack: "Segoe UI Variable Text", "Segoe UI", "Khmer UI", system-ui, -apple-system,
		"Noto Sans Khmer", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ------------------------------------------------------------------------------------------
   Sign-up welcome and set-password feedback (public/js/demoq_captain_web.js)
   ------------------------------------------------------------------------------------------ */
html:root {
	--demoq-yellow: #f1ba18;
	--demoq-green: #2e8b46;
	--demoq-red: #d64545;
}

/* "Welcome to DEMOQ TEAM!" */
.login-content.dq-welcome {
	box-shadow: 0 0 0 2px var(--demoq-blue), 0 12px 32px rgba(44, 107, 168, 0.18);
	transition: box-shadow 0.4s ease;
}

.login-content.dq-welcome .page-card-head h4 {
	color: var(--demoq-blue);
}

.dq-wave {
	display: inline-block;
	transform-origin: 70% 70%;
	animation: dq-wave 1.6s ease-in-out 2;
}

.dq-signup-hint {
	margin: 0;
	font-size: 13px;
	color: #b26a00;
}

.dq-signup-hint:empty {
	display: none;
}

/* Set password: the two password lines */
.password-field.dq-line-error .form-control {
	border-color: var(--demoq-red) !important;
	box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.18) !important;
}

.password-field.dq-line-ok .form-control {
	border-color: var(--demoq-green) !important;
	box-shadow: 0 0 0 3px rgba(46, 139, 70, 0.16) !important;
}

#reset-password .password-mismatch-message.text-danger {
	padding: 6px 10px;
	border-left: 3px solid var(--demoq-red);
	border-radius: 6px;
	background: #fdecec;
	color: #a52a2a !important;
	font-weight: 600;
}

.dq-password-match {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--demoq-green);
}

.dq-password-match:empty {
	display: none;
}

/* Message that slides in at the top */
.dq-toast {
	position: fixed;
	top: 20px;
	left: 50%;
	z-index: 1100;
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: min(92vw, 420px);
	padding: 14px 18px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
	font-size: 14px;
	transform: translateX(-50%);
	animation: dq-toast-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.dq-toast strong {
	font-size: 16px;
}

.dq-toast-success {
	border-left: 5px solid var(--demoq-green);
}

.dq-toast-out {
	opacity: 0;
	transition: opacity 0.4s ease;
}

/* Confetti */
.dq-confetti {
	position: fixed;
	inset: 0;
	z-index: 1090;
	overflow: hidden;
	pointer-events: none;
}

.dq-confetti i {
	position: absolute;
	top: -12px;
	width: 8px;
	height: 14px;
	border-radius: 2px;
	animation: dq-fall 2.2s ease-in forwards;
}

/* Animations */
.dq-pop {
	animation: dq-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.dq-shake {
	animation: dq-shake 0.5s ease-in-out;
}

@keyframes dq-pop {
	0% {
		opacity: 0.4;
		transform: scale(0.85);
	}
	60% {
		opacity: 1;
		transform: scale(1.06);
	}
	100% {
		transform: scale(1);
	}
}

@keyframes dq-shake {
	0%,
	100% {
		transform: translateX(0);
	}
	20%,
	60% {
		transform: translateX(-8px);
	}
	40%,
	80% {
		transform: translateX(8px);
	}
}

@keyframes dq-wave {
	0%,
	60%,
	100% {
		transform: rotate(0deg);
	}
	10%,
	30% {
		transform: rotate(16deg);
	}
	20%,
	40% {
		transform: rotate(-10deg);
	}
}

@keyframes dq-toast-in {
	from {
		opacity: 0;
		transform: translate(-50%, -24px);
	}
	to {
		opacity: 1;
		transform: translate(-50%, 0);
	}
}

@keyframes dq-fall {
	to {
		transform: translate(var(--dq-drift, 0), 105vh) rotate(var(--dq-spin, 360deg));
		opacity: 0.7;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dq-pop,
	.dq-shake,
	.dq-wave,
	.dq-toast {
		animation: none;
	}
}

/* ===== Phones (Android and iOS) =====
   iPhone Safari zooms the whole page in when you tap a box whose text is smaller than 16px,
   and it stays zoomed in after you type (the sign-in page was cut off at the sides).
   16px text in the boxes on touch screens stops that. Android shows the same bigger text. */
@media (pointer: coarse) {
	/* "body .page-card .page-card-body" outranks the sign-in page's own input rule */
	html:root input.form-control,
	html:root select.form-control,
	html:root textarea.form-control,
	html:root body .page-card .page-card-body input.form-control,
	html:root body .page-card .page-card-body input {
		font-size: 16px;
	}
	html:root body .page-card .btn,
	html:root body .page-card .es-button {
		min-height: 44px;
		touch-action: manipulation;
	}
}

/* Two-factor setup on the sign-in screen (public/js/demoq_captain_web.js) */
.dq-2fa-setup {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
	color: var(--text-color, #1f272e);
}
.dq-2fa-setup ol {
	margin: 0;
	padding-left: 20px;
	font-size: 14px;
}
.dq-2fa-setup img {
	width: 200px;
	max-width: 100%;
	align-self: center;
	border-radius: 8px;
}
.dq-2fa-key {
	margin: 0;
	font-size: 13px;
	color: var(--text-muted, #6c7680);
	word-break: break-word;

/* Forgot Password: next steps after the email is sent (public/js/demoq_captain_web.js) */
.form-forgot.dq-forgot-done {
	display: none !important;
}
.dq-forgot-next {
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 15px;
	line-height: 1.5;
}
.dq-forgot-next h4 {
	margin: 0;
	color: var(--demoq-blue-dark);
}
.dq-forgot-next p,
.dq-forgot-next ol {
	margin: 0;
}
.dq-forgot-next ol {
	padding-left: 20px;
}
.dq-forgot-icon {
	font-size: 40px;
	line-height: 1;
}
.dq-forgot-small {
	font-size: 13px;
	color: #6c7680;
}
.dq-forgot-help {
	padding: 10px 12px;
	border-radius: 8px;
	background: #f3f6fa;
	font-size: 14px;
}
.dq-forgot-help a {
	color: var(--demoq-blue);
}
.for-forgot.dq-forgot-sent .page-card-head p {
	display: none;
}
