/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* ── Brand face ──────────────────────────────────────────────────────────── */
/* The A·T·L·A·S wordmark is DejaVu Sans ExtraLight (brand decision 2026-09-10).
   Embedded so every platform renders the same face; Latin subset, ~15 KB.
   Licence: /assets/fonts/LICENSE-DejaVu.txt (Bitstream Vera + Arev, free). */
@font-face {
	font-family: 'Atlas Brand';
	src: url('../assets/fonts/DejaVuSans-ExtraLight-latin.woff2') format('woff2');
	font-weight: 200;
	font-style: normal;
	font-display: swap;
}

/* ── Design tokens ───────────────────────────────────────────────────────── */
:root {
	--bg-deep:           #060d1a;
	--bg-mid:            #050d1c;
	--card-bg:           rgba(8, 22, 42, 0.72);
	--card-border:       rgba(74, 140, 210, 0.18);
	--input-bg:          rgba(255, 255, 255, 0.04);
	--input-border:      rgba(74, 140, 210, 0.20);
	--input-focus:       rgba(74, 160, 220, 0.55);
	--input-text:        #d0e8ff;
	--input-placeholder: rgba(150, 190, 230, 0.25);
	--label-color:       #5e8fb5;
	--btn-from:          #1a5f9e;
	--btn-to:            #0f3d6b;
	--btn-hover-from:    #2070b8;
	--btn-hover-to:      #154d82;
	--btn-border:        rgba(74, 160, 220, 0.30);
	--btn-text:          #c8e4ff;
	--link-color:        #3d7aad;
	--link-hover:        #6eb3e8;
	--atlas-text:        #e8f4ff;
	--atlas-dot:         #4da6e8;
	--tagline-color:     #6899c0;
	--logo-filter:       opacity(0.55);
	--hw-hyperion:       rgba(255, 255, 255, 0.55);
	--hw-works:          rgba(255, 206, 9, 0.65);
	--error-bg:          rgba(160, 40, 40, 0.18);
	--error-border:      rgba(220, 80, 80, 0.30);
	--error-text:        #e88888;
	--success-bg:        rgba(30, 100, 60, 0.20);
	--success-border:    rgba(60, 180, 100, 0.30);
	--success-text:      #6ee09a;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
html, body {
	width: 100%;
	min-height: 100%;
}

body {
	background: var(--bg-deep);
	font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

/* ── Scene (full-viewport background) ───────────────────────────────────── */
.scene {
	position: relative;
	width: 100%;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 16px;
	background: radial-gradient(
		ellipse at 60% 40%,
		#0a2545 0%,
		#050d1c 55%,
		#020609 100%
	);
	overflow: hidden;
}

/* ── Star field ──────────────────────────────────────────────────────────── */
.stars {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.star {
	position: absolute;
	border-radius: 50%;
	background: #ffffff;
	animation: twinkle var(--d, 3s) ease-in-out infinite;
	animation-delay: var(--delay, 0s);
	opacity: var(--op, 0.5);
}

@keyframes twinkle {
	0%, 100% { opacity: var(--op, 0.5); transform: scale(1); }
	50%       { opacity: 0.1;           transform: scale(0.6); }
}

/* ── Nebula wisps ────────────────────────────────────────────────────────── */
.nebula {
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
}

.nebula-1 {
	width: 400px; height: 250px;
	background: #1a5f9e;
	top: 10%; left: 5%;
	filter: blur(60px);
	opacity: 0.12;
}

.nebula-2 {
	width: 300px; height: 200px;
	background: #0e3d6b;
	bottom: 15%; right: 20%;
	filter: blur(60px);
	opacity: 0.12;
}

.nebula-3 {
	width: 200px; height: 300px;
	background: #163d5c;
	top: 30%; left: 30%;
	filter: blur(60px);
	opacity: 0.08;
}

/* ── CSS Globe ───────────────────────────────────────────────────────────── */
.globe-container {
	position: absolute;
	right: -5%;
	top: 50%;
	transform: translateY(-50%);
	width: 70vmin;
	height: 70vmin;
	opacity: 0.22;
	pointer-events: none;
}

.globe {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: radial-gradient(
		circle at 35% 30%,
		#1a4a7a 0%,
		#0d2d52 30%,
		#071525 60%,
		#020a14 100%
	);
	box-shadow:
		inset -30px -20px 60px rgba(0, 0, 0, 0.8),
		inset  20px  15px 40px rgba(30, 100, 160, 0.3),
		0 0  80px rgba(20,  80, 140, 0.4),
		0 0 160px rgba(10,  50, 100, 0.2);
	position: relative;
	overflow: hidden;
}

.globe::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: radial-gradient(
		circle at 30% 25%,
		rgba(80, 160, 220, 0.25) 0%,
		transparent 55%
	);
}

.globe::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: radial-gradient(
		circle at 70% 70%,
		rgba(0, 0, 0, 0.6) 0%,
		transparent 50%
	);
}

@media (max-width: 600px) {
	.globe-container { display: none; }
}

/* ── Login wrapper ───────────────────────────────────────────────────────── */
.login-wrapper {
	position: relative;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 36px;
	width: 100%;
	max-width: 420px;
	animation: fadeUp 0.85s ease both;
}

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

/* ── Atlas logotype ──────────────────────────────────────────────────────── */
.atlas-heading {
	text-align: center;
}

.atlas-title {
	display: block;
	letter-spacing: 0.35em;
	font-size: clamp(28px, 8vw, 52px);
	font-weight: 200;
	color: var(--atlas-text);
	font-family: 'Atlas Brand', 'DejaVu Sans', 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
	line-height: 1;
}

.atlas-title .dot {
	color: var(--atlas-dot);
	font-weight: 300;
	margin: 0 0.06em;
}

.atlas-tagline {
	display: block;
	margin-top: 10px;
	letter-spacing: 0.28em;
	font-size: clamp(8px, 2.2vw, 12px);
	font-weight: 300;
	color: var(--tagline-color);
	font-family: 'Atlas Brand', 'DejaVu Sans', 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
	text-transform: uppercase;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.login-card {
	width: 100%;
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: 16px;
	padding: clamp(24px, 6vw, 40px);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.04) inset,
		0 32px 64px rgba(0, 0, 0, 0.5),
		0 0 40px rgba(20, 80, 150, 0.08);
}

/* ── Form fields ─────────────────────────────────────────────────────────── */
.lp-field {
	margin-bottom: 20px;
}

.lp-field label {
	display: block;
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--label-color);
	margin-bottom: 8px;
	font-weight: 400;
}

.lp-field input {
	display: block;
	width: 100%;
	background: var(--input-bg);
	border: 1px solid var(--input-border);
	border-radius: 8px;
	padding: 12px 16px;
	font-size: 15px;
	color: var(--input-text);
	outline: none;
	transition: border-color 0.2s, background 0.2s;
	font-family: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.lp-field input::placeholder {
	color: var(--input-placeholder);
}

.lp-field input:focus {
	border-color: var(--input-focus);
	background: rgba(255, 255, 255, 0.07);
}

/* ── 2FA code input ──────────────────────────────────────────────────────── */
.twofa-code-field input {
	text-align: center;
	font-size: 28px;
	letter-spacing: 8px;
	font-weight: 300;
	color: var(--atlas-text);
}

/* ── Remember / checkbox row ─────────────────────────────────────────────── */
.lp-remember-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 28px;
}

.lp-remember-row input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--atlas-dot);
	cursor: pointer;
	flex-shrink: 0;
}

.lp-remember-row label {
	font-size: 13px;
	color: var(--label-color);
	cursor: pointer;
	letter-spacing: 0.02em;
	user-select: none;
}

/* ── Sign in / Verify button ─────────────────────────────────────────────── */
.btn-login {
	display: block;
	width: 100%;
	padding: 14px;
	background: linear-gradient(135deg, var(--btn-from) 0%, var(--btn-to) 100%);
	border: 1px solid var(--btn-border);
	border-radius: 8px;
	color: var(--btn-text);
	font-size: 13px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-weight: 400;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, transform 0.15s;
	font-family: 'Atlas Brand', 'DejaVu Sans', 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}

.btn-login:hover {
	background: linear-gradient(135deg, var(--btn-hover-from) 0%, var(--btn-hover-to) 100%);
	border-color: rgba(74, 160, 220, 0.55);
	transform: translateY(-1px);
}

.btn-login:active {
	transform: translateY(0) scale(0.99);
}

.btn-login:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* ── Footer links ────────────────────────────────────────────────────────── */
.lp-card-footer {
	display: flex;
	justify-content: space-between;
	margin-top: 20px;
	flex-wrap: wrap;
	gap: 8px;
}

.lp-card-footer a {
	font-size: 12px;
	color: var(--link-color);
	text-decoration: none;
	letter-spacing: 0.04em;
	transition: color 0.2s;
}

.lp-card-footer a:hover {
	color: var(--link-hover);
}

/* ── 2FA panel typography ────────────────────────────────────────────────── */
.lp-panel-title {
	font-size: 1.15rem;
	font-weight: 400;
	color: var(--atlas-text);
	margin-bottom: 6px;
	letter-spacing: 0.05em;
}

.lp-panel-subtitle {
	font-size: 0.875rem;
	color: var(--label-color);
	margin-bottom: 20px;
	letter-spacing: 0.02em;
}

/* ── 2FA method buttons ──────────────────────────────────────────────────── */
.twofa-method-btns {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
}

/* ── Inline message containers ───────────────────────────────────────────── */
#login-message,
#twofa-message {
	margin-bottom: 12px;
}

/* TemplateHelper.render('tpl-error-msg') injects .error-message divs */
.error-message {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: var(--error-bg);
	border: 1px solid var(--error-border);
	border-radius: 8px;
	font-size: 13px;
	color: var(--error-text);
	letter-spacing: 0.02em;
}

.success-message {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: var(--success-bg);
	border: 1px solid var(--success-border);
	border-radius: 8px;
	font-size: 13px;
	color: var(--success-text);
	letter-spacing: 0.02em;
}

/* ── Hyperion Works branding ─────────────────────────────────────────────── */
.hyperion-logo {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	opacity: 0.7;
	animation: fadeUp 1.1s ease both;
	animation-delay: 0.3s;
}

.hw-mark {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #0d1f3c;
	border: 1px solid rgba(74, 140, 210, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.hw-mark img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: var(--logo-filter);
}

.hw-wordmark {
	font-family: 'Atlas Brand', 'DejaVu Sans', 'Gill Sans MT', Calibri, sans-serif;
	font-weight: 100;
	font-size: 10px;
	letter-spacing: 0.22em;
	line-height: 1;
}

.hw-hyperion { color: var(--hw-hyperion); }
.hw-works    { color: var(--hw-works); }

/* ── lp-btn (generic dark-theme button for modals / 2FA method select) ───── */
.lp-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	border-radius: 8px;
	font-size: 13px;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s;
	font-family: inherit;
	border: 1px solid transparent;
	-webkit-appearance: none;
	appearance: none;
}

.lp-btn-primary {
	background: linear-gradient(135deg, var(--btn-from) 0%, var(--btn-to) 100%);
	border-color: var(--btn-border);
	color: var(--btn-text);
}

.lp-btn-primary:hover {
	background: linear-gradient(135deg, var(--btn-hover-from) 0%, var(--btn-hover-to) 100%);
	border-color: rgba(74, 160, 220, 0.55);
}

.lp-btn-secondary {
	background: rgba(255, 255, 255, 0.05);
	border-color: rgba(74, 140, 210, 0.20);
	color: var(--input-text);
}

.lp-btn-secondary:hover {
	background: rgba(74, 140, 210, 0.12);
	border-color: var(--input-focus);
}

/* ── Modals ──────────────────────────────────────────────────────────────── */
.lp-modal {
	display: none;
	position: fixed;
	z-index: 1050;
	inset: 0;
	overflow-y: auto;
	background: rgba(2, 6, 14, 0.75);
	backdrop-filter: blur(4px);
}

.lp-modal.show {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.lp-modal-dialog {
	width: 100%;
	max-width: 480px;
	animation: fadeUp 0.2s ease both;
}

.lp-modal-content {
	background: rgba(8, 22, 42, 0.92);
	border: 1px solid var(--card-border);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
}

.lp-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px 16px;
	border-bottom: 1px solid rgba(74, 140, 210, 0.12);
}

.lp-modal-title {
	font-size: 1rem;
	font-weight: 400;
	color: var(--atlas-text);
	letter-spacing: 0.05em;
}

.lp-modal-close {
	background: transparent;
	border: none;
	color: var(--label-color);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	transition: color 0.2s;
}

.lp-modal-close:hover {
	color: var(--atlas-text);
}

.lp-modal-body {
	padding: 20px 24px;
	color: var(--input-text);
	font-size: 14px;
	line-height: 1.6;
}

.lp-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 24px 20px;
	border-top: 1px solid rgba(74, 140, 210, 0.12);
}

/* ── Selection lists (org/app) ───────────────────────────────────────────── */
.lp-selection-list {
	max-height: 380px;
	overflow-y: auto;
}

/* selection items injected by TemplateHelper */
.organization-item,
.app-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 0;
	border-bottom: 1px solid rgba(74, 140, 210, 0.10);
	cursor: pointer;
	transition: color 0.15s;
	color: var(--input-text);
	font-size: 14px;
}

.organization-item:last-child,
.app-item:last-child {
	border-bottom: none;
}

.organization-item:hover,
.app-item:hover {
	color: var(--atlas-text);
}

.organization-item i,
.app-item i {
	color: var(--atlas-dot);
	font-size: 13px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.scene {
		padding: 32px 16px;
		align-items: flex-start;
		padding-top: max(40px, env(safe-area-inset-top, 40px));
		padding-bottom: max(32px, env(safe-area-inset-bottom, 32px));
	}

	.login-wrapper {
		gap: 28px;
	}

	.lp-card-footer {
		flex-direction: column;
		align-items: center;
		gap: 12px;
	}

	.lp-card-footer a {
		font-size: 13px;
	}

	.twofa-method-btns {
		flex-direction: column;
	}
}

/* ── Password strength indicator (register page) ────────────────────────── */
.password-strength {
	font-size: 12px;
	letter-spacing: 0.03em;
	margin-top: -12px;
	margin-bottom: 16px;
	min-height: 16px;
}

.strength-weak   { color: #e07070; }
.strength-good   { color: #d4a040; }
.strength-strong { color: var(--success-text); }

/* ── Reduce motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.star                          { animation: none; }
	.login-wrapper, .hyperion-logo { animation: none; }
	.btn-login:hover               { transform: none; }
}
