@import '../includes/fonts/roboto';

%custom-radio-checkbox-widget {
	input + span {
		&::before {
			height: 15px;
			width: 15px;
			background: white;
			top: 0.15rem;
		}
		&::after {
			width: 13px;
			height: 13px;
			top: calc(0.15rem + 2px);
		}
		padding-left: 1.5rem;
	}
	input:active + span {
		&::before {
			top: calc(0.15rem - 4px);
		}
	}
}

a.show-scopes, a.hide-scopes {
	display: block;
	margin: 2ex 0;
	position: relative;
	&::after {
		position: absolute;
		top: 0;
		content: '\f0dd';
		font-family: FontAwesome;
		margin-left: 5px;
	}
}

a.hide-scopes {
	display: none;
	&::after {
		content: '\f0de';
	}
}

.hidden {
	display: none;
}

form ul.errorlist {
	margin: 0;
	font-size: 0.9em;
	li {
		color: $primary-color;
		text-align: center;
	}
	~ input, + p input {
		border: 1px solid $primary-color;
	}
	~ p {
		margin-top: 0;
	}
	&.nonfield {
		margin: 0 0 2ex 0;
		li {
			border: 1px solid $primary-color;
			border-radius: 0.3em;
			background: #fff;
			color: #000;
			margin-top: 1em;
			text-align: left;
			font-weight: bold;
			background-image: url(images/warning.png);
			background-repeat: no-repeat;
			background-position: 10px 50%;
			background-size: 35px auto;
			padding: 1.2em 1em 1.2em 60px;
			&::before {
				display: none;
			}
		}
		~ input, + p input  {
			border: 1px solid default;
		}
	}
}

div.error {
	color: $primary-color;
	font-size: 0.9em;
	margin: 5px 0 0 0;
	~ input {
		border: 1px solid $primary-color;
	}
}

div#header-wrapper {
	background: #fff;
	border-top: 25px solid $primary-color;
	@media screen and ($max-mobile-viewport) {
		border-top: 3px solid $primary-color;
	}
}

div#header {
	max-width: 100%;
	#logo {
		display: flex;
		justify-content: center;
		a {
			height: 140px;
			width: 352px;
			@media screen and ($max-mobile-viewport) {
				background-position: 0 70%;
				width: 230px;
			}
		}
	}
	div#return {
		position: absolute;
		top: 50%;
		left: 1%;
		@media screen and ($max-mobile-viewport) {
			top: 3%;
		}
		a {
			color: #000;
			background: #fff url(images/back.svg) center left no-repeat;
			background-size: contain;
			padding: 1px 0 1px 50px;
			@media screen and (max-width: $mobile-limit) {
				display: block;
				text-indent: -9999px;
				padding: 10px 0 10px 40px;
			}
		}
	}
	div#help {
		position: absolute;
		top: 12%;
		right: 3%;
		a {
			background: url(images/help.png) center right no-repeat;
			background-size: contain;
			padding: 0 20px 0 0;
		}
	}
}
.authentic-page.authenticated-user div#main-content-wrapper {
	max-width: 100%;
}

div#main-content, div#login-footer {
	a, input {
		font-size: 1.4rem;
	}
}

div#main-content {
	.field-live-hint button {
		width: auto;
		&.close, &.action {
			padding: 0;
		}
		&.action {
			margin: 0 1em;
			text-transform: none;
		}
	}
	padding: 0;
	font-size: 16px;

	div.a2-authorization {
		a {
			font-size: 1em;
		}
		#profile-validation {
			background: #f5f5f7;
			padding-top: .3em;
			margin-bottom: .3em;
			border-radius: 4px;
			color: black;
		}
		#profile-validation > .profile {
			display: flex;
			input {
				margin-top: .2em;
				margin-right: 1em;
			}
			padding: .5em;
			margin-top: .2em;
			margin-bottom: .2em;
			background: #d9d9d9;
		}
	}

	div.a2-authorization-form input[type=submit] {
		width: 11em;
		margin: 5px 0.8em;
	}

	/* display title list in one line */
	ul#id_title {
		margin: 0;
		padding: 0;
		li {
			list-style-type: none;
			display: inline-block;
			label {
				font-weight: normal;
			}
		}
	}
	input, button {
		width: 100%;
		border-radius: 0.1em;
		padding: 0.7em 1em;
		margin: 1ex 0 0.5ex 0;
	}
	input[type=submit], button {
		margin-top: 1ex;
		width: 100%;
		text-transform: uppercase;
	}
	input[type=radio] {
		width: auto;
	}
}

div.a2-continue {
	text-align: center;
	margin: 0 auto 3ex auto;
	@media screen and ($max-mobile-viewport) {
		margin: 0 0.5em 3ex 0.5em;
	}
}

#messages {
	ul {
		width: 50%;
		margin: 0 auto;
		@media screen and ($max-mobile-viewport) {
			width: 95%;
		}
		@each $i in (info, warning) {
			li.#{$i} {
				border: 1px solid $primary-color;
				border-radius: 0.3em;
				background: #fff;
				color: #000;
				margin-top: 3em;
				text-align: left;
				font-weight: bold;
				background-image: url(images/#{$i}.png);
				background-repeat: no-repeat;
				background-position: 10px 0.5em;
				background-size: 35px auto;
				padding: 1.2em 1em 1.2em $notification-left-padding;
				&::before {
					display: none;
				}
				h2 {
					margin: 0 auto auto auto;
				}
				p {
					font-weight: normal;
					text-align: left;
				}
			}
		}
	}
}

div#login-header h2, div#registration-header h2, div#login-footer h2 {
	@extend %title;
	@media screen and (max-width: $common-screen-width) {
		padding-top: 1rem;
	}
	a {
		font-size: 1em;
	}
}

div#login-footer h2:not(:first-child) {
	margin-top: 2em;
}

div#registration_complete {
	padding: 3em 0;
}

h3 {
	padding-bottom: 1ex;
	&.section {
		font-weight: normal;
		border-bottom: 2px solid #b3b3b3;
		padding-bottom: 0;
	}
}

div.registration-steps {
	position: relative;
	max-width: 60em;
	margin: 0 auto;
	ul {
		padding: 0;
		@media screen and (max-width: 800px) {
			display: none;
		}
		li {
			list-style-type: none;
			display: inline-flex;
			width: 24.5%;
			box-sizing: border-box;
			align-items: center;
			flex-direction: column;
			span {
				&.marker {
					border: 1px solid #000;
					padding: 4px;
					border-radius: 50%;
					width: 22px;
					height: 22px;
					display: inline-block;
					text-align: center;
					background: #ffffff;
					z-index: 10;
					font-size: 10px;
				}
				&.label {
					margin-top: 0.5em;
					display: block;
					text-transform: uppercase;
					font-size: 13px;
				}
			}
			&.current {
				span.marker {
					background: #000;
					color: #fff;
				}
			}
		}
		&::before {
			position: absolute;
			top: calc(50% - 12px);
			content: '';
			border-top: 1px solid #000;
			width: 74.5%;
			left: 12.5%;
			z-index: -1;
		}
	}
}

div#registration_completion {
	form {
		label {
			text-transform: uppercase;
		}
		> div {
			margin: 2ex 0;
			display: flex;
			@media ($max-mobile-viewport) {
				flex-direction: column;
			}
			div {
				width: 100%;
				&.widget {
					margin: 0 #{$columns-gutter / 2};
					@media ($max-mobile-viewport) {
						margin: #{$columns-gutter / 2} 0;
					}
				}
			}
		}
		button {
			min-height: 2.5em;
			width: 35%;
			@media screen and ($max-mobile-viewport) {
				width: 70%;
			}
		}
	}
	@media screen and ($max-mobile-viewport) {
		width: auto;
		margin: 0 0.5em;
	}
}

.authentic-page p {
	text-align: center;
}

label {
	text-align: left;
	font-weight: bold;
}

form {
	margin: 0;
}

div.a2-authorization {
	margin: 0 auto;
	h2 {
		text-align: center;
	}
	div.a2-authorization-explanation {
		display: flex;
		flex-wrap: wrap;
		> div {
			width: 45%;
			margin: 15px;
			@media screen and ($max-mobile-viewport) {
				width: auto;
			}
		}
	}
	span.a2-authorization-explanation-title {
		display: block;
		font-weight: bold;
		font-style: italic;
	}
	@media screen and ($max-mobile-viewport) {
		width: auto;
		margin: 0 0.5em;
	}
	#scopes {
		display: none;
		font-size: 90%;
	}
	div.a2-authorization-form {
		form p {
			display: flex;
			flex-direction: row-reverse;
			justify-content: center;
			flex-wrap: wrap;
		}
		input[type=submit] {
			&.lock {
				background-image: url(images/lock.png);
				background-repeat: no-repeat;
				background-position: 10%;
				background-size: 15px;
			}
			&.refuse {
				background-color: #ffffff;
				color: #000000;
				border: 2px solid #000000;
			}
		}
	}
}

div#toplinks {
	top: 40%;
	right: 1%;
	border: 0;
	box-shadow: none;
	text-align: center;
	background: transparent;
	padding: 1ex 1em 0.3ex 1em;
	@media screen and ($max-mobile-viewport) {
		max-width: 100%;
		margin-top: 1px;
	}
	span.logged-in {
		background: $body-background;
		border-radius: 1.5em;
		padding: 1.2ex 1.5em;
		@media screen and ($max-mobile-viewport) {
			border-radius: 0 0 1.5em 1.5em;
		}
		a {
			&.logout {
				background: url(images/logout.png) no-repeat;
				background-size: contain;
				background-position: center right;
				display: inline-block;
				padding-right: 15px;
				@media screen and ($max-mobile-viewport) {
					text-indent: -9999px;
				}
			}
		}
	}
	@media screen and ($max-mobile-viewport) {
		top: 0;
		right: 0;
	}
}

#login-footer {
	background: #fff;
	padding-bottom: 2rem;
	margin-top: 2.5rem;
	&::before {
		content: '';
		background: #f2f2f2;
		width: 2.8em;
		height: 2.8em;
		display: block;
		margin: 0 calc(50% - 1.4em);
		transform: rotate(-45deg);
		position: relative;
		top: -1.4em;
	}
	a {
		background-image: url(images/forward.png);
		background-repeat: no-repeat;
		background-position: 95% center;
		background-size: 9px;
		display: inline-block;
		padding-right: 2.5em;
		padding-left: 2.5em;
	}
}

div#footer-wrapper {
	background: url(/assets/footer:background) no-repeat;
	background-size: cover;
	@media screen and ($max-mobile-viewport) {
		display: none;
	}
}

div#footer {
	margin: 3rem auto;
	font-size: 14px;
	text-align: center;
	width: 60em;
	@media screen and ($max-mobile-viewport) {
		width: auto;
	}
}

#footer-post {
	padding-top: 1rem;
}

div.footer-post-top, div.footer-post-bottom {
	font-size: 15px;
	margin: 0 auto;
	overflow: auto;
}

div.footer-post-top {
	max-width: 95rem;
	padding: 1em 0;
	@media screen and ($max-mobile-viewport) {
		width: auto;
	}
	img {
		margin: 0 1em;
	}
}

div.footer-post-bottom {
	background: #000;
	color: #ffffff;
	> div {
		max-width: 95rem;
		margin: 0 auto;
		padding: 1em 0;
		> div {
			@media screen and ($max-mobile-viewport) {
				float: none;
				margin: 0 auto;
				text-align: center;
			}
		}
	}
	a {
		color: #ffffff;
		&.metro {
			padding-left: 34px;
			float: right;
			background: url(images/footer-metropole-plus.png) no-repeat center left;
			@media screen and (max-width: $mobile-limit) {
				float: none;
			}
		}
	}
}

.center {
	text-align: center !important;
}

div.password-reset-form, div#registration_complete {
	margin: 0 auto 3ex auto;
	width: 33em;
	@media screen and ($max-mobile-viewport) {
		width: auto;
		margin: 0 0.5em;
	}
}

.a2-block {
	margin-top: 2em;
}

#login-page, #registration-blocks {
	margin: 0 auto;
	overflow: auto;
	width: 60em;
	@media screen and ($max-mobile-viewport) {
		width: auto;
	}
	> div {
		margin: 0 1ex;
	}
}

div.hint {
	font-size: 1em;
}

div#cgu > div {
	max-width: $mobile-limit;
	margin: 0 auto 0 auto;
	p {
		margin-left: 0;
		margin-right: 0;
		text-align: justify;
	}
	a {
		color: $primary-color;
	}
}

/* don't display navigation */
div#nav {
	display: none;
}

/* a2 password widgets */
.helptext.a2-password-ok, .helptext.a2-password-nok {
	background: #d5eee0;
	padding: 1ex;
	border-radius: 5px;
	margin-top: 1ex;
	position: relative;
	&::before {
		content: "";
		display: block;
		width: 1.6ex;
		height: 1.6ex;
		background: #d5eee0;
		position: absolute;
		top: -0.8ex;
		transform: rotate(45deg);
		left: 2ex;
	}
}

.helptext.a2-password-nok {
	background: #fbd3d3;
	color: $primary-color;
	&::before {
		background: #fbd3d3;
	}
}
