/*
 * The IdP's sign-in pages (P3 SP-13b, Q5). A named exception to "never build a second version of a control" (owner
 * 2026-11-16): the IdP is a separate service with no Angular, so its few controls are styled here, on Nest's design tokens
 * (css/tokens/, copied from the framework at build time; gate check scripts/verify/check-idp-tokens.mjs). Keep it small;
 * read only --nst-* semantic tokens.
 */
:root {
	color-scheme: light dark;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 16px;
	font-family: var(--nst-ref-font-jakarta, system-ui, sans-serif);
	color: var(--nst-text-default);
	background: var(--nst-surface-sunken);
}

.idp-card {
	width: 100%;
	max-width: 400px;
	padding: 32px;
	border: 1px solid var(--nst-border-subtle);
	border-radius: 12px;
	background: var(--nst-surface-raised);
	box-shadow: var(--nst-shadow-md);
}

.idp-brand {
	margin: 0 0 8px;
	font-weight: var(--nst-font-weight-bold);
	color: var(--nst-tone-primary-fg);
}

h1 {
	margin: 0 0 24px;
	font-size: 1.375rem;
	font-weight: var(--nst-font-weight-semibold);
}

.idp-form {
	display: grid;
	gap: 16px;
}

.idp-form label {
	display: grid;
	gap: 6px;
	font-size: 0.875rem;
	font-weight: var(--nst-font-weight-medium);
}

.idp-form input[type="email"],
.idp-form input[type="password"] {
	height: var(--nst-control-height, 40px);
	padding: 0 12px;
	border: 1px solid var(--nst-border-default);
	border-radius: 8px;
	font: inherit;
	color: inherit;
	background: var(--nst-surface-raised);
}

.idp-form input:focus-visible,
.idp-form button:focus-visible,
.idp-links a:focus-visible {
	outline: none;
	box-shadow: var(--nst-focus-ring);
}

.idp-form .idp-check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: var(--nst-font-weight-regular);
}

.idp-form button {
	height: var(--nst-control-height, 40px);
	border: 0;
	border-radius: 8px;
	font: inherit;
	font-weight: var(--nst-font-weight-semibold);
	color: var(--nst-tone-primary-fg-on-solid);
	background: var(--nst-tone-primary-bg-solid);
	cursor: pointer;
}

/* The external provider's button (SP-14a): the same control, quieter. */
.idp-form button.idp-secondary {
	color: var(--nst-tone-primary-fg);
	background: var(--nst-tone-primary-bg-soft);
	border: 1px solid var(--nst-tone-primary-border-soft);
}

.idp-links {
	margin: 20px 0 0;
	font-size: 0.875rem;
}

.idp-links a {
	color: var(--nst-text-link);
}

.idp-message {
	margin: 0 0 20px;
	padding: 12px;
	border-radius: 8px;
	font-size: 0.875rem;
}

.idp-info {
	color: var(--nst-tone-info-fg);
	background: var(--nst-tone-info-bg-soft);
}

.idp-error {
	color: var(--nst-tone-danger-fg);
	background: var(--nst-tone-danger-bg-soft);
}

/* MFA pages (SP-14b): the QR code, the key to type, the recovery codes. */
.idp-form input[type="text"] {
	height: var(--nst-control-height, 40px);
	padding: 0 12px;
	border: 1px solid var(--nst-border-default);
	border-radius: 8px;
	font: inherit;
	color: inherit;
	background: var(--nst-surface-raised);
}

.idp-qr-box {
	display: flex;
	justify-content: center;
	margin: 8px 0 16px;
}

.idp-key code,
.idp-codes code {
	font-family: ui-monospace, monospace;
	letter-spacing: 0.05em;
	overflow-wrap: anywhere;
}

.idp-codes {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	padding: 0;
	list-style: none;
}

h2 {
	margin: 24px 0 12px;
	font-size: 1rem;
	font-weight: var(--nst-font-weight-semibold);
}
