/*
 * CAS login / consent pages. Self-contained on purpose: no external fonts or images, the
 * CSP only allows our own origin.
 * TODO: add the Vazirmatn woff2 from the design team under /static/fonts with an
 * @font-face rule here. Until then the system font is used.
 */

:root {
	--bg: #f2f3f6;
	--surface: #ffffff;
	--text: #1b1d29;
	--muted: #5f6475;
	--border: #dfe1e5;
	--primary: #000431;
	--primary-text: #ffffff;
	--accent: #1159fc;
	--secondary: #eaeff7;
	--danger-bg: #fdecec;
	--danger: #b42318;
	--notice-bg: #eaf3ff;
	--radius: 12px;
}

* {
	box-sizing: border-box;
}

html {
	background: var(--bg);
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: "Vazirmatn", Tahoma, system-ui, sans-serif;
	color: var(--text);
	background: var(--bg);
	line-height: 1.7;
}

.card {
	width: 100%;
	max-width: 400px;
	padding: 24px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
}

.brand {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: -24px -24px 24px;
	padding: 18px 24px;
	background: var(--primary);
	border-radius: 16px 16px 0 0;
}

/* The logo files are white, they need the dark brand background behind them */
.brand__logo {
	display: block;
	height: 20px;
	width: auto;
}

.title {
	margin: 0 0 4px;
	font-size: 1.25rem;
	font-weight: 600;
}

.subtitle {
	margin: 0 0 20px;
	color: var(--muted);
	font-size: 0.95rem;
}

.form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.form--inline {
	margin-top: 16px;
}

.label {
	font-size: 0.9rem;
	color: var(--muted);
}

.input {
	width: 100%;
	padding: 12px;
	font: inherit;
	font-size: 1.05rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
}

.input:focus {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
	border-color: var(--accent);
}

.input--ltr,
.ltr {
	direction: ltr;
	text-align: left;
	unicode-bidi: isolate;
}

.input--code {
	letter-spacing: 0.5em;
	text-align: center;
}

.button {
	width: 100%;
	padding: 12px 16px;
	font: inherit;
	font-weight: 600;
	border: none;
	border-radius: var(--radius);
	cursor: pointer;
}

.button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.button--primary {
	background: var(--primary);
	color: var(--primary-text);
}

.button--secondary {
	background: var(--secondary);
	color: var(--accent);
}

.button--link {
	width: auto;
	padding: 0;
	background: none;
	color: var(--accent);
	font-weight: 500;
}

.button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.link {
	display: inline-block;
	margin-top: 12px;
	color: var(--accent);
	text-decoration: none;
	font-size: 0.95rem;
}

.alert,
.notice {
	margin: 0 0 16px;
	padding: 10px 12px;
	border-radius: var(--radius);
	font-size: 0.9rem;
}

.alert {
	background: var(--danger-bg);
	color: var(--danger);
}

.notice {
	background: var(--notice-bg);
	color: var(--accent);
}

.scopes {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.scope {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	background: var(--bg);
	border-radius: var(--radius);
}

.scope input {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.scope label {
	display: flex;
	flex: 1;
	justify-content: space-between;
	gap: 8px;
	cursor: pointer;
}

.scope__value {
	color: var(--muted);
}

.scope--required label {
	cursor: default;
}

.scope__required {
	margin-inline-start: 6px;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--secondary);
	color: var(--muted);
	font-size: 0.75rem;
}

.hint {
	margin: 8px 0 0;
	color: var(--muted);
	font-size: 0.85rem;
}

.previous {
	color: var(--muted);
	font-size: 0.9rem;
}

.previous ul {
	margin: 4px 0 0;
	padding-inline-start: 20px;
}

.actions {
	display: flex;
	gap: 8px;
	margin-top: 20px;
}
