/*
 * Login page styles for the RIS-Eingabetool (SSO-only login).
 * Self-contained, modern CSS — no Bootstrap / font-awesome dependency.
 * Visual design adapted from the legacy eingabe_login.css.
 */

@font-face {
	font-family: 'risicon';
	src: url('risicon/risicon.woff') format('woff');
	font-weight: normal;
	font-style: normal;
	font-display: block;
}

:root {
	--panel-bg: rgba(0, 0, 0, 0.66);
	--panel-fg: #ccc;
	--accent: #ec0016; /* DB red */
	--accent-hover: #c50014;
	--text-on-accent: #fff;
	--focus-ring: #4da3ff;
	--font-stack: 'Helvetica Neue', Helvetica, Arial, sans-serif;

	/* Header/footer chrome, from the legacy .headerrow / .footerrow / .btn-gray. */
	--header-bg: #eee;
	--footer-bg: #ccc;
	--chrome-fg: #333;
	--chrome-border: #ccc;
	--footer-link: #1f4e79; /* 5.4:1 on --footer-bg; Bootstrap's #337ab7 is only 2.9:1 */

	/* Contact-button hover, a darker step on --header-bg / --chrome-border. */
	--chrome-hover-bg: #d6d6d6;
	--chrome-hover-border: #9d9d9d;
	--footer-separator: #999;

	/* Bright content (headings, brand, links) on the dark panel, a lighter step on --panel-fg. */
	--panel-fg-bright: #fff;
	--plain-bg: #fff; /* white surface for the OAuth2 return page, inverts the dark login theme */

	/* Notice (info) and error alert palettes. */
	--notice-bg: #d9edf7;
	--notice-fg: #31708f;
	--notice-border: #bce8f1;
	--notice-link: #245269; /* darker step on --notice-fg for links inside a notice */
	--error-bg: #f2dede;
	--error-fg: #a94442;
	--error-border: #ebccd1;

	/* info2 glyph layers: black info mark on a gray disc. */
	--icon-info-gray: #b3b3b3;
	--icon-info-light: #eee;
	--icon-info-dark: #000;

	/* Legacy .loginBox anchor: left: 33.5%; bottom: 3%. Bottom is vh because percentage
	   padding resolves against the container's width even vertically. */
	--box-inset-left: 33.5%;
	--box-inset-bottom: 3vh;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	font-family: var(--font-stack);
	font-weight: normal;
	font-size: 14px; /* Bootstrap 3 base; the em values below assume it */
	color: var(--panel-fg);
	background: url('RIS_ET_Login_Background.jpg') no-repeat center center fixed;
	background-size: cover;
}

/* Layout: header at top, login panel anchored bottom-left, footer at bottom */
.page {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* ---- Header ---- */
.app-header {
	display: flex;
	align-items: center;
	gap: 16px;
	flex: 0 0 auto;
	height: 42px;
	padding: 0 16px;
	background: var(--header-bg);
	color: var(--chrome-fg);
}

.app-header__logo {
	background-image: url('DB_eM_rgb_100px.svg');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	height: 30px;
	width: 44px;
	flex: 0 0 auto;
}

.app-header__title {
	font-size: 1.2em;
	font-weight: bold;
}

.app-header__spacer {
	flex: 1 1 auto;
}

/* Legacy .btn-gray at .btn-sm size. */
.contact-button {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: inherit;
	font-size: 12px;
	color: var(--chrome-fg);
	background: var(--header-bg);
	border: 1px solid var(--chrome-border);
	padding: 5px 10px;
	cursor: pointer;
}

.contact-button:hover {
	background: var(--chrome-hover-bg);
	border-color: var(--chrome-hover-border);
}

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

.contact-button__icon {
	font-size: 2em;
	width: 1.28571429em; /* font-awesome .fa-fw */
	text-align: center;
}

.contact-button__text {
	font-size: 1.2em;
}

/* Five glyphs stacked at a -1em offset, one colour each. */
.risicon {
	font-family: 'risicon';
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	line-height: 1;
	text-transform: none;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.risicon-info2-blackongray .path1::before {
	content: '\e93f';
	color: var(--icon-info-gray);
}

.risicon-info2-blackongray .path2::before {
	content: '\e940';
	margin-left: -1em;
	color: var(--icon-info-light);
}

.risicon-info2-blackongray .path3::before {
	content: '\e941';
	margin-left: -1em;
	color: var(--icon-info-dark);
}

.risicon-info2-blackongray .path4::before {
	content: '\e942';
	margin-left: -1em;
	color: var(--icon-info-dark);
}

.risicon-info2-blackongray .path5::before {
	content: '\e943';
	margin-left: -1em;
	color: var(--icon-info-dark);
}

/* ---- Login panel ---- */
.login-main {
	flex: 1 1 auto;
	display: flex;
	align-items: flex-end;
	justify-content: flex-start;
	padding: 24px 24px var(--box-inset-bottom) var(--box-inset-left);
	overflow: auto; /* bottom-anchored: a long role picker must scroll, not overflow upward */
}

.login-box {
	width: 100%;
	max-width: 726px;
	min-width: 315px;
	color: var(--panel-fg);
}

/* ---- Impressum / Nutzungsbedingungen ---- */

.page--content .login-main {
	align-items: flex-start;
	padding: 5vh 5% 24px 10%;
}

.content-box {
	max-width: min(80%, 1100px);
}

.content-box__title {
	font-size: 1.3em;
	font-weight: bold;
	margin: 0 0 20px;
	color: var(--panel-fg-bright);
}

.content-box__title:focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 4px;
}

.content-box h3 {
	font-size: 1.1em;
	font-weight: bold;
	margin: 0 0 12px;
	color: var(--panel-fg-bright);
}

.content-box p {
	margin: 0 0 12px;
	line-height: 1.5;
}

.content-box a {
	color: var(--panel-fg-bright);
}

.content-box ul {
	margin: 0 0 12px;
	padding-left: 20px;
}

.content-box li {
	margin-bottom: 6px;
	line-height: 1.5;
}

.content-box__changed {
	margin-top: 20px;
	font-style: italic;
}

.back-button {
	font-family: inherit;
	font-size: 1em;
	margin-top: 20px;
	padding: 10px 16px;
	color: var(--text-on-accent);
	background: var(--accent);
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out;
}

.back-button:hover {
	background: var(--accent-hover);
}

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

/* ---- Disclaimer under the SSO button ---- */
.login-disclaimer {
	margin: 16px 0 0;
	font-size: 0.9em;
	line-height: 1.5;
}

.link-button {
	font-family: inherit;
	font-size: inherit;
	padding: 0;
	color: inherit;
	background: none;
	border: none;
	text-decoration: underline;
	cursor: pointer;
}

.link-button:hover {
	color: var(--panel-fg-bright);
}

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

.login-box__header {
	display: flex;
	align-items: center;
	gap: 23px;
	min-height: 166px;
	padding: 0 45px;
	background: var(--panel-bg);
	margin-bottom: 1px;
}

.login-box__logo {
	background-image: url('RisLogo_col.svg');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	height: 137px;
	width: 177px;
	flex: 0 0 auto;
}

.login-box__brand {
	font-size: 5.02em;
	font-weight: bold;
	color: var(--panel-fg-bright);
	line-height: 1;
	margin: 0;
}

.login-box__body {
	padding: 24px 45px 32px;
	background: var(--panel-bg);
}

.login-box__label {
	font-size: 1.3em;
	font-weight: bold;
	margin: 0 0 20px;
	color: var(--panel-fg-bright);
}

.noscript-warning {
	background: var(--error-bg);
	color: var(--error-fg);
	border: 1px solid var(--error-border);
	padding: 12px 15px;
	margin-bottom: 16px;
}

/* ---- SSO button ---- */
.sso-button {
	font-family: inherit;
	font-size: 1.05em;
	font-weight: bold;
	width: 100%;
	padding: 14px 18px;
	color: var(--text-on-accent);
	background: var(--accent);
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out;
}

.sso-button:hover {
	background: var(--accent-hover);
}

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

.sso-button:disabled {
	opacity: 0.6;
	cursor: default;
}

/* ---- Plain variant: the OAuth2 return page ---- */
.page--plain {
	background: var(--plain-bg);
	color: var(--chrome-fg);
}

.page--plain .login-main {
	align-items: flex-start;
	justify-content: center;
	padding: 5vh 24px 24px;
}

.page--plain .login-box,
.page--plain .login-box__label {
	color: inherit;
}

.page--plain .login-box__body {
	padding: 0;
	background: none;
}

/* ---- Role picker ---- */
.role-picker {
	margin-top: 16px;
	text-align: left;
}

.role-picker__label {
	font-size: 1.05em;
	font-weight: bold;
	margin: 0 0 12px;
}

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

.role-picker__option {
	font-family: inherit;
	font-size: 1.05em;
	width: 100%;
	padding: 12px 16px;
	text-align: left;
	color: var(--text-on-accent);
	background: var(--accent);
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out;
}

.role-picker__option:hover {
	background: var(--accent-hover);
}

.role-picker__option:focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 2px;
}

/* ---- Admin free-text role override ---- */
.role-picker__custom {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--chrome-border);
}

.role-picker__custom-label {
	display: block;
	font-size: 0.95em;
	margin-bottom: 8px;
}

.role-picker__custom-row {
	display: flex;
	gap: 8px;
}

.role-picker__custom-input {
	font-family: inherit;
	font-size: 1em;
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid var(--chrome-border);
}

.role-picker__custom-input:focus-visible,
.role-picker__custom-submit:focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 2px;
}

.role-picker__custom-submit {
	font-family: inherit;
	font-size: 1em;
	flex: 0 0 auto;
	padding: 10px 16px;
	color: var(--text-on-accent);
	background: var(--accent);
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out;
}

.role-picker__custom-submit:hover:not(:disabled) {
	background: var(--accent-hover);
}

.role-picker__custom-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

/* ---- Notices ---- */
.login-notice {
	background: var(--notice-bg);
	color: var(--notice-fg);
	border: 1px solid var(--notice-border);
	padding: 12px 15px;
	margin-bottom: 16px;
	line-height: 1.5;
}

.login-notice a {
	color: var(--notice-link);
}

/* ---- Error message ---- */
.login-error {
	background: var(--error-bg);
	color: var(--error-fg);
	border: 1px solid var(--error-border);
	padding: 12px 15px;
	margin-bottom: 16px;
}

/* ---- Footer ---- */
.app-footer {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	min-height: 19px;
	padding: 2px 16px 0;
	background: var(--footer-bg);
	color: var(--chrome-fg);
	font-size: 12px;
}

.app-footer a,
.app-footer .link-button {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--footer-link);
	font-size: inherit;
	text-decoration: none;
	cursor: pointer;
}

.app-footer a:hover,
.app-footer .link-button:hover {
	color: var(--footer-link);
	text-decoration: underline;
}

.app-footer a:focus-visible,
.app-footer .link-button:focus-visible {
	outline: 2px solid var(--focus-ring);
	outline-offset: 2px;
}

.app-footer > * + * {
	margin-left: 10px;
	border-left: 0.1em solid var(--footer-separator);
	padding-left: 10px;
}

.file-icon {
	display: block;
	flex: 0 0 auto;
}

/* ---- Responsive (breakpoints carried over from the legacy eingabe_login.css) ---- */
@media (max-width: 1142px) {
	:root {
		--box-inset-left: 5%;
	}
}

@media (max-width: 767px), (max-height: 585px) {
	/* Too short to bottom-anchor; pin under the header, as the legacy top: 43px did. */
	.login-main {
		align-items: flex-start;
		padding: 8px 3% 24px;
	}

	.login-box {
		max-width: none;
	}

	.login-box__header {
		min-height: 121px;
		padding: 0 15px;
		gap: 12px;
	}

	.login-box__logo {
		height: 92px;
		width: 118px;
	}

	.login-box__brand {
		font-size: 3.3em;
	}

	.login-box__body {
		padding: 18px 15px 24px;
	}
}

@media (max-width: 475px), (max-height: 500px) {
	.login-box__header {
		min-height: 98px;
	}

	.login-box__logo {
		height: 68px;
		width: 88px;
	}

	.login-box__brand {
		font-size: 2.2em;
	}
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
	/* Only the hover background-color fades animate; dropping the transition keeps the end state. */
	.back-button,
	.sso-button,
	.role-picker__option,
	.role-picker__custom-submit {
		transition: none;
	}
}
