/* ==========================================================================
   Auth modals: Login & Register
   ========================================================================== */

/* Common modal shell (matches quick-view pattern). */
body.kadence-child-auth-open {
	overflow: hidden;
}

.kadence-child-auth[hidden] {
	display: none !important;
}

.kadence-child-auth {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kadence-child-auth__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
}

.kadence-child-auth__dialog {
	position: relative;
	width: min(480px, calc(100vw - 24px));
	max-height: calc(100vh - 24px);
	overflow-y: auto;
	background-color: #FDFDFD;
	border-radius: 14px;
	padding: 20px 30px;
	box-shadow: 0 24px 72px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* Header (title + close / back). */
.kadence-child-auth__header {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	min-height: 28px;
}

.kadence-child-auth__title {
	margin: 0;
	text-align: center;
	flex: 1;
}

.kadence-child-one-click__title {
	text-align: left;
}

/* Close button — same as .kadence-child-qv__close. */
.kadence-child-auth__close {
	position: absolute;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #282727;
	font-size: 0;
	line-height: 0;
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.kadence-child-auth__close:hover,
.kadence-child-auth__close:focus {
	background: transparent;
	color: var(--global-palette5);
	box-shadow: none;
}

.kadence-child-auth__close svg {
	display: block;
}

/* Back button (register modal). */
.kadence-child-auth__back {
	position: absolute;
	top: 50%;
	left: 0;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #282727;
	font-size: 0;
	line-height: 0;
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.kadence-child-auth__back:hover,
.kadence-child-auth__back:focus {
	background: transparent;
	color: var(--global-palette5);
	box-shadow: none;
}

.kadence-child-auth__back svg {
	display: block;
}

/* ---- Form ---- */
.kadence-child-auth__form {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* Fields block. */
.kadence-child-auth__fields {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Single field group (label + input). */
.kadence-child-auth__field-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* Label. */
.kadence-child-auth__label {
	font-size: 10px;
	font-weight: 500;
	line-height: 1.4;
}

.kadence-child-auth__required {
	color: #e00;
}

/* Input wrapper. */
.kadence-child-auth__input-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

/* Input. */
.kadence-child-auth__input {
	width: 100%;
	border: 1px solid var(--global-palette6) !important;
	padding: 12px 16px !important;
	border-radius: 8px !important;
	color: var(--global-palette3) !important;
	outline: none;
	transition: border-color 0.2s ease;
	box-shadow: none !important;
}

.kadence-child-auth__input::placeholder {
	font-size: 14px;
	color: #9D9C9B;
}

.kadence-child-auth__input:focus {
	border-color: var(--global-palette2);
	box-shadow: none;
}

/* Validation error state. */
.kadence-child-auth__input.has-error {
	border-color: #e00;
}

/* Right padding when there is an eye toggle. */
.kadence-child-auth__input-wrap--password .kadence-child-auth__input {
	padding-right: 48px;
}

/* Eye toggle. */
.kadence-child-auth__eye {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	border: 0;
	background: transparent;
	color: #CDD3DE;
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.kadence-child-auth__eye:hover,
.kadence-child-auth__eye:focus {
	background: transparent;
	box-shadow: none;
	color: var(--global-palette4);
}

.kadence-child-auth__eye svg {
	display: block;
}

/* Show/hide eye icon states. */
.kadence-child-auth__eye .kadence-child-auth__eye-open {
	display: none;
}

.kadence-child-auth__eye.is-visible .kadence-child-auth__eye-closed {
	display: none;
}

.kadence-child-auth__eye.is-visible .kadence-child-auth__eye-open {
	display: block;
}

/* ---- Meta row: remember + forgot / login ---- */
.kadence-child-auth__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 12px;
	font-weight: 500;
}

.kadence-child-auth__remember {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	color: var(--global-palette4);
	font-size: 12px;
	font-weight: 500;
}

.kadence-child-auth__remember input[type="checkbox"] {
	margin: 0;
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: var(--global-palette2);
}

/* Links — inherit theme link styles, only override size/weight. */
.kadence-child-auth__link {
	font-size: 12px;
	font-weight: 500;
}

/* ---- Error message ---- */
.kadence-child-auth__error {
	background: #FFF0F0;
	border: 1px solid #FFCDD2;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 13px;
	color: var(--global-palette1);
}

.kadence-child-auth__error[hidden] {
	display: none;
}

/* ---- Submit button ---- */
.kadence-child-auth__submit-wrap {
	display: flex;
}

.kadence-child-auth__submit {
	width: 100%;
	padding: 10px !important;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	line-height: 120%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.kadence-child-auth__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ---- Switch block (Нет аккаунта? Зарегистрироваться) ---- */
.kadence-child-auth__switch {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	font-size: 12px;
	font-weight: 500;
	color: var(--global-palette4);
}

.kadence-child-auth__switch .kadence-child-auth__link {
	font-size: 12px;
	font-weight: 500;
}

/* ---- Social login block ---- */
.kadence-child-auth__social {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 24px;
	text-align: center;
}

.kadence-child-auth__social-text {
	font-size: 12px;
	font-weight: 500;
	color: var(--global-palette4);
}

.kadence-child-auth__social-buttons {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
	.kadence-child-auth__dialog {
		padding: 24px 20px;
		border-radius: 14px;
		max-height: 90vh;
		width: calc(100% - 24px);
	}
}

/* ──────────────────────────────────────────────────────────────────────────
   «Купить в 1 клик» — дополнения поверх kadence-child-auth
   ────────────────────────────────────────────────────────────────────────── */
.kdc-one-click .kadence-child-auth__dialog {
	overflow-y: auto;
	max-height: 90vh;
}

/* Консенты */
.kdc-one-click__consents {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

.kdc-one-click__consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--global-palette3);
	cursor: pointer;
}

.kdc-one-click__consent input[type="checkbox"] {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	accent-color: #8B0101;
	cursor: pointer;
}

.kdc-one-click__consent a {
	font-weight: 600;
	color: var(--global-palette3);
	text-decoration: underline;
}

/* Кнопка сабмит */
.kdc-one-click__submit {
	position: relative;
	width: 100%;
}

.kdc-one-click__submit.is-loading {
	pointer-events: none;
	color: transparent !important;
}

.kdc-one-click__submit.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: kdc-one-click-spin 0.7s linear infinite;
}

@keyframes kdc-one-click-spin {
	to { transform: rotate(360deg); }
}

/* Ошибка поля */
.kadence-child-auth__field-group.has-error .kadence-child-auth__input {
	border-color: var(--global-palette13, #e00) !important;
}

/* Состояние успеха */
.kdc-one-click__success {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 16px;
	padding: 8px 0;
}

.kdc-one-click__success[hidden] {
	display: none;
}

.kdc-one-click__success-icon {
	display: inline-flex;
}

.kdc-one-click__success-title {
	margin: 0 !important;
}

.kdc-one-click__success-text {
	margin: 0 !important;
	font-size: 15px;
	font-weight: 500;
	color: #6D7482;
	line-height: 1.5;
}

.kdc-one-click__success-close {
	width: 100%;
}
