/*
 * Communication Partners: the site's home page (commpart.net/code/), also the QR library's
 * fallback for paused codes and codes in the Trash. Colours, type and imagery from commpart.com.
 */

@font-face {
	font-family: "Open Sans";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("fonts/open-sans-latin-400-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Open Sans";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("fonts/open-sans-latin-600-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Open Sans";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("fonts/open-sans-latin-700-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	--cp-primary: #1e3b60;
	--cp-accent: #fc5130;
	--cp-accent-hover: #de472a;
	--cp-secondary: #81cfd2;
	--cp-black: #010101;
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100svh;
	margin: 0;
	background: var(--cp-black) url("login-bg.jpg") center bottom / cover no-repeat fixed;
	color: #fff;
	font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
	font-size: 18px;
	line-height: 1.6;
}

/* Phones: the photo scrolls with the page (iOS ignores fixed backgrounds). */
@media (max-width: 767px) {
	body {
		background-attachment: scroll;
	}
}

/* The text sits in the dark sky above the astronaut. The space after it keeps the astronaut
   clear of the text on short phone screens, where the page then scrolls a little. */
body::after {
	content: "";
	flex: 1 0 300px;
}

main {
	width: 100%;
	max-width: 620px;
	margin: 0 auto;
	padding: clamp(48px, 12vh, 140px) 24px 48px;
	text-align: center;
}

.logo {
	display: block;
	width: 77.5px;
	height: auto;
	margin: 0 auto 28px;
}

h1 {
	margin: 0;
	font-size: 40px;
	font-weight: 700;
	line-height: 1.2;
	text-wrap: balance;
}

p {
	margin: 16px 0 0;
	text-wrap: pretty;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 32px;
}

/*
 * Two buttons with the same shape: "Visit commpart.com" is filled orange, "Contact us" is an orange
 * outline with white text. On hover (and keyboard focus) each swaps to the other's look.
 * 19px bold counts as large text, so white on the brand orange is readable.
 */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	/* 2px more at the top centres the letters between cap height and baseline (measured at 4x). */
	padding: 2px 26px 0;
	border: 2px solid var(--cp-accent);
	border-radius: 4px;
	color: #fff;
	font-size: 19px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

/* Side padding differs by half a pixel or so to centre each label's ink (letter side bearings differ). */
.button--solid {
	padding-right: 25.5px;
	padding-left: 26.5px;
	background: var(--cp-accent);
}

.button--outline {
	padding-right: 26.5px;
	padding-left: 25.5px;
	background: transparent;
}

@media (hover: hover) {
	.button--solid:hover {
		background: transparent;
	}

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

.button--solid:focus-visible {
	background: transparent;
}

.button--outline:focus-visible {
	background: var(--cp-accent);
}

.button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.button {
		transition: none;
	}
}

@media (max-width: 599px) {
	body {
		font-size: 17px;
	}

	h1 {
		font-size: 30px;
	}

	/* Phones: the two buttons stack at full width. */
	.actions {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}
}
