/* ═══ Ratapihan Portaali – kirjautuminen, rekisteröinti ja salasanan palautus ═══
   Sama tumma ilme kuin työpöytä- ja mobiiliportaalissa: keltainen logo-kiila, lasikortti, keltainen pääpainike. */
@font-face { font-family: "NunitoRegular"; font-weight: 200 1000; font-display: swap; src: url("fonts/nunito-latin-wght-normal.woff2") format("woff2"); }

:root {
	--bg: #242933;
	--card: rgba(46, 52, 64, .78);
	--line: rgba(255, 255, 255, .09);
	--line2: rgba(255, 255, 255, .16);
	--text: #ECEFF4;
	--muted: #A7B0C0;
	--yellow: #A3BE8C;
	--blue: #81A1C1;
	--green: #A3BE8C;
	--red: #BF616A;
	--safe-t: env(safe-area-inset-top, 0px);
	--safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); height: 100%; overscroll-behavior: none; }
body {
	margin: 0;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: calc(92px + var(--safe-t)) 16px calc(24px + var(--safe-b));
	font-family: "Nunito", "NunitoRegular", system-ui, sans-serif;
	color: var(--text);
	background: var(--bg);
	position: relative;
	overflow-x: hidden;
}
button, input { font-family: inherit; }

/* Tausta: rata-/korjaamokuva sumennettuna + tumma verho + keltainen hehku */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(640px 420px at 50% 42%, rgba(163, 190, 140, .10), transparent 70%),
		linear-gradient(180deg, rgba(36, 41, 51, .72), rgba(36, 41, 51, .9));
}

/* CarNord-logo vasempaan yläkulmaan */
.auth-brand {
	position: fixed;
	top: var(--safe-t);
	left: 0;
	z-index: 5;
	height: 72px;
	padding: 0 24px;
	display: flex;
	align-items: center;
}
.auth-brand img { height: 40px !important; display: block; animation: logoIn .5s .22s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes logoIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

/* Kortti */
.login-box {
	position: relative;
	width: 100%;
	max-width: 400px;
	padding: 26px 22px 22px;
	border-radius: 24px;
	background: var(--card);
	border: 1px solid var(--line2);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
	-webkit-backdrop-filter: blur(18px) saturate(1.2);
	backdrop-filter: blur(18px) saturate(1.2);
	display: flex;
	flex-direction: column;
	gap: 14px;
	animation: cardIn .55s .1s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
.login-box::before {
	/* ohut keltainen kiila kortin yläkulmassa */
	content: "";
	position: absolute;
	top: 0;
	left: 22px;
	width: 64px;
	height: 4px;
	border-radius: 0 0 4px 4px;
	background: var(--yellow);
	clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}

/* Vanha logo-rivi piiloon (logo on nyt yläkulman kiilassa) */

.login-box h2 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -.3px; color: #fff; }
.info-text { margin: -4px 0 2px; font-size: 14px; font-weight: 600; line-height: 1.5; color: #C2C9D6; }

/* Kentät */
.login-box input {
	width: 100%;
	height: 52px;
	padding: 0 14px;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, .18);
	background: rgba(0, 0, 0, .38);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	outline: none;
	transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.login-box input::placeholder { color: #6C7689; font-weight: 600; }
.login-box input:hover { border-color: rgba(255, 255, 255, .3); }
.login-box input:focus { border-color: var(--blue); background: rgba(0, 0, 0, .5); box-shadow: 0 0 0 3px rgba(129, 161, 193, .25); }
.login-box input:-webkit-autofill {
	-webkit-text-fill-color: #fff;
	-webkit-box-shadow: 0 0 0 100px #1b1d21 inset;
	caret-color: #fff;
}

/* Pääpainike (keltainen kuten portaaleissa) */
.login-box > button, #resetBtn {
	position: relative;
	overflow: hidden;
	height: 54px;
	margin-top: 4px;
	border: 0;
	border-radius: 16px;
	background: var(--yellow);
	color: #242933;
	font-size: 17px;
	font-weight: 900;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	box-shadow: 0 10px 26px rgba(163, 190, 140, .28);
	transition: transform .12s ease, filter .15s ease, box-shadow .2s ease;
}
.login-box > button:hover, #resetBtn:hover { filter: brightness(1.06); box-shadow: 0 12px 30px rgba(163, 190, 140, .38); }
.login-box > button:active { transform: scale(.985); }

/* Latausanimaatio: ratapölkyt liikkuvat painikkeen alareunassa */

/* Linkit */
.forgot-link {
	font-size: 14px;
	font-weight: 700;
	color: #C2C9D6;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	transition: color .15s ease;
}
.forgot-link:hover { color: var(--yellow); }
.forgot-link b { color: var(--yellow); font-weight: 800; }
.login-box > .forgot-link { align-self: center; }

/* Ilmoitus */
.toast {
	position: fixed;
	left: 50%;
	top: auto;
	bottom: calc(24px + var(--safe-b));
	z-index: 50;
	max-width: calc(100% - 32px);
	padding: 12px 16px 12px 14px;
	border-radius: 14px;
	border: 1px solid var(--line2) !important;
	border-left: 4px solid var(--red) !important;
	background: #3B4252 !important;
	color: #fff;
	font-size: 14px;
	font-weight: 800;
	box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 12px);
	transition: opacity .25s ease, transform .25s ease;
}
.toast.ok { border-left-color: var(--green) !important; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 480px) {
	body { justify-content: flex-start; padding-top: calc(80px + var(--safe-t)); padding-bottom: calc(12px + var(--safe-b)); }
	.login-box { gap: 12px; }
	.login-box { padding: 24px 18px 20px; }
	.auth-brand { height: 60px; }
	.auth-brand img { height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .auth-brand, .auth-brand img, .login-box { animation: none; } }
@media (max-width: 480px) {
	.login-box h2 { font-size: 24px; }
	.login-box input { height: 48px; }
}

.auth-foot { margin: 22px auto 0; color: #7B8598; font-size: 13px; font-weight: 700; text-align: center; }
