/*
 * Yivahalo Login Modal
 *
 * Scoped entirely under .yv-lm-* so nothing here can leak into the theme. The
 * palette is the store palette: terracotta #a85015 on the primary action, dark
 * brown #28201b for text, cream #faf7f2 for the page behind the dialog.
 */

.yv-lm-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding: 24px 16px;
	overflow-y: auto;
	background: rgba(40, 32, 27, 0.55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.yv-lm-overlay.is-open {
	display: flex;
}

body.yv-lm-locked {
	overflow: hidden;
}

.yv-lm-dialog {
	position: relative;
	width: 100%;
	max-width: 440px;
	margin: auto;
	padding: 32px 28px 22px;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 18px 50px rgba(40, 32, 27, 0.28);
	font-size: 15px;
	line-height: 1.5;
	color: #28201b;
	animation: yv-lm-in 0.18s ease-out;
}

@keyframes yv-lm-in {
	from { opacity: 0; transform: translateY(-8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.yv-lm-dialog { animation: none; }
}

.yv-lm-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #6b625c;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
}

.yv-lm-close:hover,
.yv-lm-close:focus-visible {
	color: #28201b;
	background: #f3efe9;
	outline: none;
}

.yv-lm-title {
	margin: 0 0 22px;
	text-align: center;
	font-size: 24px;
	font-weight: 600;
	letter-spacing: -0.2px;
	color: #28201b;
}

/* --- Trust row --- */

.yv-lm-trust {
	display: flex;
	justify-content: center;
	gap: 40px;
	margin-bottom: 24px;
}

.yv-lm-trust-item {
	flex: 0 0 auto;
	text-align: center;
}

.yv-lm-trust-icon {
	display: block;
	margin-bottom: 6px;
	color: #28201b;
}

.yv-lm-trust-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}

.yv-lm-trust-sub {
	margin: 1px 0 0;
	font-size: 13px;
	color: #6b625c;
}

/* --- Form --- */

.yv-lm-label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #28201b;
}

.yv-lm-input {
	display: block;
	width: 100%;
	height: 48px;
	padding: 0 14px;
	margin-bottom: 14px;
	border: 1px solid #d8d0c8;
	border-radius: 3px;
	background: #fff;
	font-size: 15px;
	color: #28201b;
	box-sizing: border-box;
}

.yv-lm-input:focus {
	border-color: #a85015;
	box-shadow: 0 0 0 2px rgba(168, 80, 21, 0.14);
	outline: none;
}

.yv-lm-input[aria-invalid="true"] {
	border-color: #b3261e;
}

.yv-lm-btn {
	display: block;
	width: 100%;
	height: 48px;
	padding: 0 16px;
	border: 1px solid transparent;
	border-radius: 3px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.yv-lm-btn--primary {
	background: #a85015;
	color: #fff;
}

.yv-lm-btn--primary:hover,
.yv-lm-btn--primary:focus-visible {
	background: #8f4311;
	outline: none;
}

.yv-lm-btn[disabled] {
	opacity: 0.6;
	cursor: default;
}

.yv-lm-greeting {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
}

.yv-lm-email-shown {
	margin: 2px 0 16px;
	font-size: 14px;
	color: #6b625c;
	word-break: break-all;
}

.yv-lm-hint {
	margin: -8px 0 14px;
	font-size: 13px;
	color: #6b625c;
}

.yv-lm-links {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
}

.yv-lm-link {
	padding: 0;
	border: 0;
	background: none;
	color: #a85015;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}

.yv-lm-link:hover {
	color: #8f4311;
}

.yv-lm-error {
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: 3px;
	background: #fdf0ee;
	color: #b3261e;
	font-size: 14px;
}

/* --- Divider --- */

.yv-lm-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 22px 0 16px;
	color: #6b625c;
	font-size: 14px;
}

.yv-lm-divider::before,
.yv-lm-divider::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: #e4ddd5;
}

.yv-lm-divider span {
	flex: 0 0 auto;
}

/* --- Social buttons (rendered by miniOrange) --- */

.yv-lm-social {
	margin-bottom: 18px;
}

/* miniOrange prints its own wrapper with an inline-styled "Connect with" label
   and fixed-width buttons; neutralise that so the dialog stays on-brand. */
.yv-lm-social .mo-openid-app-icons {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	margin: 0;
}

.yv-lm-social .mo-openid-app-icons > p {
	display: none !important;
}

.yv-lm-social .mo-openid-app-icons > a,
.yv-lm-social .mo_btn {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	height: 48px !important;
	margin: 0 !important;
	padding: 0 16px !important;
	border: 1px solid #d8d0c8 !important;
	border-radius: 3px !important;
	background: #fff !important;
	color: #28201b !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	box-sizing: border-box;
	cursor: pointer;
}

.yv-lm-social .mo-openid-app-icons > a:hover,
.yv-lm-social .mo_btn:hover {
	background: #faf7f2 !important;
	border-color: #bfb5aa !important;
}

.yv-lm-social img {
	max-height: 20px;
	width: auto;
	margin-right: 10px;
}

/* --- Terms --- */

.yv-lm-terms {
	margin: 0;
	text-align: center;
	font-size: 12.5px;
	color: #6b625c;
}

.yv-lm-terms a {
	color: #28201b;
	text-decoration: underline;
}

/* --- Small screens --- */

@media (max-width: 520px) {
	.yv-lm-overlay {
		padding: 0;
		align-items: flex-start;
	}

	.yv-lm-dialog {
		max-width: none;
		min-height: 100%;
		margin: 0;
		border-radius: 0;
		padding: 24px 18px 20px;
	}

	.yv-lm-trust {
		gap: 24px;
	}

	.yv-lm-title {
		font-size: 21px;
	}
}
