/**
 * Zima login & registration modal and the guest card of "My account".
 * Colors and font come from the Zima panel variables (with fallbacks for other themes).
 */

.zm-auth,
.zm-auth-guest {
	--zm-a-primary: var(--zm-color-primary, #b0306a);
	--zm-a-primary-hover: var(--zm-color-primary-hover, #962a5a);
	--zm-a-primary-soft: var(--zm-color-primary-soft, #f7eaf0);
	--zm-a-text: var(--zm-color-text, #1f1f1f);
	--zm-a-heading: var(--zm-color-heading, #111111);
	--zm-a-bg: var(--zm-color-background, #ffffff);
	--zm-a-border: var(--zm-color-border, #e6e6e6);
	--zm-a-muted: color-mix(in srgb, var(--zm-a-text) 60%, var(--zm-a-bg));
	--zm-a-field: color-mix(in srgb, var(--zm-a-text) 3%, var(--zm-a-bg));
	--zm-a-radius: 14px;

	font-family: var(--zm-font-body, system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif);
	color: var(--zm-a-text);
	direction: rtl;
	text-align: right;
}

html.zm-auth-lock {
	overflow: hidden;
}

/* ---------- Dialog ---------- */

.zm-auth {
	position: fixed;
	inset: 0;
	width: min(420px, calc(100% - 32px));
	max-width: none;
	height: fit-content;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	overflow: visible;
	font-size: 15px;
	line-height: 1.7;
	background: transparent;
	border: 0;
}

.zm-auth:not([open]) {
	display: none;
}

.zm-auth[open] {
	animation: zm-auth-in 0.22s ease-out;
}

.zm-auth::backdrop {
	background: rgb(15 15 20 / 0.5);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.zm-auth [hidden] {
	display: none !important;
}

.zm-auth *,
.zm-auth *::before,
.zm-auth *::after {
	box-sizing: border-box;
}

.zm-auth__box {
	position: relative;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	padding: 28px 28px 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--zm-a-bg);
	border-radius: 24px;
	box-shadow: 0 24px 60px rgb(0 0 0 / 0.18);
}

/* ---------- Header parts ---------- */

.zm-auth .zm-auth__close,
.zm-auth .zm-auth__back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-height: 0;
	padding: 0;
	color: var(--zm-a-muted);
	background: var(--zm-a-field);
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	transition: color 0.15s, background-color 0.15s;
}

.zm-auth .zm-auth__close:hover,
.zm-auth .zm-auth__close:focus-visible,
.zm-auth .zm-auth__back:hover,
.zm-auth .zm-auth__back:focus-visible {
	color: var(--zm-a-primary);
	background: var(--zm-a-primary-soft);
	outline: none;
}

.zm-auth .zm-auth__close {
	position: absolute;
	top: 18px;
	inset-inline-end: 18px;
	z-index: 1;
}

.zm-auth__icon {
	display: block;
	flex-shrink: 0;
}

.zm-auth__brand {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	margin: 0 44px 20px;
}

.zm-auth__logo {
	display: block;
	width: auto;
	max-width: 160px;
	height: auto;
	max-height: 40px;
}

.zm-auth__site {
	font-family: var(--zm-font-heading, inherit);
	font-size: 17px;
	font-weight: 800;
	color: var(--zm-a-heading);
}

.zm-auth[data-step="done"] .zm-auth__brand,
.zm-auth[data-step="done"] .zm-auth__terms {
	display: none;
}



/* ---------- View ---------- */

.zm-auth__view {
	animation: zm-auth-fade 0.2s ease-out;
}

.zm-auth__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}

.zm-auth .zm-auth__title {
	margin: 0;
	font-family: var(--zm-font-heading, inherit);
	font-size: 20px;
	font-weight: 800;
	line-height: 1.5;
	color: var(--zm-a-heading);
}

.zm-auth .zm-auth__title:focus {
	outline: none;
}

.zm-auth__head + .zm-auth__form {
	margin-top: 16px;
}

.zm-auth .zm-auth__desc {
	margin: 0 0 20px;
	font-size: 13.5px;
	line-height: 1.9;
	color: var(--zm-a-muted);
}

.zm-auth__phone {
	font-weight: 700;
	color: var(--zm-a-text);
	unicode-bidi: isolate;
	direction: ltr;
}

/* ---------- Fields ---------- */

.zm-auth__form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
}

.zm-auth__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.zm-auth__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.zm-auth__label-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.zm-auth .zm-auth__label {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--zm-a-text);
}

.zm-auth__optional {
	font-weight: 400;
	color: var(--zm-a-muted);
}

.zm-auth .zm-auth__input {
	display: block;
	width: 100%;
	height: 50px;
	min-height: 0;
	margin: 0;
	padding: 0 16px;
	font: inherit;
	font-size: 15px;
	color: var(--zm-a-text);
	background: var(--zm-a-field);
	border: 1px solid var(--zm-a-border);
	border-radius: var(--zm-a-radius);
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.zm-auth .zm-auth__input::placeholder {
	color: var(--zm-a-muted);
	opacity: 0.7;
}

.zm-auth .zm-auth__input:focus {
	background: var(--zm-a-bg);
	border-color: var(--zm-a-primary);
	box-shadow: 0 0 0 4px var(--zm-a-primary-soft);
}

.zm-auth .zm-auth__input--ltr {
	text-align: left;
	direction: ltr;
}

.zm-auth .zm-auth__input--code {
	height: 58px;
	padding-inline-start: 0.6em;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: 0.6em;
	text-align: center;
	direction: ltr;
}

.zm-auth__password {
	position: relative;
}

.zm-auth .zm-auth__password .zm-auth__input {
	padding-right: 50px;
}

.zm-auth .zm-auth__reveal {
	position: absolute;
	top: 50%;
	right: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-height: 0;
	padding: 0;
	color: var(--zm-a-muted);
	background: transparent;
	border: 0;
	border-radius: 10px;
	box-shadow: none;
	cursor: pointer;
	transform: translateY(-50%);
}

.zm-auth .zm-auth__reveal:hover,
.zm-auth .zm-auth__reveal:focus-visible {
	color: var(--zm-a-primary);
	background: var(--zm-a-primary-soft);
	outline: none;
}

.zm-auth__eye-slash {
	display: none;
}

.zm-auth__reveal.is-on .zm-auth__eye-slash {
	display: inline;
}

.zm-auth .zm-auth__hint {
	margin: 0;
	font-size: 12px;
	color: var(--zm-a-muted);
}

.zm-auth__captcha {
	min-height: 65px;
}

/* ---------- Alert ---------- */

.zm-auth__alert {
	padding: 10px 14px;
	font-size: 13px;
	line-height: 1.9;
	color: #b42318;
	background: #fdecec;
	border-radius: 12px;
}

.zm-auth__alert[data-type="success"] {
	color: #14633f;
	background: #e8f7ef;
}

.zm-auth__alert[data-type="info"] {
	color: #7a4a0b;
	background: #fdf3e1;
}

/* ---------- Buttons ---------- */

.zm-auth .zm-auth__submit {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 52px;
	min-height: 0;
	margin: 4px 0 0;
	padding: 0 20px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
	background: var(--zm-a-primary);
	border: 0;
	border-radius: var(--zm-a-radius);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s, transform 0.1s;
}

.zm-auth .zm-auth__submit:hover,
.zm-auth .zm-auth__submit:focus-visible {
	color: #ffffff;
	background: var(--zm-a-primary-hover);
}

.zm-auth .zm-auth__submit:focus-visible {
	outline: 3px solid var(--zm-a-primary-soft);
	outline-offset: 2px;
}

.zm-auth .zm-auth__submit:active {
	transform: scale(0.99);
}

.zm-auth .zm-auth__submit:disabled {
	cursor: default;
	opacity: 0.85;
}

.zm-auth .zm-auth__submit.is-busy {
	color: transparent;
}

.zm-auth .zm-auth__submit.is-busy::after {
	content: "";
	position: absolute;
	inset: 0;
	width: 20px;
	height: 20px;
	margin: auto;
	border: 2px solid rgb(255 255 255 / 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: zm-auth-spin 0.7s linear infinite;
}

.zm-auth .zm-auth__link {
	display: inline;
	min-height: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	font-weight: 700;
	color: var(--zm-a-primary);
	text-decoration: none;
	background: none;
	border: 0;
	box-shadow: none;
	cursor: pointer;
}

.zm-auth .zm-auth__link:hover,
.zm-auth .zm-auth__link:focus-visible {
	color: var(--zm-a-primary-hover);
	text-decoration: underline;
	text-underline-offset: 4px;
	background: none;
	outline: none;
}

.zm-auth .zm-auth__link:disabled {
	cursor: default;
	opacity: 0.6;
}

.zm-auth .zm-auth__link--sm {
	font-size: 12.5px;
}

/* ---------- Footer lines ---------- */

.zm-auth .zm-auth__alt {
	margin: 14px 0 0;
	font-size: 13px;
	text-align: center;
}

.zm-auth .zm-auth__switch,
.zm-auth .zm-auth__timer {
	margin: 18px 0 0;
	font-size: 13px;
	color: var(--zm-a-muted);
	text-align: center;
}

.zm-auth__resend-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	font-size: 13px;
}

.zm-auth__resend-box .zm-auth__captcha {
	align-self: stretch;
}

.zm-auth .zm-auth__terms {
	margin: 20px 0 0;
	padding-top: 16px;
	font-size: 12px;
	line-height: 1.9;
	color: var(--zm-a-muted);
	text-align: center;
	border-top: 1px solid var(--zm-a-border);
}

.zm-auth .zm-auth__terms a {
	color: var(--zm-a-primary);
	text-decoration: none;
}

.zm-auth .zm-auth__terms a:hover {
	text-decoration: underline;
}

/* ---------- Done ---------- */

.zm-auth__done {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 24px 0 8px;
	text-align: center;
}

.zm-auth__done-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-bottom: 16px;
	color: var(--zm-a-primary);
	background: var(--zm-a-primary-soft);
	border-radius: 50%;
	animation: zm-auth-pop 0.35s ease-out;
}

.zm-auth__done-icon .zm-auth__icon {
	width: 30px;
	height: 30px;
}

.zm-auth__done .zm-auth__desc {
	margin: 4px 0 0;
}

/* ---------- Guest card on "My account" ---------- */

.zm-auth-guest {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 440px;
	margin: 40px auto;
	padding: 36px 28px;
	text-align: center;
	background: var(--zm-a-bg);
	border: 1px solid var(--zm-a-border);
	border-radius: 24px;
}

.zm-auth-guest__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-bottom: 16px;
	color: var(--zm-a-primary);
	background: var(--zm-a-primary-soft);
	border-radius: 50%;
}

.zm-auth-guest .zm-auth-guest__title {
	margin: 0 0 8px;
	font-family: var(--zm-font-heading, inherit);
	font-size: 20px;
	font-weight: 800;
	color: var(--zm-a-heading);
}

.zm-auth-guest .zm-auth-guest__text {
	margin: 0 0 22px;
	font-size: 14px;
	line-height: 1.9;
	color: var(--zm-a-muted);
}

.zm-auth-guest .zm-auth-guest__button {
	min-width: 200px;
	height: 50px;
	padding: 0 28px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
	background: var(--zm-a-primary);
	border: 0;
	border-radius: var(--zm-a-radius);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s;
}

.zm-auth-guest .zm-auth-guest__button:hover,
.zm-auth-guest .zm-auth-guest__button:focus-visible {
	color: #ffffff;
	background: var(--zm-a-primary-hover);
}

/* ---------- Mobile: bottom sheet ---------- */

@media (max-width: 600px) {
	.zm-auth {
		width: 100%;
		max-height: 92vh;
		max-height: 92dvh;
		margin: auto 0 0;
	}

	.zm-auth[open] {
		animation-name: zm-auth-up;
		animation-duration: 0.28s;
	}

	.zm-auth__box {
		max-height: 92vh;
		max-height: 92dvh;
		padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
		border-radius: 24px 24px 0 0;
	}

	.zm-auth__box::before {
		content: "";
		display: block;
		width: 40px;
		height: 4px;
		margin: 0 auto 14px;
		background: var(--zm-a-border);
		border-radius: 4px;
	}

	.zm-auth .zm-auth__close {
		top: 22px;
		inset-inline-end: 16px;
	}

	.zm-auth__brand {
		margin-top: 6px;
	}

	.zm-auth__row {
		grid-template-columns: 1fr;
	}

	/* 16px stops iOS from zooming into focused fields. */
	.zm-auth .zm-auth__input {
		font-size: 16px;
	}
}

/* ---------- Motion ---------- */

@keyframes zm-auth-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
}

@keyframes zm-auth-up {
	from {
		transform: translateY(100%);
	}
}

@keyframes zm-auth-fade {
	from {
		opacity: 0;
	}
}

@keyframes zm-auth-pop {
	from {
		transform: scale(0.6);
		opacity: 0;
	}
}

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

@media (prefers-reduced-motion: reduce) {
	.zm-auth[open],
	.zm-auth__view,
	.zm-auth__done-icon {
		animation: none;
	}
}