/*
 * Ecranul de autentificare IT4All.
 *
 * Fundalul: campul de particule preluat din pagina animata a it4all.ro. Canvas-ul
 * deseneaza reteaua, ".it4all-veil" adauga vignetarea care da adancime, iar
 * ".it4all-grain" o granulatie fina care rupe benzile din gradiente.
 *
 * Formularul: panou de sticla deasupra campului. Selectorii sunt cei reali generati
 * de roundcube - butonul este "button.mainaction.submit", NU ".btn-primary"; cine
 * stilizeaza .btn-primary nu vede nicio schimbare pe ecranul de login.
 *
 * Accesibilitate: la "prefers-reduced-motion" campul si animatiile dispar, iar
 * formularul ramane complet utilizabil - de-aia contrastul lui nu depinde de canvas.
 */

/* ---------------------------------------------------------------- fundal --- */

body.task-login {
	background: #03040a;
	overflow: hidden;
}

body.task-login #it4all-field {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	z-index: 0;
}

body.task-login .it4all-veil {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	background: radial-gradient(120% 90% at 50% 45%, transparent 35%, rgba(3, 4, 10, .55) 78%, rgba(3, 4, 10, .92) 100%);
}

body.task-login .it4all-grain {
	position: fixed;
	inset: -50%;
	pointer-events: none;
	z-index: 2;
	opacity: .05;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
	animation: it4allDrift 6s steps(6) infinite;
}

@keyframes it4allDrift {
	0%   { transform: translate(0, 0) }
	20%  { transform: translate(-3%, 2%) }
	40%  { transform: translate(2%, -3%) }
	60%  { transform: translate(-2%, -2%) }
	80%  { transform: translate(3%, 1%) }
	100% { transform: translate(0, 0) }
}

/* ------------------------------------------------------------ asezare --- */

body.task-login #layout,
body.task-login #layout-content,
body.task-login .content,
body.task-login #layout > .content {
	position: relative;
	z-index: 3;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

body.task-login #layout-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 2rem 1.25rem;
}

@keyframes it4allRise {
	from { opacity: 0; transform: translateY(1.5rem) scale(.98) }
	to   { opacity: 1; transform: none }
}

/* ---------------------------------------------------------------- logo --- */

body.task-login #logo {
	max-width: 250px;
	width: 72vw;
	height: auto;
	margin: 0 0 1.75rem;
	filter: drop-shadow(0 8px 30px rgba(34, 211, 238, .30));
	animation: it4allRise 1s cubic-bezier(.16, 1, .3, 1) both;
}

/* ------------------------------------------------------ panoul de sticla --- */

body.task-login #login-form {
	position: relative;
	width: 100%;
	max-width: 26rem;
	padding: 2.1rem 2rem 1.6rem;
	background: linear-gradient(165deg, rgba(18, 26, 46, .72), rgba(9, 14, 28, .66));
	backdrop-filter: blur(18px) saturate(1.25);
	-webkit-backdrop-filter: blur(18px) saturate(1.25);
	border: 1px solid rgba(150, 196, 255, .16);
	border-radius: 20px;
	box-shadow:
		0 30px 80px rgba(0, 0, 0, .6),
		0 0 0 1px rgba(255, 255, 255, .035) inset,
		0 1px 0 rgba(255, 255, 255, .07) inset;
	animation: it4allRise 1s cubic-bezier(.16, 1, .3, 1) .1s both;
}

/* Linie de lumina pe muchia de sus, ca panoul sa nu para o cutie plata. */
body.task-login #login-form::before {
	content: "";
	position: absolute;
	top: -1px; left: 12%; right: 12%;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .75), rgba(99, 102, 241, .55), transparent);
}

/* ------------------------------------------------------------- campuri --- */

body.task-login #login-form table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
}

/* Eticheta si campul se aseaza unul sub altul, nu pe coloane. */
body.task-login #login-form table tr,
body.task-login #login-form table td {
	display: block;
	width: 100%;
}

body.task-login #login-form td.title {
	padding: 0 0 .4rem 2px;
}

body.task-login #login-form td.title label {
	font-size: .68rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #8ea2c9;
}

body.task-login #login-form td.input {
	padding: 0 0 1.15rem;
}

body.task-login #login-form input.form-control {
	width: 100%;
	height: 3rem;
	padding: 0 1rem;
	font-size: .97rem;
	color: #eef3ff;
	background: rgba(5, 9, 18, .68);
	border: 1px solid rgba(150, 196, 255, .18);
	border-radius: 11px;
	outline: 0;
	transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

body.task-login #login-form input.form-control::placeholder { color: #6f7d9c }

body.task-login #login-form input.form-control:hover {
	border-color: rgba(150, 196, 255, .3);
}

body.task-login #login-form input.form-control:focus {
	background: rgba(5, 9, 18, .85);
	border-color: rgba(34, 211, 238, .8);
	box-shadow: 0 0 0 3px rgba(34, 211, 238, .15), 0 0 26px rgba(34, 211, 238, .12);
}

/* Completarea automata a browserului nu are voie sa readuca fundalul alb. */
body.task-login #login-form input:-webkit-autofill,
body.task-login #login-form input:-webkit-autofill:focus {
	-webkit-text-fill-color: #eef3ff;
	-webkit-box-shadow: 0 0 0 1000px rgba(5, 9, 18, .95) inset;
	caret-color: #eef3ff;
}

/* -------------------------------------------------------------- buton --- */

body.task-login #login-form p.formbuttons {
	margin: .35rem 0 0;
}

body.task-login #login-form button.mainaction,
body.task-login #login-form button#rcmloginsubmit,
body.task-login #login-form .button.mainaction {
	position: relative;
	display: block;
	width: 100%;
	height: 3.05rem;
	border: 0;
	border-radius: 11px;
	cursor: pointer;
	overflow: hidden;
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: #04121a;
	background: linear-gradient(100deg, #22d3ee 0%, #4f8cf5 52%, #8b5cf6 100%);
	background-size: 200% auto;
	box-shadow: 0 10px 30px rgba(34, 211, 238, .28), 0 2px 0 rgba(255, 255, 255, .25) inset;
	transition: background-position .5s ease, transform .14s ease, box-shadow .2s ease;
}

body.task-login #login-form button.mainaction:hover {
	background-position: right center;
	transform: translateY(-2px);
	box-shadow: 0 16px 38px rgba(34, 211, 238, .38), 0 2px 0 rgba(255, 255, 255, .3) inset;
}

body.task-login #login-form button.mainaction:active {
	transform: translateY(0);
	box-shadow: 0 6px 18px rgba(34, 211, 238, .3);
}

body.task-login #login-form button.mainaction:focus-visible {
	outline: 2px solid rgba(255, 255, 255, .85);
	outline-offset: 3px;
}

/* Reflexie care traverseaza butonul la hover. */
body.task-login #login-form button.mainaction::after {
	content: "";
	position: absolute;
	top: 0; bottom: 0; left: -60%;
	width: 45%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
	transform: skewX(-18deg);
	transition: left .55s ease;
}

body.task-login #login-form button.mainaction:hover::after { left: 125% }

/* -------------------------------------------------------------- subsol --- */

body.task-login #login-footer {
	margin-top: 1.5rem;
	padding-top: 1.1rem;
	border-top: 1px solid rgba(150, 196, 255, .1);
	text-align: center;
	font-size: .76rem;
	letter-spacing: .04em;
	color: #7f8dae;
}

body.task-login #login-footer a,
body.task-login #login-footer a.support-link {
	color: #9fb2d8;
	text-decoration: none;
	transition: color .15s ease;
}

body.task-login #login-footer a:hover { color: #22d3ee }

/* ------------------------------------------------------------- mesaje --- */

body.task-login .ui.alert,
body.task-login #messagestack > div {
	background: rgba(26, 12, 22, .88) !important;
	color: #ffd9de !important;
	border: 1px solid rgba(251, 113, 133, .45) !important;
	border-radius: 12px;
	backdrop-filter: blur(12px);
	box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
}

body.task-login #messagestack > div.confirmation {
	background: rgba(8, 26, 24, .88) !important;
	color: #c8fff2 !important;
	border-color: rgba(34, 211, 238, .45) !important;
}

/* ---------------------------------------------------------- ecran mic --- */

@media (max-width: 30rem) {
	body.task-login #login-form { padding: 1.7rem 1.35rem 1.3rem; border-radius: 16px }
	body.task-login #logo { margin-bottom: 1.35rem }
}

/* ------------------------------------------------- miscare redusa --- */

@media (prefers-reduced-motion: reduce) {
	body.task-login #it4all-field,
	body.task-login .it4all-grain { display: none }
	body.task-login #logo,
	body.task-login #login-form { animation: none }
	body.task-login #login-form button.mainaction::after { display: none }
	body.task-login #login-form button.mainaction:hover { transform: none }
}
