/* DevLoom gateway pages: sign in, request access, starting. MechatronLabs navy and orange. */

:root {
	color-scheme: light dark;
	--navy: #1b3a4b;
	--navy-deep: #10242f;
	--steel: #6e9dbb;
	--ice: #c8deec;
	--orange: #ed8b00;
	--bg: #f4f7fa;
	--card: #ffffff;
	--text: #0f1d26;
	--muted: #52657a;
	--border: #d6e0e8;
	--input: #f8fafc;
	--focus: #2c6e93;
	--error-bg: #fdecec;
	--error-text: #9b1c1c;
	--info-bg: #e8f2f8;
	--info-text: #1b3a4b;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0b161d;
		--card: #13232d;
		--text: #e8eef3;
		--muted: #9bb0c0;
		--border: #24394a;
		--input: #0f1d26;
		--focus: #6e9dbb;
		--error-bg: #3a1618;
		--error-text: #ffb4b4;
		--info-bg: #16303e;
		--info-text: #c8deec;
	}
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
	background: var(--bg);
	color: var(--text);
	font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--focus); }

.shell {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	min-height: 100vh;
}

/* Brand panel */
.brand {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(32px, 6vh, 56px) clamp(32px, 6vw, 88px);
	background:
		radial-gradient(1200px 600px at -10% 110%, rgba(237, 139, 0, 0.16), transparent 60%),
		linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
	color: #f2f6f9;
}

/* Loom threads behind the content. */
.brand::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		repeating-linear-gradient(90deg, rgba(110, 157, 187, 0.10) 0 1px, transparent 1px 64px),
		repeating-linear-gradient(0deg, rgba(200, 222, 236, 0.05) 0 1px, transparent 1px 64px);
	pointer-events: none;
}

.brand > * { position: relative; }

.wordmark { width: 260px; height: auto; margin-bottom: clamp(24px, 4vh, 40px); }

.brand h1 {
	margin: 0 0 16px;
	max-width: 640px;
	font-size: clamp(28px, 3.2vw, 40px);
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.lead { margin: 0 0 clamp(20px, 3.5vh, 32px); max-width: 620px; color: var(--ice); font-size: 16px; }
.lead strong { color: #fff; }

.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; max-width: 720px; }
@media (max-width: 1180px) { .features { grid-template-columns: 1fr; gap: 14px; max-width: 540px; } }
.features li { display: flex; gap: 14px; align-items: flex-start; }
.features li > span:last-child { display: flex; flex-direction: column; }
.features strong { color: #fff; font-size: 15px; }
.features li > span:last-child > span { color: var(--ice); font-size: 13.5px; line-height: 1.45; }

.feature-icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: rgba(237, 139, 0, 0.14);
	color: var(--orange);
}
.feature-icon svg { width: 20px; height: 20px; }

/* Sign-in panel */
.panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48px 24px 24px;
}

.card {
	width: 100%;
	max-width: 400px;
	padding: 36px 32px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 16px;
	box-shadow: 0 20px 50px -24px rgba(16, 36, 47, 0.35);
}

.card h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.01em; }
.hint { margin: 0 0 20px; color: var(--muted); }

form { display: flex; flex-direction: column; }

label { margin: 12px 0 6px; font-size: 13px; font-weight: 600; }
.optional { color: var(--muted); font-weight: 400; }

input, textarea {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--input);
	color: var(--text);
	font: inherit;
	resize: vertical;
}

input:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }

button, .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 22px;
	padding: 12px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--navy);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	box-shadow: inset 0 -3px 0 var(--orange);
}

button:hover, .button:hover { background: #24495d; }
button:focus-visible, .button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

@media (prefers-color-scheme: dark) {
	button, .button { background: #2c5468; }
	button:hover, .button:hover { background: #356279; }
}

.notice { margin: 4px 0 8px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.notice.error { background: var(--error-bg); color: var(--error-text); }
.notice.info { background: var(--info-bg); color: var(--info-text); }

.switch { margin: 22px 0 0; text-align: center; color: var(--muted); }
.switch a { font-weight: 600; }
.fineprint { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 12px; }

footer { margin-top: 24px; display: flex; gap: 8px; color: var(--muted); font-size: 12px; }

@media (max-width: 880px) {
	.shell { grid-template-columns: 1fr; }
	.brand { padding: 32px 24px; }
	.wordmark { width: 200px; margin-bottom: 20px; }
	.brand h1 { font-size: 26px; }
	.lead { margin-bottom: 20px; }
	.features { display: none; }
	.panel { padding: 24px 16px; }
	.card { padding: 28px 22px; }
}

/* Starting page */
body.starting { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.starting-card {
	width: 100%;
	max-width: 440px;
	padding: 40px 32px;
	text-align: center;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 16px;
}
.starting-card h2 { margin: 18px 0 8px; font-size: 20px; }
.spinner {
	width: 28px;
	height: 28px;
	margin: 20px auto 0;
	border: 3px solid var(--border);
	border-top-color: var(--orange);
	border-radius: 50%;
	animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
