/* Wellbeing First App: front-end styles. Colours come from the plugin settings. */

:root {
	--wfa-navy: #29235c;
	--wfa-accent: #009fe3;
	--wfa-bg: #eff7fb;
	--wfa-nav-height: 60px;
}

/* Bottom navigation ---------------------------------------------------- */

.wfa-nav {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99990;
	background: #fff;
	border-top: 1px solid rgba(41, 35, 92, .12);
	box-shadow: 0 -2px 12px rgba(41, 35, 92, .06);
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

html.wfa-standalone .wfa-nav { display: block; }

@media (max-width: 768px) {
	.wfa-nav--mobile { display: block; }
}

.wfa-nav__list {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wfa-nav__item {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.wfa-nav__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	min-height: var(--wfa-nav-height);
	padding: 6px 2px;
	color: var(--wfa-navy);
	text-decoration: none;
	font-size: 11px;
	line-height: 1.2;
	font-weight: 500;
	-webkit-tap-highlight-color: transparent;
}

.wfa-nav__link svg { width: 24px; height: 24px; flex: none; }

.wfa-nav__label {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wfa-nav__link[aria-current="page"] {
	color: var(--wfa-accent);
	font-weight: 600;
}

.wfa-nav__link:focus-visible {
	outline: 2px solid var(--wfa-accent);
	outline-offset: -4px;
	border-radius: 8px;
}

html.wfa-nav-visible body {
	padding-bottom: calc(var(--wfa-nav-height) + env(safe-area-inset-bottom, 0px)) !important;
}

/* Buttons ---------------------------------------------------------------- */

.wfa-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 999px;
	background: var(--wfa-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	padding: 11px 20px;
	cursor: pointer;
}

.wfa-btn:hover { filter: brightness(.95); }
.wfa-btn:focus-visible { outline: 3px solid var(--wfa-navy); outline-offset: 2px; }
.wfa-btn[disabled] { opacity: .6; cursor: default; }
.wfa-btn[aria-pressed="true"] { background: var(--wfa-navy); }

/* Install banner --------------------------------------------------------- */

.wfa-banner {
	position: fixed;
	left: 12px;
	right: 12px;
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	z-index: 99991;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 520px;
	margin: 0 auto;
	padding: 12px 12px 12px 14px;
	background: #fff;
	color: var(--wfa-navy);
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(41, 35, 92, .18);
	font-size: 14px;
	line-height: 1.4;
	transform: translateY(16px);
	opacity: 0;
	transition: transform .25s ease, opacity .25s ease;
}

.wfa-banner.is-in { transform: none; opacity: 1; }

html.wfa-nav-visible .wfa-banner {
	bottom: calc(var(--wfa-nav-height) + 12px + env(safe-area-inset-bottom, 0px));
}

.wfa-banner__icon {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	flex: none;
}

.wfa-banner__text { flex: 1 1 auto; min-width: 0; }
.wfa-banner__text strong { display: block; font-size: 15px; }
.wfa-banner__text svg { vertical-align: -3px; }
.wfa-banner__install { flex: none; padding: 9px 16px; }

.wfa-banner__close {
	appearance: none;
	flex: none;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wfa-navy);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.wfa-banner__close:focus-visible { outline: 2px solid var(--wfa-accent); }

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

/* Shortcodes ------------------------------------------------------------- */

.wfa-install,
.wfa-push { margin: 0 0 1em; }

.wfa-install__msg svg { vertical-align: -3px; }
.wfa-install__msg:empty,
.wfa-push__msg:empty { display: none; }
.wfa-install__btn + .wfa-install__msg,
.wfa-push__btn + .wfa-push__msg { margin-top: .6em; }

.wfa-btn--ghost {
	background: transparent;
	color: var(--wfa-navy);
	box-shadow: inset 0 0 0 1.5px currentColor;
}

/* Install buttons are pointless inside the app itself. */
html.wfa-standalone .wfa-install-button,
html.wfa-standalone a[href$="#install-app"] { display: none !important; }

/* Popup ----------------------------------------------------------------- */

html.wfa-modal-open { overflow: hidden; }

.wfa-modal {
	position: fixed;
	inset: 0;
	z-index: 99995;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
	background: rgba(41, 35, 92, .45);
}

@media (min-width: 600px) {
	.wfa-modal { align-items: center; }
}

.wfa-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: 100%;
	overflow-y: auto;
	padding: 24px 22px 22px;
	background: #fff;
	color: var(--wfa-navy);
	border-radius: 20px;
	box-shadow: 0 12px 40px rgba(41, 35, 92, .25);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}

.wfa-modal__close {
	appearance: none;
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wfa-navy);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.wfa-modal__close:focus-visible { outline: 2px solid var(--wfa-accent); }

.wfa-modal__icon {
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 0 12px;
	border-radius: 13px;
}

.wfa-modal__title {
	margin: 0 0 14px;
	padding-right: 32px;
	color: var(--wfa-navy);
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
}

.wfa-modal__steps {
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
	counter-reset: wfa-step;
}

.wfa-modal__step {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 12px;
	padding-left: 38px;
	counter-increment: wfa-step;
}

ol.wfa-modal__steps > .wfa-modal__step::before {
	content: counter(wfa-step);
	position: absolute;
	left: 0;
	top: 0;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--wfa-bg);
	color: var(--wfa-navy);
	font-size: 14px;
	font-weight: 700;
	line-height: 26px;
	text-align: center;
}

div.wfa-modal__steps > .wfa-modal__step { padding-left: 0; }

.wfa-modal__step-icon {
	flex: none;
	display: inline-flex;
	color: var(--wfa-accent);
	padding-top: 2px;
}

.wfa-modal__note {
	margin: 0 0 4px;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--wfa-bg);
	font-size: 14px;
}

.wfa-modal__action { margin-top: 8px; }

/* Diagnostics panel (?wfa_check=1) ---------------------------------------- */

.wfa-check {
	position: fixed;
	left: 12px;
	right: 12px;
	top: 12px;
	z-index: 99996;
	max-width: 560px;
	max-height: calc(100vh - 24px);
	margin: 0 auto;
	overflow-y: auto;
	padding: 18px;
	background: #fff;
	color: var(--wfa-navy);
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(41, 35, 92, .3);
	font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wfa-check__title { margin: 0 0 10px; font-size: 18px; color: var(--wfa-navy); }
.wfa-check__list { margin: 0 0 14px; padding: 0; list-style: none; }

.wfa-check__row {
	display: grid;
	grid-template-columns: 9.5em 1fr;
	gap: 10px;
	padding: 8px 0 8px 12px;
	border-left: 4px solid #c3c4c7;
	margin-bottom: 4px;
}

.wfa-check__row.is-ok { border-color: #00a32a; }
.wfa-check__row.is-bad { border-color: #d63638; background: #fcf0f1; }
.wfa-check__row.is-info { border-color: var(--wfa-accent); }
.wfa-check__label { font-weight: 600; }
.wfa-check__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wfa-check .wfa-btn { font-size: 14px; padding: 9px 16px; }

/* Bottom nav: six items, and the member's initials ---------------------- */

.wfa-nav--compact .wfa-nav__link { font-size: 10px; gap: 2px; padding-left: 1px; padding-right: 1px; }
.wfa-nav--compact .wfa-nav__link svg { width: 22px; height: 22px; }
.wfa-nav--compact .wfa-nav__avatar { width: 22px; height: 22px; font-size: 9.5px; }

@media (max-width: 340px) {
	.wfa-nav__link { font-size: 10px; }
	.wfa-nav--compact .wfa-nav__label { letter-spacing: -.02em; }
}

.wfa-nav__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--wfa-navy);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .02em;
}

.wfa-nav__link[aria-current="page"] .wfa-nav__avatar {
	background: var(--wfa-accent);
	box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--wfa-accent);
}

/* Other plugins' floating buttons, in the app ----------------------------- */

/* Anything moved into [wfa_app_tools] sits in the page instead of floating.
   Display is left alone so each widget keeps its own layout (e.g. CookieYes centres its icon with flex). */
.wfa-tools .wfa-tools__widget > *,
.wfa-tools .wfa-moved {
	position: static !important;
	inset: auto !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	transform: none !important;
	margin: 0 !important;
	z-index: auto !important;
	opacity: 1 !important;
	visibility: visible !important;
}

.wfa-tools {
	text-align: left;
}

.wfa-tools .wfa-tools__list {
	margin: 0 0 1em;
	padding: 0;
	list-style: none;
}

.wfa-tools .wfa-tools__list:empty { display: none; }

.wfa-tools .wfa-tools__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 60px;
	margin: 0;
	padding: 10px 0;
	border-bottom: 1px solid rgba(41, 35, 92, .12);
	color: var(--wfa-navy);
	list-style: none;
}

.wfa-tools .wfa-tools__label {
	flex: 1 1 auto;
	margin-right: 16px;
	font-weight: 600;
}

.wfa-tools .wfa-tools__widget {
	position: relative;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	margin-left: auto;
}

/* Notifications and app tools are for the app: hidden in an ordinary browser.
   [wfa_notifications everywhere="yes"] shows the switch in browsers too. */
html:not(.wfa-nav-visible) .wfa-tools,
html:not(.wfa-nav-visible) .wfa-push:not([data-wfa-everywhere]) { display: none !important; }

.wfa-btn--small { padding: 8px 16px; font-size: 14px; }

.wfa-tools .wfa-tools__item--push { flex-wrap: wrap; }
.wfa-tools .wfa-tools__item--push .wfa-push__msg {
	flex: 0 0 100%;
	margin: 0;
	font-size: 14px;
	line-height: 1.45;
}
.wfa-tools [hidden],
.wfa-tools .wfa-tools__widget > [hidden] { display: none !important; }

/* The plugin's own buttons keep their look even when the theme or Oxygen styles every <button>. */
button.wfa-btn,
a.wfa-btn {
	appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--wfa-accent) !important;
	color: #fff !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-align: center !important;
	padding: 11px 20px !important;
	box-shadow: none !important;
	cursor: pointer;
}

button.wfa-btn[aria-pressed="true"] { background: var(--wfa-navy) !important; color: #fff !important; }
button.wfa-btn.wfa-btn--small { padding: 8px 16px !important; font-size: 14px !important; }
button.wfa-btn.wfa-btn--ghost { background: transparent !important; color: var(--wfa-navy) !important; box-shadow: inset 0 0 0 1.5px currentColor !important; }
button.wfa-btn[disabled] { opacity: .6; cursor: default; }
button.wfa-btn[hidden] { display: none !important; }

.wfa-tools .wfa-tools__label,
.wfa-tools .wfa-push__msg { text-align: left !important; }
.wfa-tools .wfa-tools__label { margin-top: 0; margin-bottom: 0; padding: 0; color: var(--wfa-navy); }
