/**
 * Модальне вікно входу та реєстрації.
 *
 * Геометрію взято з макета: діалог 460 px, радіус 28, поля 52 px із
 * радіусом 14, кнопки-пігулки 58 px. Кольори — наші токени, бо зелений
 * акцент макета належав іншому бренду.
 */

.am-modal {
	position: fixed;
	inset: 0;
	z-index: 3000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 24px;
	overflow: auto;
}

.am-modal[hidden] {
	display: none;
}

.am-auth__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(14, 16, 17, 0.52);
	backdrop-filter: blur(3px);
	animation: amAuthFade 0.25s ease both;
}

@keyframes amAuthFade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes amAuthIn {
	from { opacity: 0; transform: translateY(18px) scale(0.97); }
	to   { opacity: 1; transform: none; }
}

@keyframes amAuthPanel {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

.am-auth__dialog {
	position: relative;
	width: 100%;
	max-width: 460px;
	margin: auto;
	background: var(--am-surface, #fff);
	border-radius: 28px;
	padding: 34px 34px 30px;
	box-shadow: 0 30px 80px rgba(14, 16, 17, 0.28);
	animation: amAuthIn 0.38s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

/* ---------- закрити ---------- */

.am-auth__x {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--am-muted, #8a8f8b);
	font: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.am-auth__x:hover {
	background: var(--am-surface-3, #f1f2f1);
	color: var(--am-text, #0e1011);
}

/* ---------- перемикач вкладок ---------- */

.am-auth__tabs {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: var(--am-surface-3, #f1f2f1);
	border-radius: 999px;
	padding: 4px;
	margin: 6px 0 26px;
}

.am-auth__tabs:has(.am-auth__tab:only-of-type) {
	grid-template-columns: 1fr;
}

.am-auth__pill {
	position: absolute;
	top: 4px;
	bottom: 4px;
	left: 4px;
	width: calc(50% - 4px);
	border-radius: 999px;
	background: var(--am-dark, #1c1d1f);
	transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

:is(.am-modal, .am-auth) .am-auth__tab {
	position: relative;
	z-index: 1;
	/* на сторінці вкладки — посилання, тому вирівнюємо явно */
	display: grid;
	place-items: center;
	text-align: center;
	text-decoration: none;
	border: 0;
	background: transparent;
	cursor: pointer;
	font: inherit;
	font-size: 14.5px;
	font-weight: 700;
	padding: 12px 0;
	border-radius: 999px;
	color: var(--am-text-3, #6e736f);
	text-transform: none;
	transition: color 0.2s ease;
}

:is(.am-modal, .am-auth) .am-auth__tab.is-active {
	color: #fff;
}

/* ---------- панелі ---------- */

/* WooCommerce стилізує form.login власним display — перебиваємо специфічністю */
:is(.am-modal, .am-auth) .am-auth__panel {
	display: none;
}

:is(.am-modal, .am-auth) .am-auth__panel.is-active {
	display: block;
	animation: amAuthPanel 0.3s ease both;
}

.am-auth__h {
	margin: 0 0 8px;
	font-size: 30px;
	letter-spacing: -0.03em;
	font-weight: 800;
	line-height: 1.1;
}

.am-auth__lead {
	margin: 0 0 22px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--am-text-3, #6e736f);
}

/* ---------- поля ---------- */

.am-auth__label {
	display: block;
	font-size: 11px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--am-muted, #8a8f8b);
	margin-bottom: 8px;
}

.am-auth__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 18px 0 8px;
}

.am-auth__row .am-auth__label {
	margin-bottom: 0;
}

.am-auth__peek {
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--am-text-3, #6e736f);
	text-transform: none;
	transition: color 0.16s ease;
}

.am-auth__peek:hover {
	color: var(--am-text, #0e1011);
}

:is(.am-modal, .am-auth) input.am-auth__field {
	width: 100%;
	height: 52px;
	padding: 0 16px;
	font: inherit;
	font-size: 15px;
	color: var(--am-text, #0e1011);
	background: #fff;
	border: 1px solid var(--am-border-ctl, #dde0dd);
	border-radius: 14px;
	outline: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

:is(.am-modal, .am-auth) input.am-auth__field:focus {
	border-color: var(--am-dark, #1c1d1f);
	box-shadow: 0 0 0 4px rgba(28, 29, 31, 0.07);
}

:is(.am-modal, .am-auth) input.am-auth__field.is-bad {
	border-color: #c0392b;
}

.am-auth__err {
	margin-top: 7px;
	font-size: 13px;
	color: #c0392b;
}

/* ---------- надійність пароля ---------- */

.am-auth__meter {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
}

.am-auth__track {
	flex: 1;
	height: 4px;
	border-radius: 999px;
	background: #edeeed;
	overflow: hidden;
}

.am-auth__track span {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: #edeeed;
	transition: width 0.3s ease, background-color 0.3s ease;
}

.am-auth__strength {
	font-size: 12.5px;
	color: var(--am-muted, #8a8f8b);
	min-width: 104px;
	text-align: right;
}

/* ---------- запам’ятати / забули ---------- */

.am-auth__mid {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 20px 0 22px;
}

.am-auth__check {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 14.5px;
	color: var(--am-text, #0e1011);
	cursor: pointer;
	user-select: none;
}

.am-auth__check input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

:is(.am-modal, .am-auth) .am-auth__box {
	width: 22px;
	height: 22px;
	border-radius: 7px;
	border: 1.5px solid #c8ccc9;
	background: #fff;
	display: grid;
	place-items: center;
	transition: background-color 0.16s ease, border-color 0.16s ease;
}

.am-auth__box::after {
	content: "✓";
	color: #fff;
	font-size: 13px;
	line-height: 1;
	opacity: 0;
	transition: opacity 0.16s ease;
}

.am-auth__check input:checked + .am-auth__box {
	background: var(--am-dark, #1c1d1f);
	border-color: var(--am-dark, #1c1d1f);
}

.am-auth__check input:checked + .am-auth__box::after {
	opacity: 1;
}

.am-auth__check input:focus-visible + .am-auth__box {
	box-shadow: 0 0 0 4px rgba(28, 29, 31, 0.12);
}

.am-auth__link {
	font-size: 14.5px;
	font-weight: 600;
	color: var(--am-accent, #0071e3);
	text-decoration: none;
	border-bottom: 1px solid color-mix(in srgb, var(--am-accent, #0071e3) 35%, transparent);
}

.am-auth__link:hover {
	color: var(--am-accent, #0071e3);
	border-bottom-color: currentColor;
}

/* ---------- кнопка ---------- */

:is(.am-modal, .am-auth) .am-auth__submit {
	display: grid;
	place-items: center;
	width: 100%;
	height: 58px;
	border: 0;
	border-radius: 999px;
	background: var(--am-dark, #1c1d1f);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.2s ease;
}

:is(.am-modal, .am-auth) .am-auth__submit:hover {
	opacity: 0.88;
	color: #fff;
}

:is(.am-modal, .am-auth) .am-auth__submit:active {
	transform: scale(0.985);
}

:is(.am-modal, .am-auth) .am-auth__submit[disabled] {
	opacity: 0.55;
	cursor: default;
}

/* ---------- підписи ---------- */

.am-auth__note {
	margin-top: 16px;
	padding: 11px 14px;
	border-radius: 12px;
	background: #fdf0ee;
	font-size: 13.5px;
	line-height: 1.5;
	color: #a5321f;
}

.am-auth__policy {
	margin: 20px 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--am-text-3, #6e736f);
}

.am-auth__terms {
	margin: 16px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--am-faint, #a0a5a1);
	text-align: center;
}

.am-auth__terms a {
	color: inherit;
	border-bottom: 1px solid currentColor;
	text-decoration: none;
}

.am-auth__foot {
	margin: 20px 0 0;
	font-size: 14px;
	color: var(--am-text-3, #6e736f);
	text-align: center;
}

.am-auth__swap {
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--am-accent, #0071e3);
	text-transform: none;
}

/* ---------- успіх ---------- */

.am-auth__done {
	padding: 26px 0 10px;
	text-align: center;
}

.am-auth__tick {
	width: 62px;
	height: 62px;
	margin: 0 auto 20px;
	border-radius: 50%;
	background: var(--am-success, #0d7c37);
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 30px;
	line-height: 1;
}

.am-auth__done .am-auth__h {
	font-size: 26px;
}

.am-auth__done .am-auth__lead {
	margin-bottom: 26px;
}

/* ---------- мобільні ---------- */

@media (max-width: 520px) {
	.am-modal {
		padding: 14px;
	}

	.am-auth__dialog {
		border-radius: 22px;
		/* зверху більше місця: інакше хрестик налазить на перемикач вкладок */
		padding: 46px 20px 24px;
	}

	.am-auth__x {
		top: 10px;
		right: 10px;
	}

	.am-auth__h {
		font-size: 25px;
	}

	.am-auth__lead {
		font-size: 14.5px;
		margin-bottom: 18px;
	}

	.am-auth__mid {
		flex-wrap: wrap;
		gap: 12px;
	}
}

/* тіло не скролиться, поки відкрито вікно */
body.am-auth-open {
	overflow: hidden;
}


/* ---------- сторінка /my-account/ для гостя ---------- */

.am-auth {
	max-width: var(--am-container, 1360px);
	margin: 0 auto;
	padding: 20px var(--am-pad, 28px) 80px;
}

.am-auth__crumbs {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
	font-size: 13.5px;
	color: var(--am-muted, #8a8f8b);
}

.am-auth__crumbs a {
	color: var(--am-muted, #8a8f8b);
	text-decoration: none;
}

.am-auth__crumbs a:hover {
	color: var(--am-text, #0e1011);
}

.am-auth__page-title {
	margin: 0 0 26px;
	font-size: 44px;
	line-height: 1.05;
	letter-spacing: -0.035em;
	font-weight: 800;
}

/* та сама картка, що й у модальному вікні, тільки статична */
.am-auth .am-auth__dialog {
	margin: 0 auto;
	animation: none;
	border: 1px solid var(--am-border, #e4e6e4);
	box-shadow: none;
}

@media (max-width: 900px) {
	.am-auth__page-title {
		font-size: 32px;
		margin-bottom: 20px;
	}

	.am-auth {
		padding-top: 16px;
	}
}


/* Акцент вікна входу — зелений із макета */
.am-modal,
.am-auth {
	--am-accent: #0d7c37;
	max-width: none;
}

.am-auth {
	max-width: 1280px;
}

:is(.am-modal, .am-auth) .am-auth__link:hover,
:is(.am-modal, .am-auth) .am-auth__swap:hover {
	color: #0a5f2a;
}
