/**
 * Auth Popup styles.
 * Every selector is scoped under the .auth-popup- namespace, plus the single
 * body.auth-popup-locked scroll lock. No global element selectors, no imports
 * and no external fonts.
 *
 * Interactive controls (buttons, inputs, selects and links) are always
 * qualified with the .auth-popup-overlay ancestor so their specificity is at
 * least (0,2,0). Theme resets such as hello-elementor's reset.css style bare
 * button/a/input selectors at (0,1,0) or below, so without the ancestor they
 * win on source order and paint our controls with the theme palette.
 */

.auth-popup-overlay,
.auth-popup-overlay * {
	box-sizing: border-box;
}

.auth-popup-overlay {
	/* Tab colors. Overridable from the Estilo settings screen. */
	--auth-popup-tab-active-bg: #8b684d;
	--auth-popup-tab-active-text: #ffffff;
	--auth-popup-tab-active-border: #8b684d;
	--auth-popup-tab-bg: #fcf3ed;
	--auth-popup-tab-text: #8b684d;
	--auth-popup-tab-border: #fcf3ed;
	--auth-popup-tab-hover-bg: #fef3ee;
	--auth-popup-tab-hover-text: #8b684d;

	/* Submit button colors. */
	--auth-popup-btn-bg: #8b684d;
	--auth-popup-btn-text: #ffffff;
	--auth-popup-btn-border: #8b684d;
	--auth-popup-btn-hover-bg: #fef3ee;
	--auth-popup-btn-hover-text: #8b684d;
	--auth-popup-btn-hover-border: #8b684d;

	/* Text colors. */
	--auth-popup-accent: #8b684d;
	--auth-popup-text: #000000;
	--auth-popup-muted: #8a8a8a;

	/* Field colors. Overridable from the Estilo settings screen. */
	--auth-popup-field-bg: #fffcf8;
	--auth-popup-field-border: #d8c8ba;
	--auth-popup-field-focus-bg: #fffcf8;
	--auth-popup-field-focus-border: #d8c8ba;

	/* Radius tokens. The tab and button radius are overridable. */
	--auth-popup-tab-radius: 8px;
	--auth-popup-btn-radius: 5px;

	/* Fixed design tokens, not exposed in the settings screen. */
	--auth-popup-surface: #ffffff;
	--auth-popup-radius: 10px;
	--auth-popup-field-radius: 8px;
	--auth-popup-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.7);
	font-family: var(--auth-popup-font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--auth-popup-text, #000000);
}

/*
 * Hard reset for our interactive controls. Theme resets frequently style bare
 * button/a/input selectors; this block strips those inherited decorations
 * before the per-control rules below apply.
 */
.auth-popup-overlay .auth-popup-close,
.auth-popup-overlay .auth-popup-toggle-password,
.auth-popup-overlay .auth-popup-tab,
.auth-popup-overlay .auth-popup-submit,
.auth-popup-overlay .auth-popup-forgot {
	appearance: none;
	-webkit-appearance: none;
	background-image: none;
	box-shadow: none;
	text-shadow: none;
	text-decoration: none;
	font-family: inherit;
	line-height: normal;
	min-height: 0;
}

.auth-popup-overlay.is-open {
	display: flex;
}

.auth-popup-overlay[hidden] {
	display: none;
}

.auth-popup-modal {
	position: relative;
	display: flex;
	width: 100%;
	max-width: 900px;
	max-height: 700px;
	/* Never taller than the viewport; the body scrolls internally. */
	max-height: min(700px, calc(100vh - 32px));
	overflow: hidden;
	background: var(--auth-popup-surface);
	border-radius: var(--auth-popup-radius);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.auth-popup-overlay.is-open .auth-popup-modal {
	animation: auth-popup-fade-in 0.18s ease;
}

@keyframes auth-popup-fade-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.auth-popup-overlay .auth-popup-close {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--auth-popup-muted, #8a8a8a);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.auth-popup-overlay .auth-popup-close:hover,
.auth-popup-overlay .auth-popup-close:focus-visible {
	background: rgba(0, 0, 0, 0.06);
	color: var(--auth-popup-text, #000000);
}

.auth-popup-media {
	flex: 0 0 50%;
	background-color: #f3e3d8;
	background-image: linear-gradient(160deg, #f6e7dc 0%, #e9d4c5 55%, #e2c8b6 100%);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border-top-left-radius: var(--auth-popup-radius);
	border-bottom-left-radius: var(--auth-popup-radius);
}

/* With a real image the inline background-image wins; drop the fallback tint. */
.auth-popup-media.has-image {
	background-image: none;
}

.auth-popup-body {
	flex: 1 1 50%;
	min-width: 0;
	padding: 40px 30px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: var(--auth-popup-surface);
	border-top-right-radius: var(--auth-popup-radius);
	border-bottom-right-radius: var(--auth-popup-radius);
}

.auth-popup-tabs {
	display: flex;
	gap: 8px;
	margin: 0 0 24px;
}

.auth-popup-overlay .auth-popup-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 1 1 0;
	padding: 11px 20px;
	border: 1px solid var(--auth-popup-tab-border, #fcf3ed);
	border-radius: var(--auth-popup-tab-radius, 8px);
	background: var(--auth-popup-tab-bg, #fcf3ed);
	color: var(--auth-popup-tab-text, #8b684d);
	font: inherit;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.auth-popup-tab-icon {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

.auth-popup-overlay .auth-popup-tab:hover,
.auth-popup-overlay .auth-popup-tab:focus-visible {
	background: var(--auth-popup-tab-hover-bg, #fef3ee);
	color: var(--auth-popup-tab-hover-text, #8b684d);
	border-color: var(--auth-popup-tab-hover-bg, #fef3ee);
}

.auth-popup-overlay .auth-popup-tab.is-active {
	background: var(--auth-popup-tab-active-bg, #8b684d);
	color: var(--auth-popup-tab-active-text, #ffffff);
	border-color: var(--auth-popup-tab-active-border, #8b684d);
}

.auth-popup-panel[hidden] {
	display: none;
}

.auth-popup-heading {
	margin: 0 0 6px;
	color: var(--auth-popup-text, #000000);
	font-size: 20px;
	font-weight: 700;
}

.auth-popup-subheading {
	margin: 0 0 22px;
	color: var(--auth-popup-muted, #8a8a8a);
	font-size: 15px;
	line-height: 1.45;
}

.auth-popup-field {
	margin: 0 0 16px;
}

.auth-popup-input {
	position: relative;
	display: block;
}

.auth-popup-field-icon {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	color: var(--auth-popup-accent, #8b684d);
	font-size: 14px;
	pointer-events: none;
}

.auth-popup-field-icon svg {
	display: block;
	width: 16px;
	height: 16px;
}

.auth-popup-overlay .auth-popup-field input[type="text"],
.auth-popup-overlay .auth-popup-field input[type="email"],
.auth-popup-overlay .auth-popup-field input[type="password"] {
	width: 100%;
	height: 50px;
	padding-left: 40px;
	padding-right: 12px;
	border: 1px solid var(--auth-popup-field-border);
	border-radius: var(--auth-popup-field-radius);
	background: var(--auth-popup-field-bg);
	color: var(--auth-popup-text, #000000);
	font: inherit;
	font-size: 14px;
	transition: border-color 0.15s ease;
}

.auth-popup-overlay .auth-popup-field input::placeholder {
	color: var(--auth-popup-muted, #8a8a8a);
	opacity: 1;
}

.auth-popup-overlay .auth-popup-field input[type="text"]:focus,
.auth-popup-overlay .auth-popup-field input[type="email"]:focus,
.auth-popup-overlay .auth-popup-field input[type="password"]:focus {
	outline: none;
	border: 1px solid var(--auth-popup-field-focus-border, #d8c8ba);
	background: var(--auth-popup-field-focus-bg, #fffcf8);
}

.auth-popup-password {
	position: relative;
}

.auth-popup-overlay .auth-popup-password input {
	padding-right: 44px;
}

.auth-popup-overlay .auth-popup-toggle-password {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--auth-popup-accent, #8b684d);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.auth-popup-overlay .auth-popup-toggle-password:hover,
.auth-popup-overlay .auth-popup-toggle-password:focus-visible {
	background: var(--auth-popup-tab-hover-bg, #fef3ee);
}

.auth-popup-toggle-password svg {
	display: block;
	width: 18px;
	height: 18px;
}

.auth-popup-toggle-password .auth-popup-icon-eye-off {
	display: none;
}

.auth-popup-toggle-password.is-visible .auth-popup-icon-eye {
	display: none;
}

.auth-popup-toggle-password.is-visible .auth-popup-icon-eye-off {
	display: block;
}

.auth-popup-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 20px;
	font-size: 14px;
}

.auth-popup-remember {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--auth-popup-text, #000000);
	cursor: pointer;
}

.auth-popup-overlay .auth-popup-remember input[type="checkbox"] {
	margin: 0;
}

.auth-popup-overlay .auth-popup-forgot {
	color: var(--auth-popup-accent, #8b684d);
	text-decoration: none;
}

.auth-popup-overlay .auth-popup-forgot:hover,
.auth-popup-overlay .auth-popup-forgot:focus-visible {
	text-decoration: underline;
}

.auth-popup-overlay .auth-popup-submit {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 47px;
	min-height: 47px;
	padding: 0 16px;
	border: 1px solid var(--auth-popup-btn-border, #8b684d);
	border-radius: var(--auth-popup-btn-radius, 5px);
	background: var(--auth-popup-btn-bg, #8b684d);
	color: var(--auth-popup-btn-text, #ffffff);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	text-transform: capitalize;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.auth-popup-submit-icon {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

.auth-popup-overlay .auth-popup-submit:hover,
.auth-popup-overlay .auth-popup-submit:focus-visible {
	background: var(--auth-popup-btn-hover-bg, #fef3ee);
	color: var(--auth-popup-btn-hover-text, #8b684d);
	border-color: var(--auth-popup-btn-hover-border, #8b684d);
}

.auth-popup-overlay .auth-popup-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.auth-popup-form.is-loading .auth-popup-submit {
	opacity: 0.8;
	pointer-events: none;
}

.auth-popup-form.is-loading .auth-popup-submit::after {
	content: "";
	position: absolute;
	right: 16px;
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	opacity: 0.7;
	animation: auth-popup-spin 0.7s linear infinite;
}

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

.auth-popup-providers {
	margin: 24px 0 0;
}

.auth-popup-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	color: var(--auth-popup-accent, #8b684d);
	font-size: 13px;
}

.auth-popup-divider::before,
.auth-popup-divider::after {
	content: "";
	flex: 1 1 auto;
	border-top: 1px dashed var(--auth-popup-accent, #8b684d);
}

.auth-popup-divider-text {
	color: var(--auth-popup-accent, #8b684d);
	white-space: nowrap;
}

.auth-popup-message {
	margin: 16px 0 0;
	font-size: 14px;
}

.auth-popup-message:empty {
	display: none;
}

.auth-popup-message.is-error,
.auth-popup-message.is-success {
	padding: 10px 12px;
	border-radius: var(--auth-popup-field-radius);
}

.auth-popup-message.is-error {
	background: #fdecec;
	color: #a52121;
}

.auth-popup-message.is-success {
	background: #eaf7ee;
	color: #1c6b34;
}

.auth-popup-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

body.auth-popup-locked {
	overflow: hidden;
}

.auth-popup-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 760px) {
	.auth-popup-media {
		display: none;
	}

	.auth-popup-body {
		flex: 1 1 100%;
		border-radius: var(--auth-popup-radius);
	}
}

@media (max-width: 480px) {
	.auth-popup-overlay {
		padding: 12px;
	}

	.auth-popup-body {
		padding: 32px 20px;
	}

	.auth-popup-row {
		flex-wrap: wrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	.auth-popup-overlay,
	.auth-popup-overlay .auth-popup-modal,
	.auth-popup-overlay .auth-popup-tab,
	.auth-popup-overlay .auth-popup-close,
	.auth-popup-overlay .auth-popup-toggle-password,
	.auth-popup-overlay .auth-popup-submit,
	.auth-popup-overlay .auth-popup-form.is-loading .auth-popup-submit::after {
		transition: none !important;
		animation: none !important;
	}
}
