/* Sandbox visual refresh for the login/front screen only.
   Scoped to .login-wrap so the test-taking screens keep their original look/behavior. */

/* Top bar ticker - only injected into #msgdiv while the login screen is shown (see space-bg.js).
   The moment test_mini.js writes a real status message into #msgdiv, this is naturally replaced. */
.login-ticker-track {
	display: inline-block;
	white-space: nowrap;
	padding-left: 100%;
	font-size: 13px;
	font-weight: 600;
	color: #0d9488;
	animation: tickerScroll 22s linear infinite;
}

@keyframes tickerScroll {
	from { transform: translateX(0); }
	to { transform: translateX(-100%); }
}

.login-wrap {
	font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 640px;
	padding: 40px 20px;
	background:
		radial-gradient(ellipse at 25% 20%, rgba(15, 118, 110, 0.9) 0%, transparent 55%),
		radial-gradient(ellipse at 78% 25%, rgba(76, 29, 149, 0.85) 0%, transparent 50%),
		radial-gradient(ellipse at 50% 90%, rgba(6, 95, 70, 0.9) 0%, transparent 55%),
		linear-gradient(160deg, #021b16 0%, #01120d 60%, #010806 100%);
	border-radius: 18px;
	box-sizing: border-box;
	overflow: hidden;
	perspective: 1200px;
}

.login-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}

@keyframes loginWrapIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes loginCardIn {
	from { opacity: 0; transform: translateY(46px) scale(0.9); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes loginFadeUp {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: translateY(0); }
}

.login-wrap {
	animation: loginWrapIn 0.5s ease both;
}

.login-card {
	position: relative;
	z-index: 2;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(4, 40, 30, 0.4);
	padding: 48px 56px 32px;
	max-width: 480px;
	width: 100%;
	text-align: center;
	box-sizing: border-box;
	animation: loginCardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-card .logo {
	width: 96px;
	height: auto;
	margin-bottom: 8px;
	animation: loginFadeUp 0.5s ease both;
	animation-delay: 0.22s;
}

.login-title,
.login-subtitle,
.login-updated,
.login-flags,
.login-quote,
.login-warning,
.login-wordmark,
.login-credit {
	animation: loginFadeUp 0.5s ease both;
}

.login-title { animation-delay: 0.12s; }
.login-subtitle { animation-delay: 0.3s; }
.login-updated { animation-delay: 0.36s; }
.login-flags { animation-delay: 0.44s; }
.login-quote { animation-delay: 0.54s; }
.login-warning { animation-delay: 0.62s; }
.login-wordmark { animation-delay: 0.68s; }
.login-credit { animation-delay: 0.74s; }

@media (prefers-reduced-motion: reduce) {
	.login-wrap,
	.login-card,
	.login-card .logo,
	.login-title,
	.login-subtitle,
	.login-updated,
	.login-flags,
	.login-quote,
	.login-warning,
	.login-wordmark,
	.login-credit {
		animation: none;
	}
}

.login-title {
	font-family: inherit;
	font-size: 26px;
	font-weight: 600;
	color: #065f46;
	margin: 12px 0 6px;
	letter-spacing: 0.2px;
}

.login-subtitle {
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	color: #475569;
	margin: 0 0 4px;
}

.login-updated {
	font-family: inherit;
	font-size: 12px;
	color: #94a3b8;
	margin: 0 0 26px;
}

.login-flags {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 16px;
	margin-bottom: 32px;
}

.login-flag {
	width: 84px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	cursor: pointer;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	overflow: hidden;
}

.login-flag img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
}

.login-flag:hover {
	transform: translateY(-3px) scale(1.04);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

.login-footer {
	border-top: 1px solid #e5e8f0;
	padding-top: 18px;
	margin-top: 4px;
}

.login-quote {
	position: relative;
	overflow: hidden;
	margin-bottom: 16px;
	padding: 18px 20px 18px 28px;
	border-radius: 16px;
	text-align: left;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.2));
	border: 1px solid rgba(255, 255, 255, 0.55);
	box-shadow: 0 8px 24px rgba(6, 95, 70, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(14px) saturate(160%);
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.login-quote::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.5), transparent 55%);
	pointer-events: none;
}

.login-quote:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 36px rgba(6, 95, 70, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-quote-bar {
	position: absolute;
	left: 9px;
	top: 14px;
	bottom: 14px;
	width: 3px;
	border-radius: 3px;
	background: linear-gradient(180deg, #34d399, #0d9488);
}

.login-quote-mark {
	position: absolute;
	top: -12px;
	right: 10px;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 64px;
	font-weight: 700;
	line-height: 1;
	color: rgba(13, 148, 136, 0.2);
	pointer-events: none;
	z-index: 0;
}

.login-quote-glow {
	position: absolute;
	inset: -50%;
	background: radial-gradient(200px circle at var(--gx, 50%) var(--gy, 20%), rgba(45, 212, 191, 0.55), rgba(45, 212, 191, 0) 60%);
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
	z-index: 0;
}

.login-quote:hover .login-quote-glow {
	opacity: 1;
}

.login-quote-text {
	position: relative;
	z-index: 1;
	margin: 0 0 10px;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 14.5px;
	font-style: italic;
	line-height: 1.55;
	color: #064e3b;
}

.login-quote-author {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin: 0;
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	color: #0d9488;
}

.login-quote-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, #34d399, #0d9488);
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
}

.login-warning {
	font-family: inherit;
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: #dc2626;
	text-shadow: 0 0 14px rgba(220, 38, 38, 0.45);
	margin-bottom: 18px;
}

.login-wordmark {
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 1px;
	color: #065f46;
}

.login-wordmark .accent {
	color: #0d9488;
}

.login-credit {
	font-family: inherit;
	font-size: 12px;
	color: #9aa3b5;
	margin-top: 4px;
}

/* Tablet / phone portrait (matches the breakpoint responsive.css already uses) */
@media (max-width: 768px) {
	.login-wrap {
		min-height: calc(100vh - 60px);
		padding: 28px 14px;
	}
	.login-card {
		max-width: 420px;
		padding: 32px 22px 22px;
	}
	.login-card .logo {
		width: 76px;
	}
	.login-title {
		font-size: 21px;
		margin: 10px 0 6px;
	}
	.login-subtitle {
		font-size: 13px;
	}
	.login-updated {
		font-size: 11px;
		margin-bottom: 20px;
	}
	.login-flags {
		gap: 10px;
		margin-bottom: 22px;
	}
	.login-flag {
		width: 68px;
		height: 40px;
	}
	.login-quote {
		padding: 14px 16px 14px 22px;
	}
	.login-quote-text {
		font-size: 13px;
	}
	.login-quote-mark {
		font-size: 48px;
	}
	.login-warning {
		font-size: 14px;
	}
}

/* Narrow phones */
@media (max-width: 380px) {
	.login-card {
		padding: 26px 16px 18px;
	}
	.login-title {
		font-size: 19px;
	}
	.login-flag {
		width: 58px;
		height: 34px;
	}
	.login-flags {
		gap: 8px;
	}
}

/* Phones in landscape (short viewport height) - keep the whole card on screen without scrolling */
@media (max-height: 480px) and (orientation: landscape) {
	.login-wrap {
		min-height: calc(100vh - 40px);
		padding: 14px;
	}
	.login-card {
		padding: 16px 26px;
	}
	.login-card .logo {
		width: 52px;
		margin-bottom: 2px;
	}
	.login-title {
		font-size: 18px;
		margin: 4px 0 4px;
	}
	.login-subtitle {
		font-size: 12px;
		margin-bottom: 2px;
	}
	.login-updated {
		font-size: 10px;
		margin-bottom: 12px;
	}
	.login-flags {
		margin-bottom: 12px;
	}
	.login-footer {
		padding-top: 10px;
	}
}

/* Respect the notch / Dynamic Island safe areas on the login screen too */
@supports (padding: max(0px)) {
	.login-wrap {
		padding-left: max(14px, env(safe-area-inset-left));
		padding-right: max(14px, env(safe-area-inset-right));
		padding-bottom: max(28px, env(safe-area-inset-bottom));
	}
}
