/*
 * CMG shell for general SimpleSAMLphp pages (errors, state-lost, logout,
 * status, admin, ...). Loaded by the cmgtheme2fa base layout after the stock
 * stylesheet.css, so these rules take precedence.
 */

body.cmg-page {
	display: block;
	align-items: initial;
	justify-content: initial;
	min-height: 100vh;
	background: #f4f5f7;
	color: #222;
	font-family: Lato, Helvetica, sans-serif;
}

/* Header ---------------------------------------------------------------- */

#header.cmg-header {
	height: auto;
	min-height: 0;
	background: #fff;
	border-bottom: 1px solid #e4e4e4;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cmg-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 0;
}

.cmg-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	/* Push every following item (admin menu, language, logout) to the right,
	   so they stay grouped whichever of them a page shows. */
	margin-right: auto;
	color: #8a0f2b;
	font-weight: 700;
	font-size: 18px;
	text-decoration: none;
}

.cmg-brand img {
	display: block;
	height: 34px;
	width: auto;
}

.cmg-brand:hover,
.cmg-brand:focus {
	color: #8a0f2b;
	background: none;
	padding: 0;
}

/* Admin dropdown -------------------------------------------------------- */

.cmg-admin-nav {
	margin-right: 1rem;
	font-family: Lato, Helvetica, sans-serif;
}

.cmg-admin-nav details {
	position: relative;
}

.cmg-admin-nav summary {
	padding: 0.35em 0.8em;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	color: #222;
	cursor: pointer;
	list-style: none;
	white-space: nowrap;
}

.cmg-admin-nav summary::-webkit-details-marker {
	display: none;
}

.cmg-admin-nav summary::after {
	content: " \25BE";
	color: #8a0f2b;
}

.cmg-admin-nav details[open] summary,
.cmg-admin-nav summary:hover,
.cmg-admin-nav summary:focus {
	border-color: #8a0f2b;
	color: #8a0f2b;
}

.cmg-admin-nav ul {
	position: absolute;
	right: 0;
	z-index: 20;
	margin: 0.35rem 0 0;
	padding: 0.35rem 0;
	min-width: 14rem;
	list-style: none;
	background: #fff;
	border: 1px solid #e4e4e4;
	border-radius: 6px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.cmg-admin-nav li a {
	display: block;
	padding: 0.45rem 0.9rem;
	color: #222;
	text-decoration: none;
}

.cmg-admin-nav li a:hover,
.cmg-admin-nav li a:focus {
	background: #f4f5f7;
	color: #8a0f2b;
}

.cmg-language {
	margin: 0;
}

.cmg-language .language-menu {
	min-width: 10rem;
	padding: 0.35em 0.6em;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	color: #222;
	font-family: Lato, Helvetica, sans-serif;
}

/* Logout (admin and SSO) ------------------------------------------------ */

.cmg-logout {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-left: 0.75rem;
	padding: 0.35em 0.8em;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	color: #222;
	text-decoration: none;
	white-space: nowrap;
}

.cmg-logout:hover,
.cmg-logout:focus {
	padding: 0.35em 0.8em;
	border-color: #8a0f2b;
	background: #fff;
	color: #8a0f2b;
}

@media (max-width: 44em) {
	.cmg-logout-label {
		display: none;
	}
}

/* Content --------------------------------------------------------------- */

#layout {
	margin: 0 auto;
	min-height: auto;
}

#content {
	padding-top: 1.75rem;
	padding-bottom: 1rem;
}

#content > .wrap {
	box-sizing: border-box;
	max-width: 900px;
	padding: 28px 32px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

#content h1,
#content h2 {
	color: #222;
}

#push,
#bottom {
	height: 0;
}

/* Footer ---------------------------------------------------------------- */

#footer.cmg-footer {
	height: auto;
	padding: 18px 0 30px;
	background: none;
	color: #666;
	text-align: center;
}

.cmg-footer p {
	margin: 0;
	padding: 0;
	font-size: 12px;
}

#footer.cmg-footer a,
#footer.cmg-footer a:visited {
	color: #8a0f2b;
	text-decoration: underline;
}

#footer.cmg-footer a:hover,
#footer.cmg-footer a:focus {
	background: none;
	padding: 0;
	/* Stock stylesheet.css also sets negative margins on #footer a:hover,
	   which shifted the link left once its padding was removed. */
	margin: 0;
	color: #8a0f2b;
}

@media (max-width: 44em) {
	#content > .wrap {
		padding: 20px 18px;
	}

	.cmg-brand span {
		display: none;
	}
}

/* Welcome page ---------------------------------------------------------- */

.welcome-cmg .pure-button-primary {
	padding: 0.5em 2.5em;
	border-radius: 30px;
	background: #ec125f;
	font-weight: 600;
}

.cmg-welcome-mfa {
	margin: 0.5rem 0 1rem;
	padding: 0.75rem 1rem 0.75rem 2rem;
	background: #f7f7f9;
	border: 1px solid #e4e4e4;
	border-radius: 6px;
}

.cmg-welcome-mfa li {
	margin: 0.25rem 0;
}

/* Two-step verification admin ------------------------------------------- */

.cmg-mfa-table {
	width: 100%;
	margin-top: 0.75rem;
}

.pure-button.cmg-button-danger {
	background: #fff;
	border: 1px solid #c62828;
	border-radius: 4px;
	color: #c62828;
}

.pure-button.cmg-button-danger:hover,
.pure-button.cmg-button-danger:focus,
.pure-button.cmg-button-danger.cmg-button-armed {
	background: #c62828;
	background-image: none;
	color: #fff;
}

.cmg-welcome-security {
	margin: 1.25rem 0 0;
	padding: 0.6rem 0.9rem;
	border-left: 4px solid #8a0f2b;
	border-radius: 4px;
	background: #f7eef0;
	font-size: 0.9rem;
	color: #333;
}
