/* =========================================================
	Authica – Global Styles
	- Combined selectors where safe
	- Indentation uses TABS (no leading spaces)
   ========================================================= */


/* =========================================================
	1) Base document + viewport
   ========================================================= */

html,
body{
	height: 100%;
	width: 100%;
	margin: 0;
	padding: 0;

	/* Modern viewport handling (mobile safe areas) */
	min-height: 100dvh;
	min-height: 100svh;
	min-height: -webkit-fill-available;

	overflow-x: clip;

	font-family: "Segoe UI", sans-serif;
	color: #111;
	line-height: normal;
	letter-spacing: normal;
}

.authica-viewport{
	position: relative;
	display: flex;
	flex-direction: column;

	min-height: 100dvh;
	min-height: 100svh;
	min-height: -webkit-fill-available;

	height: 100%;
	width: 100%;
	overflow-x: hidden;

	/* flex fallback; grid-only props removed */
}

.authica-centerer{
	flex: 1 0 auto;
	display: grid;
	place-items: center;

	overflow: hidden;
	min-width: 200px;
	width: var(--authica-form-width, 300px);
	max-width: 800px;

	/* Centerer offset logic */
	margin-inline-start: calc(((var(--authica-form-offset-factor, 0) + 1) / 2) * (100% - min(100%, var(--authica-form-width, 300px))));
	margin-inline-end: calc(((1 - var(--authica-form-offset-factor, 0)) / 2) * (100% - min(100%, var(--authica-form-width, 300px))));

	transform: none !important;

	/* Shared field tokens */
	--authica-input-height: 40px;
	--authica-input-radius: 6px;
	--authica-input-mb: 12px;
	--authica-input-pb: 0px;
}

@media (max-width: 400px){
	.authica-centerer{
		padding-left: 10vw;
		padding-right: 10vw;
	}
}


/* =========================================================
	2) Form switching (data-active)
   ========================================================= */

.authica-form-overlay [data-form]{ display: none; }
.authica-form-overlay[data-active="login"]		[data-form="login"]{ display: block; }
.authica-form-overlay[data-active="register"]	[data-form="register"]{ display: block; }
.authica-form-overlay[data-active="reset"]		[data-form="reset"]{ display: block; }


/* =========================================================
	3) Logo + title links
   ========================================================= */

.authica-logo-wrapper{
	margin-top: 20px;
}

.authica-logo-link,
.authica-title-link{
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
	color: inherit;
}

.authica-logo-link img{
	display: block;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: auto;
}

.authica-logo-link:focus,
.authica-logo-link img:focus{
	outline: none;
	box-shadow: none;
}

.authica-title-link:hover,
.authica-title-link:focus{
	text-decoration: underline;
}


/* =========================================================
	4) Form containers + core forms
   ========================================================= */

.authica-form-overlay,
.authica-register-overlay,
.authica-lostpass-overlay,
.authica-resetpass-overlay,
.authica-2fa-overlay{
	width: inherit;
	border-radius: var(--authica-form-border-radius, 16px);
	box-shadow: var(--authica-form-shadow);
	text-align: center;
	overflow: auto;

	max-height: calc((var(--authica-vh, 1vh) * 100) - 2 * clamp(12px, 4vw, 32px) - var(--footer-height, 0px));
}

#loginform,
#registerform,
#lostpasswordform,
#resetpasswordform{
	display: block;
	margin: 0;
	box-sizing: border-box;
}


/* =========================================================
	5) Background overlay layer
   ========================================================= */

.authica-overlay-bg{
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;

	z-index: 0;
	pointer-events: none;

	background-color: rgba(0, 0, 0, 0.0);
	background: var(--authica-overlay-gradient, none);
}


/* =========================================================
	6) Header + logo rendering
   ========================================================= */

.authica-header{
	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	background-size: contain;

	/* Fix invalid value */
	margin-bottom: 0;
}

.authica-header.no-bg{
	background: none !important;
}

.authica-logo{
	display: block;
	height: auto;

	margin: var(--authica-logo-margin);
	padding-bottom: var(--authica-logo-padding);
}


/* =========================================================
	7) Title
   ========================================================= */

.authica-title{
	text-align: center;
	font-size: 32px;
	color: #111;
	margin-bottom: 30px;
}

.authica-title-text{
	margin-block: var(--authica-title-margin, 0);
	margin-inline: 0;

	color: var(--authica-title-color);
	font-size: var(--authica-title-size);
	padding-bottom: var(--authica-title-padding);

	text-shadow: 0 0 var(--authica-title-shadow-size) var(--authica-title-shadow-color);
}

.authica-title-text.bold{ font-weight: bold; }
.authica-title-text.italic{ font-style: italic; }
.authica-title-text.underline{ text-decoration: underline; }


/* =========================================================
	8) Form text + links
   ========================================================= */

.authica-form-text,
.authica-form-links,
.authica-form-text a,
.authica-form-links a,
p.authica-remember-me,
p.authica-remember-me.centered,
p.authica-remember-me label,
.authica-form-text a:hover,
.authica-form-links a:hover{
	color: var(--authica-form-text-color, #113266);
	border-color: var(--authica-form-text-color, #113266);

	font-size: var(--authica-form-text-size);
	text-shadow: 0 0 var(--authica-form-text-shadow-size, 0px) var(--authica-form-text-shadow-color, transparent);

	text-decoration: none;
	font-weight: normal;
}


/* =========================================================
	9) Inputs
   ========================================================= */

.authica-input::placeholder{
	color: var(--authica-placeholder-color, #888);
}

.authica-input{
	transition: border-color 0.2s ease;

	border-style: solid;
	height: var(--authica-input-height);
	border-radius: var(--authica-input-radius);

	margin-bottom: var(--authica-input-mb);
	padding-bottom: var(--authica-input-pb);
}

.authica-input:focus{
	outline: none;
}

/* Field styling fallback (in case inputs do not use .authica-input) */
.authica-form-overlay input[type="text"],
.authica-form-overlay input[type="password"],
.authica-form-overlay input[type="email"],
.authica-register-overlay input[type="text"],
.authica-register-overlay input[type="email"],
.authica-register-overlay input[type="password"],
.authica-lostpass-overlay input[type="email"],
.authica-resetpass-overlay input[type="password"],
.authica-2fa-overlay input[type="text"],
.authica-2fa-overlay input[type="password"]{
	width: 100%;
	padding: 12px;
	margin-bottom: 14px;
	border-radius: 8px;

	background-color: rgba(255, 255, 255, 0.8);

	font-size: 16px;
	box-sizing: border-box;
	display: block;

	transition: border-color 0.3s;
}

.authica-form-overlay input:invalid{
	border-color: #e74c3c;
	outline: none;
}

/* Ensure submit elements never inherit opacity filters from elsewhere */
.authica-form-overlay button,
.authica-form-overlay input[type="submit"]{
	opacity: 1 !important;
	filter: none !important;
	min-height: 24px !important;
}

/* Resetpass strength message (WordPress) */
.authica-resetpass-overlay #pass-strength-result,
.authica-resetpass-overlay #pass-strength-result.authica-form-text{
	color: var(--authica-form-text-color, #444444) !important;
	font-size: var(--authica-form-text-size, 17px) !important;
	font-weight: 400 !important;

	background: none !important;
	border: none !important;
	box-shadow: none !important;

	padding: 0 !important;
	min-height: 0 !important;
	margin: 0 0 16px 0 !important;

	display: block !important;
	text-align: center !important;

	pointer-events: none;
	user-select: none;

	line-height: 1.3 !important;
	letter-spacing: normal !important;

	text-shadow: 0 0 var(--authica-form-text-shadow-size, 0px) var(--authica-form-text-shadow-color, transparent) !important;
}


/* =========================================================
	10) Form cards (multi-form transitions)
   ========================================================= */

.authica-form-card{
	position: absolute;
	z-index: 0;

	display: none;
	opacity: 0;
	pointer-events: none;

	transition: opacity 0.4s cubic-bezier(.4,0,.2,1);
}

.authica-form-card.active{
	display: block;
	opacity: 1;
	pointer-events: auto;
	z-index: 2;
}

.authica-form-card.fading-out{
	opacity: 0 !important;
	pointer-events: none;
	z-index: 1;
}

/* Optional entrance */
.authica-form-card.anim-in{
	animation: authicaCardIn 0.5s;
}

@keyframes authicaCardIn{
	from{ transform: translateY(40px) scale(.97); opacity: 0; }
	to{ transform: translateY(0) scale(1); opacity: 1; }
}


/* =========================================================
	11) Error shake
   ========================================================= */

@keyframes authica-shake{
	0%{ transform: translate3d(0,0,0); }
	15%{ transform: translate3d(-12px,0,0); }
	30%{ transform: translate3d(12px,0,0); }
	45%{ transform: translate3d(-10px,0,0); }
	60%{ transform: translate3d(10px,0,0); }
	75%{ transform: translate3d(-6px,0,0); }
	90%{ transform: translate3d(6px,0,0); }
	100%{ transform: translate3d(0,0,0); }
}

.authica-shake{
	animation: authica-shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
	will-change: transform;
	backface-visibility: hidden;
}


/* =========================================================
	12) Password toggle
   ========================================================= */

.authica-password-wrap{
	position: relative;
}

.authica-password-wrap input{
	padding-right: 40px;
	height: 44px;
	font-size: 16px;
}

.authica-toggle-password{
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);

	display: flex;
	align-items: center;
	justify-content: center;

	cursor: pointer;

	width: auto;
	height: auto;

	color: #666;
	padding: 0;
	border: none;
	background: none;
	line-height: 1;
}

.authica-eye{
	width: 100%;
	height: 100%;
	display: block;
	transition: all 0.2s ease;
}

.authica-eye.eye-rotate{
	animation: eyeRotate 0.4s cubic-bezier(.7,-0.4,.6,1.2);
}

@keyframes eyeRotate{
	from{ transform: rotate(0deg); }
	to{ transform: rotate(360deg); }
}


/* =========================================================
	13) Remember me + 2FA remember device
   ========================================================= */

.authica-remember-device{
	margin-top: 8px;
	justify-content: center;
}

.authica-remember-device label{
	cursor: pointer;
}

.authica-remember-me{
	display: flex !important;
	align-items: center;
	justify-content: flex-start !important;

	width: 100%;
	margin-top: 0;
}

.authica-remember-me label{
	display: flex;
	align-items: center;
	gap: 6px;
}

.authica-remember-me.centered{
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;

	width: 100% !important;
	text-align: center !important;

	margin-left: 0 !important;
	margin-right: 0 !important;
}

.authica-remember-me input[type="checkbox"]{
	margin: 0;
	padding: 0;
	border: none;
	outline: none;
	box-shadow: none;
}

.authica-remember-me.authica-remember-hidden,
.authica-remember-me.centered.authica-remember-hidden,
.authica-remember-me[style*="display:none"]{
	display: none !important;
}


/* =========================================================
	14) Buttons + button text toggles
   ========================================================= */

.authica-btn-text.bold{ font-weight: bold; }
.authica-btn-text.italic{ font-style: italic; }
.authica-btn-text.underline{ text-decoration: underline; }

.authica-btn-wrap{
	display: block;
	width: 100%;
}

.authica-login-btn{
	display: inline-block;
	position: relative;

	border: none;
	border-radius: 40px;

	background: linear-gradient(90deg, #0099ff, #00ffaa);
	color: #fff;

	font-family: inherit;
	font-size: 2em;
	font-weight: normal;
	font-style: normal;
	text-decoration: none;

	line-height: normal;
	letter-spacing: normal;
	box-sizing: border-box;
}

.authica-btn-wrap .authica-login-btn{
	display: block;
	margin: 0 auto;
}

.authica-login-btn:disabled{
	filter: opacity(0.55) !important;
}

/* Submit button fallback (plain WP-style) */
.authica-form-overlay button{
	width: 100%;
	padding: initial;

	background-color: #0073aa;
	border: none;
	border-radius: 8px;

	color: #fff;
	cursor: pointer;

	transition: background 0.3s;
	font-size: 16px;
}

.authica-form-overlay button:hover{
	background-color: #005f8d;
}


/* =========================================================
	15) Inline links
   ========================================================= */

.authica-form-overlay a{
	display: inline-block;
	text-decoration: none;
}

.authica-inline-links{
	text-align: center;
	margin-top: 30px;
	color: #0073aa;
}

.authica-inline-links a{
	position: relative;
	text-decoration: underline;
	margin: 0 16px;
}


/* =========================================================
	16) Footer
   ========================================================= */

.authica-footer-bar{
	margin-top: auto;
	position: relative;
	flex: 0 0 auto;

	left: 0;
	right: 0;
	bottom: 0;

	width: 100vw;

	max-height: 100px;
	min-height: 10px;

	background: #222;
	color: #f8e9d2;

	z-index: 100;

	box-shadow: 0 -2px 18px rgba(0,0,0,0.10);

	/* Single source of truth */
	padding: 0;
	padding-bottom: calc(var(--authica-footer-pad, 16px) + env(safe-area-inset-bottom));
}

.authica-footer-row{
	display: flex;
	flex-direction: row;
	align-items: flex-end;

	width: 100%;
	max-width: 100vw;
	box-sizing: border-box;
	gap: 0;
}

/* Footer message: flexible, no forced alignment */
.authica-footer-message{
	display: block;

	margin-left: 24px !important;
	margin-right: 24px !important;

	word-break: break-word;

	flex: 1 1 0;
	min-width: 0;
}

.authica-footer-single .authica-footer-message{
	flex: 1 1 100%;
}

.authica-footer-row:not(.authica-footer-single) .authica-footer-message{
	flex: 1 1 50%;
}

/* Inherit font and color for children */
.authica-footer-message a,
.authica-footer-message strong,
.authica-footer-message em{
	font-family: inherit !important;
	font-size: inherit !important;
	color: inherit !important;
	text-align: inherit !important;

	display: inline-block !important;
	text-decoration: none;
}

.authica-footer-message *{
	text-align: inherit !important;
}

.authica-link{
	display: inline-block !important;
}


/* =========================================================
	17) Background + form entrance animations
   ========================================================= */

/* Pan Horizontal */
.authica-anim-pan-horizontal{
	animation: authicaPanHorizontal 30s linear infinite;
}

@keyframes authicaPanHorizontal{
	0%{ background-position: 100% center; }
	50%{ background-position: 0% center; }
	100%{ background-position: 100% center; }
}

/* Zoom (Ken Burns) */
.authica-anim-zoom::before{
	content: '';
	position: fixed;
	top: 0;
	left: 0;

	width: 100vw;
	height: 100vh;

	z-index: -1;

	background-image: inherit;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center center;

	transform: scale(1.05);
	animation: authicaZoomEffect 30s ease-in-out infinite alternate;
}

@keyframes authicaZoomEffect{
	from{ transform: scale(1.0); }
	to{ transform: scale(1.4); }
}

.authica-anim-zoom{
	background-size: 100%;
	animation: authicaZoom 20s ease-in-out infinite alternate;
}

@keyframes authicaZoom{
	from{ background-size: 100%; }
	to{ background-size: 120%; }
}

/* Pan */
.authica-anim-pan{
	background-position: 0% 40%;
	background-size: cover;
	animation: authicaPan 50s linear infinite alternate;
}

@keyframes authicaPan{
	from{ background-position: 0% 40%; }
	to{ background-position: 40% 0%; }
}

/* Gradient shift */
.authica-anim-gradient{
	background: linear-gradient(-45deg, #3b8d99, #6b6b83, #aa4b6b, #3b8d99);
	background-size: 800% 800%;
	animation: authicaGradient 30s ease-in-out infinite alternate;
}

@keyframes authicaGradient{
	0%{ background-position: 0% 50%; }
	50%{ background-position: 100% 50%; }
	100%{ background-position: 0% 50%; }
}

/* Form Slide Up */
.authica-anim-form-slideup .authica-form-overlay{
	transform: translateY(30px);
	opacity: 0;
	animation: authicaFormSlideUp .9s ease forwards;
}

@keyframes authicaFormSlideUp{
	to{
		transform: translateY(0);
		opacity: 1;
	}
}

/* Form Blur Fade */
.authica-anim-form-blur .authica-form-overlay{
	opacity: 0;
	filter: blur(15px);
	animation: authicaFormBlurFade 0.3s ease-out forwards;
}

@keyframes authicaFormBlurFade{
	to{
		opacity: 1;
		filter: blur(0);
	}
}

/* Shared Fade In (used by form + message bars) */
@keyframes authicaFadeIn{
	from{ opacity: 0; }
	to{ opacity: 1; }
}

/* Fade In */
.authica-anim-fade-in .authica-form-overlay{
	opacity: 0;
	animation: authicaFadeIn 0.4s ease-in-out forwards;
}

/* Fade Form */
.authica-anim-fade .authica-form-overlay{
	opacity: 0;
	animation: authicaFadeForm 1.5s ease-out forwards;

	backdrop-filter: inherit;
	-webkit-backdrop-filter: inherit;
}

@keyframes authicaFadeForm{
	from{ opacity: 0; }
	to{ opacity: 1; }
}

/* Short viewport height tweak (legacy selector kept) */
@media (max-height: 600px){
	.authica-wrapper{
		justify-content: flex-start;
		padding-top: 40px;
	}
}


/* =========================================================
	18) Message bars + captcha bar
   ========================================================= */

.authica-welcome-message{
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;

	font-family: Arial, sans-serif;
	font-size: 14px;

	will-change: opacity, transform;
}

.authica-hide{
	opacity: 0 !important;
	transition: opacity 1s cubic-bezier(.4,0,.2,1);
	will-change: opacity;
	pointer-events: none;
}

#authica-message-bar,
#authica-message-bar-below{
	margin: 0;
	padding: 8px 28px;

	border: none !important;
	text-align: center;

	min-width: 60px;
	max-width: 300px;
	width: auto !important;

	left: auto !important;

	min-height: 40px;
	height: auto;

	pointer-events: auto;
	will-change: opacity, transform;
}

/* CAPTCHA BAR */
.authica-captcha-bar,
.authica-captcha-bar-below{
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;

	line-height: 0;
	overflow: visible;

	/* JS controls top/left/width */
	left: auto !important;

	pointer-events: none;
	opacity: 0;

	transform-origin: top center;
	transition: opacity 0.35s ease-out;
	will-change: opacity;

	background: transparent;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	margin: 0;
}

.authica-captcha-bar.captcha-visible,
.authica-captcha-bar-below.captcha-visible{
	opacity: 1;
	pointer-events: auto;
}


/* =========================================================
	19) Welcome bar styles
   ========================================================= */

.authica-welcome-style-bubble{
	background: rgba(255,255,255,0.92);
	color: #444444;
	border-radius: 9px;
	font-weight: 500;
	box-shadow: var(--authica-form-shadow);
}

.authica-welcome-style-banner{
	background: linear-gradient(90deg, #0064e8 20%, #5fffdc 100%);
	color: #fff;
	border-radius: 0 0 18px 18px;
	font-weight: 500;
	box-shadow: var(--authica-form-shadow);
}

.authica-welcome-style-card{
	background: #fff;
	color: #444444;
	border-radius: 50px;
	box-shadow: var(--authica-form-shadow);
}

.authica-welcome-style-minimal{
	background: none;
	font-weight: 400;
	color: #444444 !important;

	border-radius: 0;

	text-shadow:
		0 4px 32px #fff,
		0 2px 16px #fff,
		0 0 8px #fff,
		0 0 4px #fff;

	box-shadow: none !important;
}


/* =========================================================
	20) Welcome bar entrance animations (ENTRANCE ONLY)
   ========================================================= */

.authica-welcome-anim-fade{
	animation: authicaFadeIn 0.6s ease-in-out forwards;
}

.authica-welcome-anim-slide{
	animation: authicaWelcomeSlideIn 1s forwards;
}

@keyframes authicaWelcomeSlideIn{
	from{ opacity: 0; transform: translateY(-48px); }
	to{ opacity: 1; transform: translateY(0); }
}

.authica-welcome-anim-zoom{
	animation: authicaWelcomeZoomIn 0.6s forwards;
}

@keyframes authicaWelcomeZoomIn{
	from{ opacity: 0; transform: scale(0.8); }
	to{ opacity: 1; transform: scale(1); }
}

.authica-welcome-anim-bounce{
	animation: authicaBounceIn 0.9s cubic-bezier(.23,1.24,.32,1) forwards;
}

@keyframes authicaBounceIn{
	0%{ opacity: 0; transform: translateY(40px) scale(0.97); }
	60%{ opacity: 1; transform: translateY(-12px) scale(1.04); }
	80%{ transform: translateY(4px) scale(0.98); }
	100%{ opacity: 1; transform: translateY(0) scale(1); }
}

.authica-welcome-anim-pulse{
	opacity: 0;
	animation: authicaPulseIn 0.7s cubic-bezier(.45,1.7,.6,1) forwards;
}

@keyframes authicaPulseIn{
	0%{ opacity: 0; transform: scale(0.92); }
	50%{ opacity: 1; transform: scale(1.04); }
	70%{ transform: scale(0.98); }
	100%{ opacity: 1; transform: scale(1); }
}


/* =========================================================
	21) Message bars – responsive
   ========================================================= */

@media (max-width: 540px){
	.authica-welcome-message{
		font-size: 1.1em;
		padding: 0.5em 1em;
	}

	.authica-welcome-style-toast{
		right: 12px;
		left: 12px;
		width: auto;
		max-width: 94vw;
	}

	.authica-welcome-style-overlay{
		min-width: 120px;
		padding: 1em 1.5em;
	}
}


/* =========================================================
	22) Fonts (variable mapping, resilient fallbacks)
	- Supports both old and new variable names
   ========================================================= */

.authica-root,
.authica-root *{
	font-family: var(--authica-font-family, system-ui), sans-serif;
	font-synthesis-weight: none;
	font-synthesis-style: none;
}

/* Title font */
.authica-title-text{
	font-family:
		var(--authica-title-font,
		var(--authica-font-family, system-ui)), sans-serif;
}

/* Form text font (supports --authica-form-text-font OR --authica-text-font) */
.authica-form-text,
.authica-form-links,
p.authica-remember-me,
p.authica-remember-me label{
	font-family:
		var(--authica-form-text-font,
		var(--authica-text-font,
		var(--authica-font-family, system-ui))), sans-serif;
}

/* Input font */
.authica-input,
.authica-form-overlay input,
.authica-register-overlay input,
.authica-lostpass-overlay input,
.authica-resetpass-overlay input,
.authica-2fa-overlay input{
	font-family:
		var(--authica-input-font,
		var(--authica-font-family, system-ui)), sans-serif;
}

/* Button font */
.authica-login-btn,
.authica-form-overlay button,
.authica-form-overlay input[type="submit"]{
	font-family:
		var(--authica-button-font,
		var(--authica-font-family, system-ui)), sans-serif;
}

/* Footer font */
.authica-footer-bar{
	font-family:
		var(--authica-footer-font,
		var(--authica-font-family, system-ui)), sans-serif;
}
