/*
 * VitalTie look for the login pages and every screen behind the login (block 7.1).
 * Every colour lives in :root, so the locked palette is one edit here.
 */

:root {
	--vt-cream: #FBF6EE;
	--vt-card: #FFFFFF;
	--vt-ink: #1C1916;
	--vt-muted: #6B655C;
	--vt-line: #E4DCCF;
	--vt-field: #CFC6B8;
	--vt-green: #3E7A52;
	--vt-green-dark: #33663F;
	--vt-red: #8A2424;
	--vt-red-bg: #FCEBEA;
	--vt-red-line: #E2A6A3;
	--vt-ok: #1F4A2C;
	--vt-ok-bg: #E7F2EA;
	--vt-ok-line: #9CC7AA;
	--vt-warn: #5C4A0E;
	--vt-warn-bg: #FDF4D8;
	--vt-warn-line: #E0C46A;
	--vt-radius: 10px;
	--vt-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Banners: coloured box, icon, bold headline, one short line. Red problems, green welcome and done, yellow warnings. */

.vt-banner,
.login #login_error,
.login .message,
.login .notice {
	position: relative;
	margin: 0 0 16px;
	padding: 12px 14px 12px 46px;
	border: 1px solid var(--vt-ok-line);
	border-left-width: 1px;
	border-radius: var(--vt-radius);
	background: var(--vt-ok-bg);
	color: var(--vt-ok);
	box-shadow: none;
	font-size: 15px;
	line-height: 1.45;
}

.vt-banner p,
.login #login_error p,
.login .message p,
.login .notice p {
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
}

.vt-banner strong,
.login #login_error strong,
.login .message strong,
.login .notice strong {
	display: block;
	font-size: 16px;
	font-weight: 700;
}

/* Inside the login card the banner sits on top, above the instruction and the fields (design B). */
#login form .vt-banner,
#login form #login_error,
#login form .message,
#login form .notice,
#login .vt-login-card .vt-banner,
#login .vt-login-card .message {
	order: -2;
	margin: 0 0 18px;
}

.vt-banner a,
.login #login_error a,
.login .message a,
.login .notice a {
	color: inherit;
	text-decoration: underline;
}

.vt-banner::before,
.login #login_error::before,
.login .message::before,
.login .notice::before {
	content: "";
	position: absolute;
	left: 14px;
	top: 13px;
	width: 20px;
	height: 20px;
	background: currentColor;
	-webkit-mask: var(--vt-icon) center / contain no-repeat;
	mask: var(--vt-icon) center / contain no-repeat;
	--vt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm4.3 6.3-5.6 5.6-2.9-2.9-1.4 1.4 4.3 4.3 7-7z'/%3E%3C/svg%3E");
}

.vt-banner--error,
.login #login_error,
.login .notice-error {
	border-color: var(--vt-red-line);
	background: var(--vt-red-bg);
	color: var(--vt-red);
}

.vt-banner--warning,
.login .notice-warning,
.login #login_notice {
	border-color: var(--vt-warn-line);
	background: var(--vt-warn-bg);
	color: var(--vt-warn);
}

.vt-banner--error::before,
.login #login_error::before,
.login .notice-error::before {
	--vt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20zM9 4v8h2V4zm0 10v2h2v-2z'/%3E%3C/svg%3E");
}

.vt-banner--warning::before,
.login .notice-warning::before,
.login #login_notice::before {
	--vt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1 0 19h20zM9 8v5h2V8zm0 7v2h2v-2z'/%3E%3C/svg%3E");
}

/* Login pages. Every page follows the two step code screen: the card holds the instruction, the fields and one full width button. */

body.login {
	background: var(--vt-cream);
	color: var(--vt-ink);
	font-family: var(--vt-font);
}

.login h1 a {
	background: var(--vt-logo) center / contain no-repeat;
	width: 260px;
	height: 74px;
	margin-bottom: 16px;
}

.login form,
.login .vt-login-card {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 24px;
	border: 1px solid var(--vt-line);
	border-radius: var(--vt-radius);
	background: var(--vt-card);
	box-shadow: none;
}

#login form > p,
#login form > div,
#login .vt-login-card > p {
	margin: 0 0 16px;
}

#login form .submit,
#login .vt-login-card .submit,
#login form > p:last-child,
#login .vt-login-card > p:last-child {
	margin-bottom: 0;
}

/* The instruction always sits first in the card, also where WordPress prints its fields before the hook. */
#login form .vt-prompt,
#login .vt-login-card .vt-prompt,
#login form .two-factor-prompt {
	order: -1;
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--vt-ink);
}

.login label {
	font-size: 14px;
	color: var(--vt-ink);
}

.login input[type=text],
.login input[type=email],
.login input[type=password] {
	border: 1px solid var(--vt-field);
	border-radius: 8px;
	min-height: 44px;
	font-size: 16px;
}

.login input[type=text]:focus,
.login input[type=email]:focus,
.login input[type=password]:focus {
	border-color: var(--vt-green);
	box-shadow: 0 0 0 1px var(--vt-green);
}

.login .button-primary,
.login .vt-login-card .vt-button {
	float: none;
	width: 100%;
	min-height: 44px;
	border: 1px solid var(--vt-green);
	border-radius: 8px;
	background: var(--vt-green);
	color: #fff;
	font-size: 16px;
	text-align: center;
}

.login .button-primary:hover,
.login .button-primary:focus,
.login .vt-login-card .vt-button:hover,
.login .vt-login-card .vt-button:focus {
	border-color: var(--vt-green-dark);
	background: var(--vt-green-dark);
	color: #fff;
}

.login .vt-login-card .vt-button {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	font-weight: 600;
	text-decoration: none;
}

.login .submit {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.login .button.wp-hide-pw {
	color: var(--vt-green);
}

.login a,
.login #nav a,
.login #backtoblog a {
	color: var(--vt-green);
}

.login #nav {
	margin: 20px 0 0;
	padding: 0;
	text-align: center;
	font-size: 14px;
}

.login form .forgetmenot {
	display: none;
}

.login #backtoblog {
	margin: 20px 24px 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--vt-line);
	text-align: center;
	font-size: 14px;
	color: var(--vt-muted);
}

/* The family route shows on the password step only. Elsewhere the divider would stand alone. */
body.login:not(.vt-family-route) #backtoblog {
	display: none;
}

.login .vitaltie-family-route a {
	display: block;
	margin-top: 2px;
}

.login .vitaltie-qr {
	text-align: center;
}

.login .vitaltie-qr svg {
	max-width: 100%;
	height: auto;
}

.login .vitaltie-key {
	font-size: 13px;
	word-break: break-all;
}

.login .backup-methods-wrap {
	margin-top: 16px;
	text-align: center;
}

/* Screens behind the login. */

body.vt-app {
	margin: 0;
	background: var(--vt-cream);
	color: var(--vt-ink);
	font-family: var(--vt-font);
	font-size: 16px;
	line-height: 1.5;
}

.vt-app *,
.vt-app *::before,
.vt-app *::after {
	box-sizing: border-box;
}

.vt-skip {
	position: absolute;
	left: -9999px;
}

.vt-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.vt-skip:focus {
	left: 16px;
	top: 8px;
	z-index: 10;
	padding: 8px 12px;
	background: var(--vt-card);
	color: var(--vt-ink);
}

.vt-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 24px;
	padding: 12px 24px;
	border-bottom: 1px solid var(--vt-line);
	background: var(--vt-card);
}

.vt-logo img {
	display: block;
	width: 132px;
	height: auto;
}

.vt-top nav {
	flex: 1;
}

.vt-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vt-menu a,
.vt-account a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 12px;
	border-radius: 8px;
	color: var(--vt-ink);
	text-decoration: none;
	font-weight: 500;
}

.vt-menu a:hover,
.vt-account a:hover {
	background: var(--vt-cream);
}

/* The current page is bold and underlined, not only coloured. */
.vt-menu a[aria-current="page"] {
	color: var(--vt-green-dark);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 2px;
}

.vt-account {
	display: flex;
	align-items: center;
	gap: 4px;
	color: var(--vt-muted);
	font-size: 14px;
}

.vt-main {
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px;
}

.vt-main h1 {
	margin: 0 0 16px;
	font-size: 26px;
	line-height: 1.25;
}

.vt-main h2 {
	margin: 32px 0 12px;
	font-size: 19px;
}

.vt-main h2:first-child {
	margin-top: 0;
}

.vt-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 24px;
}

.vt-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--vt-green);
	border-radius: 8px;
	background: var(--vt-green);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.vt-button:hover,
.vt-button:focus {
	border-color: var(--vt-green-dark);
	background: var(--vt-green-dark);
	color: #fff;
}

.vt-button--quiet {
	background: var(--vt-card);
	color: var(--vt-green-dark);
}

.vt-button--quiet:hover,
.vt-button--quiet:focus {
	background: var(--vt-ok-bg);
	color: var(--vt-green-dark);
}

.vt-button--danger {
	border-color: var(--vt-red-line);
	background: var(--vt-card);
	color: var(--vt-red);
}

.vt-button--danger:hover,
.vt-button--danger:focus {
	border-color: var(--vt-red);
	background: var(--vt-red-bg);
	color: var(--vt-red);
}

.vt-card {
	margin: 0 0 16px;
	padding: 20px;
	border: 1px solid var(--vt-line);
	border-radius: var(--vt-radius);
	background: var(--vt-card);
}

.vt-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--vt-line);
	border-radius: var(--vt-radius);
	background: var(--vt-card);
}

.vt-list li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 16px;
	min-height: 52px;
	padding: 10px 16px;
	border-top: 1px solid var(--vt-line);
}

.vt-list li:first-child {
	border-top: 0;
}

.vt-list a {
	color: var(--vt-green-dark);
	font-weight: 600;
}

.vt-meta {
	color: var(--vt-muted);
	font-size: 14px;
}

/* Status words carry the meaning, the colour only helps. */
.vt-tag {
	display: inline-block;
	padding: 2px 10px;
	border: 1px solid var(--vt-line);
	border-radius: var(--vt-radius);
	color: var(--vt-ink);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.vt-tag--red {
	border-color: var(--vt-red-line);
	background: var(--vt-red-bg);
	color: var(--vt-red);
}

.vt-tag--yellow {
	border-color: var(--vt-warn-line);
	background: var(--vt-warn-bg);
	color: var(--vt-warn);
}

.vt-empty {
	margin: 0;
	padding: 16px;
	border: 1px dashed var(--vt-field);
	border-radius: var(--vt-radius);
	color: var(--vt-muted);
}

/* Tables become stacked cards on a phone, each cell with its label. */
.vt-table {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	border: 1px solid var(--vt-line);
	border-radius: var(--vt-radius);
	background: var(--vt-card);
}

.vt-table th,
.vt-table td {
	padding: 10px 14px;
	border-top: 1px solid var(--vt-line);
	text-align: left;
	vertical-align: middle;
}

.vt-table thead th {
	border-top: 0;
	color: var(--vt-muted);
	font-size: 14px;
	font-weight: 600;
}

.vt-table a {
	color: var(--vt-green-dark);
	font-weight: 600;
}

.vt-table td {
	overflow-wrap: anywhere;
}

/* People: room for the status picker and its Save button on one line. */
.vt-table--people th:nth-child(3) {
	width: 220px;
}

.vt-table--people th:nth-child(4) {
	width: 120px;
}

/* Invites: columns as wide as their content, so the buttons stay inside and emails break only when there is no room. */
.vt-table--invites {
	table-layout: auto;
}

.vt-table--invites td {
	overflow-wrap: break-word;
}

.vt-table .vt-inline {
	flex-wrap: nowrap;
}

.vt-table .vt-button {
	overflow-wrap: normal;
	white-space: nowrap;
}

.vt-inline {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
}

/* Forms */

.vt-form {
	max-width: 100%;
}

.vt-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 32px;
}

.vt-field {
	margin: 0 0 14px;
}

.vt-field label,
.vt-label {
	display: block;
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 600;
}

.vt-field input[type=text],
.vt-field input[type=email],
.vt-field input[type=tel],
.vt-field select,
.vt-field textarea,
.vt-inline select {
	width: 100%;
	max-width: 420px;
	min-height: 44px;
	padding: 8px 10px;
	border: 1px solid var(--vt-field);
	border-radius: 8px;
	background: #fff;
	color: var(--vt-ink);
	font: inherit;
}

.vt-inline select {
	width: auto;
}

.vt-field textarea {
	min-height: 88px;
}

.vt-field input:focus,
.vt-field select:focus,
.vt-field textarea:focus,
.vt-inline select:focus {
	outline: 2px solid var(--vt-green);
	outline-offset: 1px;
	border-color: var(--vt-green);
}

.vt-field--short input {
	max-width: 160px;
}

.vt-req {
	color: var(--vt-red);
}

.vt-hint {
	margin: 4px 0 0;
	color: var(--vt-muted);
	font-size: 14px;
}

/* The browser frames every fieldset, no other field has a frame. */
.vt-checks {
	min-width: 0;
	margin-inline: 0;
	padding: 0;
	border: 0;
}

.vt-checks label {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 36px;
	font-weight: 400;
}

.vt-checks input {
	width: 20px;
	height: 20px;
}

.vt-submit {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0;
}

@media (max-width: 900px) {
	.vt-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 700px) {
	.vt-top {
		padding: 8px 16px;
	}

	.vt-top nav {
		order: 3;
		flex-basis: 100%;
	}

	.vt-menu a {
		padding: 0 8px;
	}

	.vt-account {
		margin-left: auto;
	}

	.vt-main {
		padding: 16px;
	}

	.vt-table {
		table-layout: auto;
	}

	.vt-table,
	.vt-table tbody,
	.vt-table tr,
	.vt-table td {
		display: block;
		width: 100%;
	}

	.vt-table thead {
		display: none;
	}

	.vt-table tr {
		padding: 8px 0;
		border-top: 1px solid var(--vt-line);
	}

	.vt-table tr:first-child {
		border-top: 0;
	}

	.vt-table td {
		padding: 4px 14px;
		border-top: 0;
	}

	.vt-table td[data-label]::before {
		content: attr(data-label);
		display: block;
		color: var(--vt-muted);
		font-size: 13px;
	}

	.vt-field input[type=text],
	.vt-field input[type=email],
	.vt-field input[type=tel],
	.vt-field select,
	.vt-field textarea {
		max-width: none;
	}
}
