
.pivenor-auth-overlay {
	position: fixed;
	inset: 0;
	background: rgba(var(--rgb-black), var(--alpha-55));
	z-index: 2000;
	backdrop-filter: blur(4px);
	display: none;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.pivenor-auth-overlay.is-active {
	display: flex;
	opacity: 1;
}

.pivenor-auth-modal {
	background: var(--color-surface);
	border-radius: var(--radius-7xl);
	box-shadow: 0 20px 60px rgba(var(--rgb-black), var(--alpha-20));
	width: calc(100% - 32px);
	max-width: 440px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	scrollbar-width: none;
	transform: scale(0.96);
	transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pivenor-auth-overlay.is-active .pivenor-auth-modal {
	transform: scale(1);
}

.pivenor-auth-modal::-webkit-scrollbar { display: none; }

.pivenor-auth-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-5) var(--space-6);
	border-bottom: 1px solid var(--color-border);
	position: sticky;
	top: 0;
	background: var(--color-surface);
	z-index: 1;
}

.pivenor-auth-header h3 {
	display: flex;
	align-items: center;
	gap: var(--space-2-5);
	font-size: var(--text-3xl);
	font-weight: var(--font-weight-bold);
	color: var(--color-text-primary);
	margin: 0;
}

.pivenor-auth-header h3 svg {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.pivenor-auth-close {
	width: 36px;
	height: 36px;
	border-radius: var(--radius-half-percent);
	background: var(--color-background);
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--color-text-muted);
	transition: all 0.2s;
}

.pivenor-auth-close:hover {
	background: var(--color-border);
	transform: rotate(90deg);
}

.pivenor-auth-tabs {
	display: flex;
	border-bottom: 2px solid var(--color-background);
	background: var(--color-background);
	padding: 0 var(--space-6);
}

.pivenor-auth-tab {
	flex: 1;
	padding: var(--space-3-5);
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	font-size: var(--text-xl);
	font-weight: var(--font-weight-semibold);
	color: var(--color-text-muted);
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
}

.pivenor-auth-tab:hover { color: var(--color-accent-1); }

.pivenor-auth-tab.is-active {
	color: var(--color-accent-1);
	background: var(--color-surface);
	border-bottom-color: var(--color-accent-1);
}

.pivenor-auth-body { padding: var(--space-6); }

.pivenor-auth-form { display: none; }
.pivenor-auth-form.is-active { display: block; }

.pivenor-auth-field { margin-bottom: var(--space-3-5); }

.pivenor-auth-input-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.pivenor-auth-input-icon {
	position: absolute;
	left: var(--space-3-5);
	color: var(--color-text-muted);
	pointer-events: none;
	width: 16px;
	height: 16px;
}

.pivenor-auth-input {
	width: 100%;
	padding: var(--space-3) var(--space-3-5) var(--space-3) var(--space-11);
	border: 2px solid var(--color-border);
	border-radius: var(--radius-2xl);
	font-size: var(--text-xl);
	color: var(--color-text-primary);
	background: var(--color-surface);
	font-family: inherit;
	transition: border-color 0.2s, box-shadow 0.2s;
	outline: none;
}

.pivenor-auth-input:focus {
	border-color: var(--color-accent-1);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent-1) 10%, transparent);
}

.pivenor-auth-input::placeholder { color: var(--color-text-muted); }

.pivenor-auth-input-wrap.has-error .pivenor-auth-input {
	border-color: var(--color-error);
}

.pivenor-auth-field-error {
	display: none;
	font-size: var(--text-l);
	color: var(--color-error);
	margin-top: var(--space-1-5);
	line-height: var(--leading-snug);
}

.pivenor-auth-pwd-toggle {
	position: absolute;
	right: var(--space-3-5);
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	color: var(--color-text-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.pivenor-auth-pwd-toggle:hover {
	color: var(--color-text-primary);
}

.pivenor-auth-eye-icon {
	width: 18px;
	height: 18px;
}

.pivenor-auth-eye-icon--hide {
	display: none;
}

.pivenor-auth-input-wrap.is-showing-pwd .pivenor-auth-eye-icon--show {
	display: none;
}

.pivenor-auth-input-wrap.is-showing-pwd .pivenor-auth-eye-icon--hide {
	display: block;
}

.pivenor-auth-submit-btn {
	width: 100%;
	margin-top: var(--space-2);
	padding: var(--space-3-5);
	background: var(--color-accent-1);
	color: var(--color-text-on-accent);
	border: none;
	border-radius: var(--radius-2xl);
	font-size: var(--text-2xl);
	font-weight: var(--font-weight-bold);
	cursor: pointer;
	font-family: inherit;
	transition: all 0.2s;
	box-shadow: 0 4px 14px color-mix(in srgb, var(--color-accent-1) 30%, transparent);
}

.pivenor-auth-submit-btn:hover {
	background: var(--color-accent-hover);
	transform: translateY(-2px);
}

.pivenor-auth-submit-btn:disabled {
	background: var(--color-border);
	color: var(--color-text-muted);
	cursor: not-allowed;
	box-shadow: none;
}

.pivenor-auth-submit-btn:disabled:hover {
	background: var(--color-border);
	transform: none;
}

.pivenor-auth-notice {
	font-size: var(--text-l);
	color: var(--color-text-muted);
	margin: var(--space-2-5) 0;
	text-align: center;
}

.pivenor-auth-form { 
	position: relative; 
}

.pivenor-auth-loader {
	position: absolute;
	inset: 0;
	background: rgba(var(--rgb-white), var(--alpha-75));
	backdrop-filter: blur(2px);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-2xl);
}

.pivenor-spinner-svg {
	animation: rotate 2s linear infinite;
	width: 40px;
	height: 40px;
}

.pivenor-spinner-svg .path {
	stroke: var(--color-accent-1);
	stroke-linecap: round;
	animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
	100% { transform: rotate(360deg); }
}

@keyframes dash {
	0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
	50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
	100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.pivenor-auth-error {
	background: color-mix(in srgb, var(--color-error) 10%, transparent);
	color: var(--color-error);
	padding: var(--space-2-5) var(--space-3-5);
	border-radius: var(--radius-xl);
	font-size: var(--text-l);
	font-weight: var(--font-weight-medium);
	margin-bottom: var(--space-3-5);
	border: 1px solid color-mix(in srgb, var(--color-error) 30%, transparent);
}

.pivenor-auth-desc {
	font-size: var(--text-xl);
	color: var(--color-text-muted);
	margin-bottom: var(--space-1-5);
	text-align: center;
}

.pivenor-auth-desc-email {
	font-size: var(--text-xl);
	color: var(--color-text-primary);
	text-align: center;
	margin-bottom: var(--space-5);
}

.pivenor-auth-input--otp {
	text-align: center;
	letter-spacing: var(--tracking-otp);
	font-size: var(--text-3xl);
	font-weight: var(--font-weight-bold);
	padding-left: var(--space-3-5);
}

.pivenor-auth-input--otp:disabled {
	background: var(--color-background);
	color: var(--color-text-muted);
	cursor: not-allowed;
}

.pivenor-auth-resend {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: var(--space-4);
}

.pivenor-auth-link {
	background: none;
	border: none;
	padding: 0;
	font-size: var(--text-l);
	font-weight: var(--font-weight-semibold);
	color: var(--color-accent-1);
	cursor: pointer;
	font-family: inherit;
	transition: opacity 0.2s;
}

.pivenor-auth-forgot {
	margin: var(--neg-space-1) 0 var(--space-4);
	text-align: right;
}

.pivenor-auth-forgot .pivenor-auth-link {
	text-decoration: none;
}

.pivenor-auth-link:hover { opacity: 0.8; }
.pivenor-auth-link:disabled { color: var(--color-text-muted); cursor: not-allowed; }

.pivenor-pwd-strength {
	margin: var(--neg-space-1-5) 0 var(--space-3);
	display: none;
}

.pivenor-pwd-strength.is-active {
	display: block;
}

.pivenor-pwd-strength__top {
	display: block;
	margin-bottom: var(--space-3);
}

.pivenor-pwd-strength__bar {
	display: flex;
	gap: var(--space-1);
	height: 4px;
	width: 100%;
}

.pivenor-pwd-strength__seg {
	flex: 1;
	border-radius: var(--radius-s);
	background: var(--color-border);
	transition: background-color 0.25s ease;
}

.pivenor-pwd-strength[data-strength="1"] .pivenor-pwd-strength__seg:nth-child(-n+1) {
	background: var(--color-error);
}

.pivenor-pwd-strength[data-strength="2"] .pivenor-pwd-strength__seg:nth-child(-n+2) {
	background: var(--color-warning);
}

.pivenor-pwd-strength[data-strength="3"] .pivenor-pwd-strength__seg:nth-child(-n+3) {
	background: var(--color-gold);
}

.pivenor-pwd-strength[data-strength="4"] .pivenor-pwd-strength__seg {
	background: var(--color-success);
}

.pivenor-pwd-strength__label {
	display: block;
	margin-top: var(--space-2);
	font-size: var(--text-l);
	font-weight: var(--font-weight-semibold);
	color: var(--color-text-muted);
	white-space: nowrap;
}

.pivenor-pwd-strength[data-strength="1"] .pivenor-pwd-strength__label { color: var(--color-error); }
.pivenor-pwd-strength[data-strength="2"] .pivenor-pwd-strength__label { color: var(--color-warning); }
.pivenor-pwd-strength[data-strength="3"] .pivenor-pwd-strength__label { color: var(--color-gold); }
.pivenor-pwd-strength[data-strength="4"] .pivenor-pwd-strength__label { color: var(--color-success); }

.pivenor-pwd-checklist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-2-5) var(--space-6);
}

.pivenor-pwd-checklist li {
	display: flex;
	align-items: center;
	gap: var(--space-1-25);
	min-width: 0;
	font-size: var(--text-l);
	color: var(--color-text-muted);
	line-height: var(--leading-tight);
	transition: color 0.2s ease;
}

.pivenor-pwd-checklist__dot {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
	border-radius: var(--radius-half-percent);
	border: 2px solid var(--color-border);
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	color: transparent;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pivenor-pwd-checklist__tick {
	width: 6px;
	height: 6px;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.pivenor-pwd-checklist li.is-met {
	color: var(--color-success);
}

.pivenor-pwd-checklist li.is-met .pivenor-pwd-checklist__dot {
	border-color: var(--color-success);
	background-color: var(--color-success);
	color: var(--color-text-on-accent);
}

.pivenor-pwd-checklist li.is-met .pivenor-pwd-checklist__tick {
	opacity: 1;
}
