/*
 * Ühtne sisselogimise plokk (Auth::loginBlock) — avalik veeb, /kaart/, /admin/.
 * Kujundus: audit_reports/designs/login-eeid/ (näidised 1–8).
 * Ümbris (modaal, kaardi paneel, admini kaart) jääb lehe enda teha.
 */
.mo-auth {
	--mo-auth-green: #588f36;
	--mo-auth-muted: #5f5f5f;
	--mo-auth-border: #d7d7d7;
	--mo-auth-error: #da2e21;
	--mo-auth-warn-bg: #fff6e5;
	--mo-auth-warn: #9a5b00;
	display: flex;
	flex-direction: column;
	gap: 16px;
	font-family: "Exo 2", sans-serif;
	text-align: left;
}

.mo-auth .mo-auth-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
}

.mo-auth .mo-auth-lead {
	margin: -8px 0 0;
	color: var(--mo-auth-muted);
	font-size: 14px;
	text-align: center;
}

.mo-auth-eeid {
	min-height: 0;
}

/* Kaardi paneel: eeID vorm alles selle nupu vajutamisel (data-start="click"). */
.mo-auth-start {
	display: block;
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--mo-auth-green);
	border-radius: 6px;
	background: #fff;
	color: var(--mo-auth-green);
	font: 600 15px "Exo 2", sans-serif;
	cursor: pointer;
}

.mo-auth-start:hover,
.mo-auth-start:focus-visible {
	background: var(--mo-auth-green);
	color: #fff;
}

.mo-auth-eeid eeid-widget {
	display: block;
	width: 100%;
}

/* eeID meetod vajab täisekraani (eeid:expand). */
.mo-auth.mo-auth-expanded .mo-auth-eeid {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	background: #fff;
}

.mo-auth-status {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 150px;
	padding: 16px;
	border: 1px solid var(--mo-auth-border);
	border-radius: 6px;
	background: #fff;
	font-size: 14px;
	text-align: center;
}

.mo-auth-status[hidden] {
	display: none;
}

.mo-auth-status p {
	margin: 0;
}

.mo-auth-entering p {
	color: #54881B;
	font-weight: 600;
}

.mo-auth-error p {
	color: var(--mo-auth-error);
	font-weight: 600;
}

.mo-auth-spin {
	width: 30px;
	height: 30px;
	border: 3px solid #dfe9d7;
	border-top-color: var(--mo-auth-green);
	border-radius: 50%;
	animation: mo-auth-spin .9s linear infinite;
}

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

.mo-auth-retry {
	padding: 7px 18px;
	border: 1px solid var(--mo-auth-green);
	border-radius: 3px;
	background: #fff;
	color: var(--mo-auth-green);
	font: 600 13px "Exo 2", sans-serif;
	cursor: pointer;
}

.mo-auth-or {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--mo-auth-muted);
	font-size: 14px;
}

.mo-auth-or::before,
.mo-auth-or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--mo-auth-border);
}

/* Pangad alati keskel; ühe laius nagu 4 veerus, nii et 3 panka ei jää vasakule. */
.mo-auth-banks {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.mo-auth-banks a {
	display: block;
	flex: 0 1 calc((100% - 24px) / 4);
	line-height: 0;
}

.mo-auth-banks img {
	width: 100%;
	height: auto;
	border-radius: 4px;
}

/*
 * Registreerimislehe tuvastusplokk (pages/registreeru.php), näidis designs/registreeru
 * variant B „Ribad”: lehe sees (mitte kaardina), pealkiri saidi h3 stiilis.
 */
.mo-auth-signup {
	--mo-auth-green: #588f36;
	--mo-auth-muted: #5f5f5f;
	--mo-auth-border: #d7d7d7;
	--mo-auth-warn-bg: #fff6e5;
	--mo-auth-warn: #9a5b00;
	margin: 28px 0 40px;
	font-family: "Exo 2", sans-serif;
}

.mo-auth-signup h3 {
	margin: 0 0 4px;
}

.mo-auth-signup .mo-auth-signup-lead {
	margin: 0;
	color: var(--mo-auth-muted);
	font-size: 15px;
}

.mo-auth-signup .mo-auth-signup-hint {
	display: inline-block;
	margin: 14px 0 0;
	padding: 8px 12px;
	border-radius: 6px;
	background: var(--mo-auth-warn-bg);
	color: var(--mo-auth-warn);
	font-size: 14px;
	line-height: 1.4;
}

.mo-auth-signup .mo-auth-signup-hint[hidden] {
	display: none;
}

.mo-auth-signup .mo-auth-signup-hint::before {
	content: "↑ ";
	font-weight: 700;
}

.mo-auth-signup-panel {
	max-width: 900px;
	margin-top: 18px;
	border: 1px solid var(--mo-auth-border);
	border-radius: 8px;
}

.mo-auth-signup-row {
	display: grid;
	grid-template-columns: 280px 1fr;
	align-items: center;
	gap: 20px;
	padding: 18px 22px;
}

.mo-auth-signup-row + .mo-auth-signup-row {
	border-top: 1px solid var(--mo-auth-border);
}

.mo-auth-signup-row h4 {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
}

.mo-auth-signup-row p {
	margin: 2px 0 0;
	color: var(--mo-auth-muted);
	font-size: 13px;
	line-height: 1.4;
}

/* a.…: saidi `.content-wrapper a:not(.button)` joonib muidu alla (sama kaal, auth.css on hiljem). */
.mo-auth-signup a.mo-auth-signup-eeid {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 46px;
	padding: 0 22px;
	border-radius: 6px;
	background: var(--mo-auth-green);
	color: #fff;
	font: 600 15px "Exo 2", sans-serif;
	text-decoration: none;
}

/* Saidi `.grid-x span { align-self: flex-start }` tõstaks noole üles. */
.mo-auth-signup a.mo-auth-signup-eeid span {
	align-self: center;
}

.mo-auth-signup a.mo-auth-signup-eeid:hover,
.mo-auth-signup a.mo-auth-signup-eeid:focus-visible {
	background: #4a7a2d;
	color: #fff;
}

.mo-auth-signup-banks {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* Nagu sisselogimise aknas (.mo-auth-banks): ilma hover-efektita. */
.mo-auth-signup-banks a {
	display: block;
	width: 124px;
	line-height: 0;
}

.mo-auth-signup-banks img {
	width: 100%;
	height: auto;
	border-radius: 4px;
}

/* Kuni nõusoleku linnukesed puuduvad (registreeru.js). */
.mo-auth-signup-locked .mo-auth-signup-eeid,
.mo-auth-signup-locked .mo-auth-signup-banks {
	opacity: .4;
	filter: grayscale(.6);
	pointer-events: none;
}

.mo-auth-reg {
	padding-top: 14px;
	border-top: 1px solid var(--mo-auth-border);
	color: var(--mo-auth-muted);
	font-size: 14px;
	text-align: center;
}

.mo-auth-reg .mo-auth-reg-btn {
	display: inline-block;
	margin-left: 6px;
	padding: 9px 26px;
	border-radius: 3px;
	background: var(--mo-auth-green);
	color: #fff;
	font-weight: 600;
	letter-spacing: .3px;
	text-decoration: none;
}

.mo-auth-note {
	padding: 8px 12px;
	border-radius: 4px;
	background: var(--mo-auth-warn-bg);
	color: var(--mo-auth-warn);
	font-size: 13px;
}

/* Kaardi konto paneel (näidised 3–4). Paneel kerib #map-layers sees nagu varem. */
.account-inner .popup.mo-auth-kaart {
	padding: 20px 20px 22px;
}

/* Kitsas paneel: registreerimise nupp oma real, lõpuosa keskel. */
.mo-auth-kaart .mo-auth-reg .mo-auth-reg-btn {
	display: block;
	width: max-content;
	margin: 10px auto 0;
}

.mo-auth-kaart .mo-auth-kaart-more {
	margin-top: 14px;
	color: #5f5f5f;
	font-size: 13px;
	text-align: center;
}

.mo-auth-kaart .mo-auth-kaart-more a {
	color: #588f36;
}

/* Kaardi aegunud sessiooni modaal (näidis 5). */
.mo-auth-expired {
	position: fixed;
	inset: 0;
	z-index: 2147482000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, .45);
	overflow-y: auto;
}

.mo-auth-expired[hidden] {
	display: none;
}

.mo-auth-expired-card {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: 100%;
	padding: 22px 24px;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
	overflow-y: auto;
}

.mo-auth-expired-card .mo-auth .mo-auth-title {
	font-size: 19px;
	text-align: left;
}

/* Admini sisselogimise leht (näidised 6–7). */
.mo-auth-admin-page {
	margin: 0;
	min-height: 100vh;
	background: #ececec;
	font-family: "Exo 2", sans-serif;
	color: #0a0a0a;
}

.mo-auth-admin-card {
	box-sizing: border-box;
	width: 100%;
	max-width: 460px;
	margin: 80px auto 40px;
	padding: 28px 32px;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 6px 30px rgba(0, 0, 0, .12);
}

.mo-auth-admin-logo {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 22px;
}

.mo-auth-admin-logo img {
	height: 34px;
	width: auto;
}

.mo-auth-admin-pill {
	padding: 3px 9px;
	border-radius: 10px;
	background: #333;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
}

.mo-auth-admin-card .mo-auth .mo-auth-title {
	font-size: 20px;
}

.mo-auth-admin-foot {
	margin: 18px 0 0;
	color: #888;
	font-size: 12px;
	text-align: center;
}

/* Tagasitulek raamist väljast / vea teade lehel, kus plokk on peidus. */
.mo-auth-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147482000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 90px 16px 16px;
	background: rgba(0, 0, 0, .45);
	overflow-y: auto;
}

.mo-auth-overlay-card {
	position: relative;
	width: 100%;
	max-width: 480px;
	padding: 28px 24px 24px;
	border-radius: 4px;
	background: #f6f6f6;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

.mo-auth-close {
	position: absolute;
	top: 8px;
	right: 12px;
	border: 0;
	background: none;
	color: #888;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

@media (max-width: 640px) {
	/* Saidi .popup on mobiilis max-height: 80% — sisselogimine on täisekraanil (näidis 2). */
	#login-modal .popup.mo-auth-popup {
		max-height: none;
		height: 100%;
		padding: 24px 16px;
	}

	/* Mobiilis 3 panka ühte ritta. */
	.mo-auth-banks a {
		flex-basis: calc((100% - 16px) / 3);
	}

	.mo-auth-reg .mo-auth-reg-btn {
		display: block;
		width: max-content;
		margin: 10px auto 0;
	}

	.mo-auth-signup {
		margin-bottom: 28px;
	}

	.mo-auth-signup-row {
		grid-template-columns: 1fr;
		gap: 10px;
		padding: 16px 14px;
	}

	.mo-auth-signup a.mo-auth-signup-eeid {
		display: flex;
		justify-content: center;
	}

	.mo-auth-signup-banks a {
		width: calc((100% - 20px) / 3);
	}

	.mo-auth-overlay,
	.mo-auth-expired {
		padding: 0;
	}

	.mo-auth-admin-card {
		min-height: 100vh;
		margin: 0;
		padding: 22px 16px;
		border-radius: 0;
		box-shadow: none;
	}

	.mo-auth-expired-card {
		min-height: 100%;
		max-width: none;
		border-radius: 0;
	}

	.mo-auth-overlay-card {
		min-height: 100%;
		max-width: none;
		border-radius: 0;
	}
}
