/* The sign-in, password and error pages. The signed-in app has its own
   stylesheet (web/src/styles.css). Served fingerprinted, so the CSP needs no
   'unsafe-inline', and with one self-hosted font (the wordmark's) and no external
   requests. */

/* The wordmark's typeface, as in the app. The placeholder is swapped for the
   fingerprinted file's address when the stylesheet is prepared (static.go). */
@font-face {
	font-family: 'Martian Mono';
	font-style: normal;
	font-weight: 400 600;
	font-display: swap;
	src: url('/static/martian-mono-latin.29bf2691317290c0.woff2') format('woff2');
}

/* Theme: dark is the default. With no saved choice, a light operating system gets
   the light palette. theme.js sets data-theme on <html> once the customer picks
   one, which wins over the system setting in either direction. The light values
   appear twice because CSS cannot share one block between a media query and an
   attribute selector; keep the two in step. color-scheme makes form controls and
   scrollbars follow the palette.

   Names: --panel is a card, --panel-2 is a muted hover surface, --primary is
   the solid button. */
:root {
	color-scheme: dark;
	--bg: #09090b;
	--panel: #0f0f12;
	--panel-2: #18181b;
	--line: #27272a;
	--text: #fafafa;
	--muted: #a1a1aa;
	--accent: #3b82f6;
	--bad: #f87171;
	--primary: #fafafa;
	--primary-fg: #18181b;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
	--shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
	--radius-sm: 6px;
	--mono: 'Martian Mono', ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: light) {
	:root:not([data-theme="dark"]) {
		color-scheme: light;
		--bg: #fafafa;
		--panel: #ffffff;
		--panel-2: #f4f4f5;
		--line: #e4e4e7;
		--text: #09090b;
		--muted: #71717a;
		--accent: #2563eb;
		--bad: #dc2626;
		--primary: #18181b;
		--primary-fg: #fafafa;
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.06);
		--shadow-lg: 0 10px 30px -12px rgba(0, 0, 0, 0.18);
	}
}

:root[data-theme="light"] {
	color-scheme: light;
	--bg: #fafafa;
	--panel: #ffffff;
	--panel-2: #f4f4f5;
	--line: #e4e4e7;
	--text: #09090b;
	--muted: #71717a;
	--accent: #2563eb;
	--bad: #dc2626;
	--primary: #18181b;
	--primary-fg: #fafafa;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.06);
	--shadow-lg: 0 10px 30px -12px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }

/* Author display rules (inline-flex buttons) would otherwise beat the
   browser's own [hidden] rule and show things that are meant to stay hidden. */
[hidden] { display: none !important; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 14px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

p { margin: 0 0 10px; }

/* Keyboard focus must stay visible: this is an account console, and a customer
   navigating by keyboard should never lose their place. */
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
	a, button, .provider, input {
		transition: background-color 0.15s ease, border-color 0.15s ease,
			color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
	}
}

/* The wordmark, as in the app's sidebar (web/src/styles.css): text in the mono face with the accent underscore. Each place it appears sets its own size. */
.wordmark {
	color: var(--text);
	font: 500 23px/1.2 var(--mono);
	letter-spacing: -0.06em;
	text-decoration: none;
	white-space: nowrap;
	-webkit-user-select: none;
	user-select: none;
}
.wordmark span { color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; margin: 2px 0; }

.mono {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	font-size: 12.5px;
}

/* The default button is the solid "primary" one; .provider is outlined. */
button, .provider {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	height: 36px;
	padding: 0 16px;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	background: var(--primary);
	color: var(--primary-fg);
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	-webkit-user-select: none;
	user-select: none;
}
button:hover { opacity: 0.88; }

.provider {
	background: var(--panel);
	color: var(--text);
	border-color: var(--line);
	box-shadow: var(--shadow);
}
.provider:hover {
	opacity: 1;
	background: var(--panel-2);
	text-decoration: none;
}

label { display: block; font-size: 13px; font-weight: 500; margin: 14px 0 6px; }
input {
	font: inherit;
	width: 100%;
	max-width: 440px;
	height: 36px;
	padding: 0 12px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: var(--bg);
	color: var(--text);
	box-shadow: var(--shadow);
}
input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus-visible {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
form button[type="submit"], form > button { margin-top: 14px; }

/* Login ------------------------------------------------------------------- */

.login-body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	background:
		radial-gradient(60% 45% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
		var(--bg);
}
.login-shell { width: 100%; max-width: 480px; padding: 24px; margin: auto; }
.login-panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 14px;
	box-shadow: var(--shadow-lg);
	padding: 44px 44px 40px;
}
.login-brand { display: flex; align-items: center; gap: 10px; }
/* Larger on the sign-in and error screens, where the wordmark is the only
   branding on the page rather than a header above a nav. */
.login-brand .wordmark { font-size: 30px; }
.login-panel h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; margin: 28px 0 24px; }
.login-panel .provider { display: flex; width: 100%; height: 44px; margin-bottom: 10px; }
.login-panel form { margin: 0; }
.login-panel form .provider { margin-top: 0; }
.login-error {
	padding: 10px 14px;
	border-radius: 8px;
	background: color-mix(in srgb, var(--bad) 10%, transparent);
	border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
	font-size: 13px;
	margin: 0 0 16px;
}
.login-error a { color: inherit; font-weight: 600; }
.login-note { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; }
/* The sign-up confirmation: a lead line, then what happens next. */
.login-confirm { margin: 0 0 24px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.login-confirm p { margin: 0 0 10px; }
.login-confirm p:last-child { margin-bottom: 0; }
.login-confirm .login-confirm-lead { color: var(--text); font-weight: 600; font-size: 15px; }

/* Username and password form. Inputs fill the panel rather than the 440px cap. */
.login-form label:first-of-type { margin-top: 0; }
.login-form input[type="text"], .login-form input[type="password"] {
	display: block;
	width: 100%;
	max-width: none;
	height: 44px;
}
/* The sign-up form's role menu, drawn like the inputs above it. */
.login-form select {
	display: block;
	width: 100%;
	height: 44px;
	padding: 0 12px;
	font: inherit;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: var(--bg);
	color: var(--text);
	box-shadow: var(--shadow);
}
.login-form select:focus-visible {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
/* Company size, shown as the website shows it: the five ranges at once. */
.signup-size-label { display: block; font-size: 13px; font-weight: 500; margin: 14px 0 6px; }
.signup-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.signup-size { position: relative; display: inline-flex; margin: 0; font-weight: 400; }
.signup-size input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
	box-shadow: none;
}
.signup-size span {
	display: inline-flex;
	align-items: center;
	height: 34px;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--bg);
	color: var(--text);
	font-family: var(--mono);
	font-size: 12px;
	cursor: pointer;
}
.signup-size input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.signup-size input:focus-visible + span {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.login-help { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
/* reCAPTCHA. Google allows the corner badge to be hidden only while this notice
   is shown on the same page, so the two are changed together. */
.login-recaptcha { color: var(--muted); font-size: 11.5px; margin: 14px 0 0; }
.login-recaptcha a { color: inherit; text-decoration: underline; }
.grecaptcha-badge { visibility: hidden; }
.login-panel .login-form .login-submit { width: 100%; height: 44px; margin-top: 24px; }
.login-panel .login-form .login-submit:disabled { opacity: .55; cursor: not-allowed; }
.login-panel .login-form + .provider, .login-panel .login-form + form { margin-top: 12px; }

/* Footer: the same bar on every page, in the app and out of it. The wordmark is on the left and the Cookie Declaration link on the right. */
.site-foot {
	margin-top: auto;
	padding: 16px 32px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	color: var(--muted);
	font-size: 13px;
	border-top: 1px solid var(--line);
}
.site-foot-mark { display: inline-flex; align-items: center; }
.site-foot .wordmark { font-size: 16px; }
.site-foot a { color: var(--muted); text-decoration: underline; }
.site-foot a:hover, .site-foot a[aria-current="page"] { color: var(--text); }

/* Cookie Declaration -------------------------------------------------------
   A wider reading page than the sign-in panel, in the same palette, so it follows
   the light and dark themes (and the toggle) like every other page.

   Cookiebot's cd.js draws the tables itself with its own fixed class names and
   some inline defaults, so the colour, background and border rules below use
   !important: they have to beat a stylesheet this file does not control, and the
   only thing they override is that default look. */
.legal-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.legal-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 32px;
	border-bottom: 1px solid var(--line);
}
.legal-brand { display: inline-flex; color: var(--text); text-decoration: none; -webkit-user-select: none; user-select: none; }
.legal-brand:hover, .legal-brand:focus-visible { text-decoration: none; }
.legal-brand .wordmark { font-size: 22px; }
.legal-main { flex: 1 0 auto; width: 100%; max-width: 920px; margin: 0 auto; padding: 40px 32px 56px; }
.legal-main h1 { margin: 0 0 8px; font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -0.025em; }
.legal-lede { color: var(--muted); max-width: 70ch; }

/* The theme button, as in the app: a bare icon, sun to go light, moon to go dark.
   theme.js sets data-mode to the current theme, so the sun shows while dark. */
.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	color: var(--muted);
	background: transparent;
	border: 0;
	border-radius: var(--radius-sm);
	cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--panel-2); }
.theme-toggle .ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle[data-mode="dark"] .ico-moon, .theme-toggle[data-mode="light"] .ico-sun { display: none; }

.cookie-declaration { margin-top: 28px; overflow-x: auto; }
.cookie-declaration a { color: var(--accent) !important; text-decoration: underline; text-underline-offset: 0.15em; }
.cookie-declaration a:hover { color: var(--text) !important; }
.cookie-declaration-missing { color: var(--muted); }
.cookie-declaration .CookieDeclaration,
.cookie-declaration .CookieDeclarationIntro,
.cookie-declaration .CookieDeclarationDialogText,
.cookie-declaration .CookieDeclarationTypeDescription {
	color: var(--muted) !important;
	background: transparent !important;
	font: inherit;
	font-size: 14px;
	line-height: 1.6;
}
.cookie-declaration .CookieDeclarationType { margin-top: 36px; padding: 0 !important; border: 0 !important; background: transparent !important; }
.cookie-declaration .CookieDeclarationTypeHeader {
	color: var(--text) !important;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}
.cookie-declaration .CookieDeclarationTypeDescription { margin-top: 10px; }
.cookie-declaration .CookieDeclarationTable {
	width: 100%;
	margin-top: 18px;
	border-collapse: collapse;
	font-size: 13px;
	line-height: 1.55;
	text-align: left;
	background: transparent !important;
}
.cookie-declaration .CookieDeclarationTableHeader {
	padding: 10px 14px;
	border: 0 !important;
	border-bottom: 1px solid var(--line) !important;
	background: transparent !important;
	color: var(--text) !important;
	font-weight: 600;
	vertical-align: top;
}
.cookie-declaration .CookieDeclarationTableCell {
	padding: 14px;
	border: 0 !important;
	border-bottom: 1px solid var(--line) !important;
	background: transparent !important;
	color: var(--muted) !important;
	vertical-align: top;
	min-width: 110px;
	overflow-wrap: anywhere;
}
.cookie-declaration .CookieDeclarationLastUpdated { display: block; margin-top: 22px; color: var(--muted) !important; font-size: 13px; }

@media (max-width: 640px) {
	.legal-top, .site-foot { padding-left: 16px; padding-right: 16px; }
	.legal-main { padding: 28px 16px 40px; }
}

@media (max-width: 520px) {
	.login-shell { padding: 16px; }
	.login-panel { padding: 32px 24px 28px; }
}
