/* TM Login Modal. Colours come from CSS variables set on #tm-lm-modal (settings page). */

#tm-lm-modal {
	--tm-lm-divider: color-mix(in srgb, var(--tm-lm-body-text) 35%, transparent);
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding: 12vh 16px 24px;
	overflow-y: auto;
	background: var(--tm-lm-overlay);
	-webkit-backdrop-filter: blur(var(--tm-lm-blur));
	backdrop-filter: blur(var(--tm-lm-blur));
	font-family: var(--tm-lm-font, inherit);
	line-height: 1.4;
	box-sizing: border-box;
}
#tm-lm-modal.is-open { display: flex; }
#tm-lm-modal[hidden]:not(.is-open) { display: none; }
#tm-lm-modal *, #tm-lm-modal *::before, #tm-lm-modal *::after { box-sizing: border-box; }

#tm-lm-modal .tm-lm-dialog {
	width: 100%;
	max-width: var(--tm-lm-width);
	border-radius: var(--tm-lm-radius);
	overflow: hidden;
	color: var(--tm-lm-body-text);
	box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
	animation: tm-lm-in .22s ease-out;
}
@keyframes tm-lm-in { from { opacity: 0; transform: translateY(-14px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #tm-lm-modal .tm-lm-dialog { animation: none; } }

/* Header */
#tm-lm-modal .tm-lm-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 16px 18px 20px;
	background: var(--tm-lm-header-bg);
	color: var(--tm-lm-header-text);
}
#tm-lm-modal .tm-lm-title {
	margin: 0;
	padding: 0;
	font-family: var(--tm-lm-heading-font, inherit);
	font-size: 30px;
	font-weight: var(--tm-lm-title-weight);
	line-height: 1.15;
	letter-spacing: 0;
	text-transform: none;
	color: inherit;
}
#tm-lm-modal .tm-lm-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: -6px -4px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	align-self: flex-start;
}
#tm-lm-modal .tm-lm-close:hover,
#tm-lm-modal .tm-lm-close:focus-visible { background: rgba(255, 255, 255, .15); outline: none; }

/* Body */
#tm-lm-modal .tm-lm-body { background: var(--tm-lm-body-bg); }
#tm-lm-modal .tm-lm-panel[hidden] { display: none; }
#tm-lm-modal .tm-lm-form { margin: 0; padding: 20px 18px 26px; }

#tm-lm-modal .tm-lm-field { margin: 0 0 18px; }
#tm-lm-modal .tm-lm-field label {
	display: block;
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 400;
	color: var(--tm-lm-body-text);
}
#tm-lm-modal input[type="text"],
#tm-lm-modal input[type="email"],
#tm-lm-modal input[type="password"] {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
	margin: 0;
	padding: 10px 12px;
	border: 2px solid var(--tm-lm-input-border);
	border-radius: 3px;
	background: var(--tm-lm-input-bg);
	color: var(--tm-lm-input-text);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.3;
	box-shadow: none;
}
#tm-lm-modal input[type="text"]:focus,
#tm-lm-modal input[type="email"]:focus,
#tm-lm-modal input[type="password"]:focus {
	outline: 2px solid var(--tm-lm-btn);
	outline-offset: 1px;
}

#tm-lm-modal .tm-lm-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 14px;
	font-size: 15px;
	line-height: 1.35;
}
#tm-lm-modal .tm-lm-check input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--tm-lm-accent);
	cursor: pointer;
}
#tm-lm-modal .tm-lm-check label { margin: 0; cursor: pointer; color: var(--tm-lm-body-text); }
#tm-lm-modal .tm-lm-check a,
#tm-lm-modal .tm-lm-msg a { color: inherit; text-decoration: underline; }

#tm-lm-modal .tm-lm-ts { margin: 4px 0 14px; }
#tm-lm-modal .tm-lm-ts:empty { display: none; }

#tm-lm-modal .tm-lm-submit { margin: 10px 0 0; }
#tm-lm-modal .tm-lm-btn {
	display: inline-block;
	min-width: 200px;
	margin: 0;
	padding: 11px 28px;
	border: 2px solid var(--tm-lm-btn);
	border-radius: 999px;
	background: transparent;
	color: var(--tm-lm-btn);
	font-family: inherit;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: .02em;
	text-transform: none;
	cursor: pointer;
	box-shadow: none;
	transition: background-color .15s ease, color .15s ease;
}
#tm-lm-modal .tm-lm-btn:hover,
#tm-lm-modal .tm-lm-btn:focus-visible {
	background: var(--tm-lm-btn-hover-bg);
	color: var(--tm-lm-btn-hover-text);
	outline: none;
}
#tm-lm-modal .tm-lm-btn[disabled] { opacity: .6; cursor: progress; }

/* Bottom links */
#tm-lm-modal .tm-lm-links { margin: 0; padding: 0; }
#tm-lm-modal .tm-lm-links a {
	display: block;
	padding: 12px 15px;
	border-top: 1px solid var(--tm-lm-divider);
	color: var(--tm-lm-link);
	font-size: 16px;
	text-decoration: none;
	box-shadow: none;
}
#tm-lm-modal .tm-lm-links a:last-child { border-bottom: 1px solid var(--tm-lm-divider); }
#tm-lm-modal .tm-lm-links a:hover,
#tm-lm-modal .tm-lm-links a:focus-visible { background: rgba(255, 255, 255, .08); outline: none; }

/* Messages */
#tm-lm-modal .tm-lm-msg { display: none; margin: 0 0 16px; padding: 10px 12px; border-radius: 3px; font-size: 15px; }
#tm-lm-modal .tm-lm-msg.is-error { display: block; background: #b3261e; color: #fff; }
#tm-lm-modal .tm-lm-msg.is-ok { display: block; background: #1e7a46; color: #fff; }

/* Honeypot: invisible to people, visible to bots */
.tm-lm-hp { position: absolute !important; left: -10000px !important; top: auto !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* Lock page scroll while open */
html.tm-lm-locked, html.tm-lm-locked body { overflow: hidden; }

/* Settings page preview */
#tm-lm-modal.is-preview { position: relative; inset: auto; z-index: 1; display: flex; padding: 40px 16px; min-height: 100%; }

@media (max-width: 480px) {
	#tm-lm-modal { padding-top: 6vh; }
	#tm-lm-modal .tm-lm-title { font-size: 26px; }
	#tm-lm-modal .tm-lm-btn { width: 100%; min-width: 0; }
}
