/*
 * WF Subscriptions: styles that sit inside the Wellbeing First design.
 *
 * - Everything is scoped to the plugin's own wrappers (.wfsub, .pms-form, .wfsub-form, .wppb-user-forms), so
 *   nothing here reaches the rest of the site, and Automatic.css is left alone.
 * - Sizes are in px and em, never rem: Automatic.css sets the root font size, which would otherwise shrink or
 *   grow everything. The base size comes from Subscriptions, Settings, Look (15px by default).
 * - Fonts are inherited from the page (Quicksand), so headings and text match the rest of the site.
 * - Colours come from Subscriptions, Settings, Look: --wfsub-site-accent (#009fe3), --wfsub-site-text (#29235c).
 */
.wfsub, .pms-form, .wfsub-form, .wppb-user-forms, .wfsub-restricted, .wppb-logout-url-wrapper {
	--wfsub-accent: var(--wfsub-site-accent, #009fe3);
	--wfsub-ink: var(--wfsub-site-ink, #fff);
	--wfsub-text: var(--wfsub-site-text, #29235c);
	--wfsub-size: var(--wfsub-site-size, 15px);
	--wfsub-radius: var(--wfsub-site-radius, 999px);
	--wfsub-field: #29235c;
	--wfsub-line: #dfe3ea;
	--wfsub-soft: #eff7fb;
	--wfsub-muted: #5f5a86;
	--wfsub-error: #b42318;
	font-size: var(--wfsub-size);
	line-height: 1.5;
	color: var(--wfsub-text);
}
.wfsub *, .pms-form *, .wfsub-form *, .wppb-user-forms * { box-sizing: border-box; }

/*
 * Full width. Automatic.css (and some site CSS written for PMS) can limit lists and paragraphs to a reading
 * length; these keep the form's own parts full width. The id keeps them ahead of that CSS without !important.
 */
#pms_register-form.wfsub-signup-form,
#pms_register-form.wfsub-signup-form ul,
#pms_register-form.wfsub-signup-form li,
#pms_register-form.wfsub-signup-form p,
#pms_register-form.wfsub-signup-form div,
#pms_register-form.wfsub-signup-form label,
#pms_register-form.wfsub-signup-form fieldset,
#pms_register-form.wfsub-signup-form input:not([type="checkbox"]):not([type="radio"]) {
	max-width: none;
}
/*
 * Oxygen's div blocks are flex boxes that shrink what is inside them to fit its content, so without this the
 * form is only as wide as its longest line (PMS's own stylesheet did the same job).
 */
.wfsub.wfsub-signup, #pms_register-form.wfsub-signup-form { width: 100%; max-width: none; align-self: stretch; }
div.wfsub, .wfsub-form, .wppb-user-forms, .pms-form { width: 100%; max-width: none; align-self: stretch; }
.wfsub ul, .wfsub li, .wfsub p, .wfsub-form ul, .wfsub-form li, .wfsub-form p,
.wppb-user-forms ul, .wppb-user-forms li, .wppb-user-forms p { max-width: none; }

/* ===== Buttons: Quicksand 600, #009fe3, pill ===== */
.wfsub .wfsub-btn,
.wfsub button[type="submit"],
.pms-form .wfsub-btn,
.pms-form button[type="submit"],
.wppb-user-forms input[type="submit"],
.wppb-user-forms button[type="submit"],
.wfsub-form input[type="submit"],
.wfsub-form button[type="submit"],
.wfsub-pay .wfsub-btn--pay {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: auto;
	min-width: 0;
	min-height: 0;
	height: auto;
	margin: 0;
	padding: 9px 30px;
	border: 1px solid var(--wfsub-accent);
	border-radius: var(--wfsub-radius);
	background: var(--wfsub-accent);
	color: var(--wfsub-ink);
	font-family: inherit;
	font-size: 1.07em;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	transition: filter .15s ease;
}
.wfsub .wfsub-btn:hover, .wfsub .wfsub-btn:focus,
.wfsub button[type="submit"]:hover, .wfsub button[type="submit"]:focus,
.pms-form .wfsub-btn:hover, .pms-form button[type="submit"]:hover,
.wppb-user-forms input[type="submit"]:hover, .wppb-user-forms button[type="submit"]:hover,
.wfsub-form input[type="submit"]:hover, .wfsub-form button[type="submit"]:hover {
	background: var(--wfsub-accent);
	border-color: var(--wfsub-accent);
	color: var(--wfsub-ink);
	filter: brightness(.94);
	opacity: 1;
}
/*
 * No outline when a button is clicked (some browsers and themes draw a dark ring on :focus). People moving
 * round the page with the keyboard still see where they are: a soft blue glow, not a black outline.
 */
.wfsub .wfsub-btn:focus, .wfsub button:focus, .wfsub a.wfsub-btn:focus, .pms-form button:focus, .pms-form .wfsub-btn:focus,
.wppb-user-forms input[type="submit"]:focus, .wppb-user-forms button:focus, .wfsub-form input[type="submit"]:focus,
.wfsub-pay .wfsub-btn--pay:focus {
	outline: none;
	box-shadow: none;
}
.wfsub .wfsub-btn:focus-visible, .wfsub button:focus-visible, .pms-form button:focus-visible, .pms-form .wfsub-btn:focus-visible,
.wppb-user-forms input[type="submit"]:focus-visible, .wfsub-pay .wfsub-btn--pay:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 159, 227, .35);
}
.wfsub a:not(.wfsub-btn):focus-visible, .pms-form a:focus-visible {
	outline: 2px solid var(--wfsub-accent);
	outline-offset: 2px;
}
/* Small buttons, as on the account page (Update, Change, Cancel). */
.wfsub .wfsub-btn--sm, .wfsub button.wfsub-btn--sm {
	padding: 2px 22px;
	font-size: 1.07em;
}
.wfsub .wfsub-btn--quiet, .wfsub button.wfsub-btn--quiet {
	background: transparent;
	color: var(--wfsub-accent);
}
.wfsub .wfsub-btn--quiet:hover, .wfsub button.wfsub-btn--quiet:hover { background: transparent; color: var(--wfsub-accent); }
.wfsub .wfsub-btn[disabled], .pms-form button[disabled], .wppb-user-forms input[type="submit"][disabled] { opacity: .6; cursor: wait; filter: none; }
.wfsub .wfsub-inline { display: inline-block; margin: 0; }
.wfsub .wfsub-stack { display: block; margin: 0; }

/* ===== Notices ===== */
.wfsub-notice { margin: 0 0 18px; padding: 12px 16px; border-radius: 6px; background: var(--wfsub-soft); color: var(--wfsub-text); font-size: 1em; }
.wfsub-notice--error { background: #fef3f2; color: #7a271a; }
.wfsub-notice--success { background: #ecfdf3; color: #054f31; }
.wfsub-notice a { color: inherit; text-decoration: underline; }

/* ===== Fields (sign up, login, profile, password) ===== */
.pms-form ul, .wfsub-form ul, .wppb-user-forms ul { list-style: none; margin: 0; padding: 0; }
.pms-form .pms-field, .wfsub .wfsub-field, .wppb-user-forms li.wppb-form-field, .wppb-user-forms p.wppb-form-field { margin: 0 0 18px; padding: 0; }
.pms-form .pms-field > label,
.wfsub .wfsub-field > label,
.wppb-user-forms li.wppb-form-field > label:first-child,
.wppb-user-forms p.wppb-form-field > label {
	display: block;
	margin: 0 0 6px;
	font-size: 1.07em;
	font-weight: 500;
	line-height: 1.35;
	color: var(--wfsub-text);
}
.pms-form input[type="text"], .pms-form input[type="email"], .pms-form input[type="password"],
.wfsub input[type="text"], .wfsub input[type="email"], .wfsub input[type="password"], .wfsub input[type="number"],
.wfsub select, .wfsub textarea,
.wppb-user-forms input[type="text"], .wppb-user-forms input[type="email"], .wppb-user-forms input[type="tel"],
.wppb-user-forms input[type="number"], .wppb-user-forms input[type="url"], .wppb-user-forms input[type="password"],
.wppb-user-forms input[type="date"], .wppb-user-forms select, .wppb-user-forms textarea,
.wfsub-form input[type="text"], .wfsub-form input[type="password"], .wfsub-form select, .wfsub-form textarea {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	max-width: none;
	height: 45px;
	min-height: 0;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var(--wfsub-field);
	border-radius: 2px;
	background: #fff;
	color: var(--wfsub-text);
	font-family: inherit;
	font-size: 1em;
	font-weight: 500;
	line-height: 1.4;
	box-shadow: none;
}
.wfsub textarea, .wppb-user-forms textarea { height: auto; min-height: 110px; resize: vertical; }
.wfsub select, .wppb-user-forms select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2329235c' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
	cursor: pointer;
}
.wppb-user-forms select[multiple] { height: auto; min-height: 130px; background-image: none; padding-right: 12px; }
.pms-form input::placeholder, .wfsub input::placeholder, .wppb-user-forms input::placeholder { color: #9a98b3; opacity: 1; }
.pms-form input:focus, .wfsub input:focus, .wfsub select:focus, .wfsub textarea:focus,
.wppb-user-forms input:focus, .wppb-user-forms select:focus, .wppb-user-forms textarea:focus {
	outline: 2px solid var(--wfsub-accent);
	outline-offset: 0;
	border-color: var(--wfsub-accent);
}
.pms-form input[readonly], .wfsub input[readonly] { background: #f6f7fb; color: var(--wfsub-muted); }
.pms-form input[type="checkbox"], .pms-form input[type="radio"],
.wfsub input[type="checkbox"], .wfsub input[type="radio"],
.wppb-user-forms input[type="checkbox"], .wppb-user-forms input[type="radio"] {
	width: 17px;
	height: 17px;
	margin: 3px 0 0;
	flex: none;
	accent-color: var(--wfsub-accent);
}
.wfsub-req { color: var(--wfsub-text); }
.wppb-required { color: var(--wfsub-error); margin-left: 2px; }
.wfsub-optional { font-weight: 400; color: var(--wfsub-muted); }
.wppb-form-error { display: block; margin-top: 6px; color: var(--wfsub-error); font-size: .93em; }
.wppb-field-error input, .wppb-field-error select, .wppb-field-error textarea,
.wfsub-invalid input[type="text"], .wfsub-invalid input[type="email"], .wfsub-invalid input[type="password"] { border-color: var(--wfsub-error); }
.wfsub-invalid input[type="checkbox"] { outline: 2px solid var(--wfsub-error); outline-offset: 1px; }
.wppb-checkboxes, .wppb-radios { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.wppb-checkboxes li, .wppb-radios li { display: flex; align-items: center; gap: 8px; margin: 0; }
.wppb-checkboxes label, .wppb-radios label { font-weight: 400; margin: 0; }
.wppb-user-forms .wppb-description-delimiter { display: block; margin-top: 6px; font-size: .93em; color: var(--wfsub-muted); }
.wppb-user-forms [hidden], .pms-form [hidden], .wfsub [hidden] { display: none !important; }
.wfsub-eye { display: inline-block; margin: 6px 0 0; padding: 0; border: 0; background: none; color: var(--wfsub-text); font: inherit; font-size: .93em; text-decoration: underline; cursor: pointer; }
.wppb-user-forms .form-submit, .wppb-login-form .login-submit { margin: 24px 0 0; }
.login-remember { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 6px; }
.login-remember label { font-weight: 400; }
.login-register-lost-password { margin-top: 16px; }
.wppb-alert, .wfsub-logged-in { margin: 0 0 16px; }
.wfsub-upload-current { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.wppb-user-forms .wfsub-upload-current img { width: 88px; height: auto !important; aspect-ratio: 1 / 1; border-radius: 50% !important; object-fit: cover; }
.wppb-user-forms input[type="file"] { font: inherit; font-size: 1em; max-width: 100%; }
.wfsub-user-picker { margin: 0 0 24px; }

/* ===== Sign-up form ([pms-register]) ===== */
.wfsub-signup-form .wfsub-check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 14px;
	font-size: 1.07em;
	font-weight: 500;
	line-height: 1.45;
	color: var(--wfsub-text);
	cursor: pointer;
}
.wfsub-signup-form .wfsub-check a { color: inherit; text-decoration: none; }
.wfsub-signup-form .wfsub-check a:hover { text-decoration: underline; }
.wfsub-signup-form .wfsub-plan-line { margin: 0 0 18px; font-size: 1.07em; font-weight: 500; }
.wfsub-signup-form .wfsub-plans { margin: 4px 0 18px; padding: 0; border: 0; }
.wfsub-signup-form .wfsub-plan { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 10px; font-size: 1.07em; font-weight: 500; cursor: pointer; }
.wfsub-signup-form .pms-discount-code-field { margin-bottom: 14px; }
.wfsub-discount-row { display: flex; gap: 10px; align-items: stretch; }
.wfsub-discount-row input[type="text"] { flex: 1 1 auto; text-transform: uppercase; }
.wfsub-discount-row input[type="text"]::placeholder { text-transform: none; }
.wfsub .wfsub-discount-row .wfsub-btn { flex: none; min-width: 122px; padding: 6px 24px; }
.wfsub-discount-msg { margin-top: 8px; font-size: .97em; }
.wfsub-discount-msg:empty { display: none; }
.wfsub-discount-msg p { margin: 0 0 2px; }
.wfsub-discount-ok { font-weight: 600; color: #0b6b3a; }
.wfsub-discount-msg--error { color: var(--wfsub-error); }
.wfsub-signup-form .wfsub-pay-heading {
	margin: 22px 0 14px;
	padding: 0;
	font-family: inherit;
	font-size: 1.6em;
	font-weight: 500;
	line-height: 1.25;
	color: var(--wfsub-text);
}
.wfsub-card-box { padding: 16px; border: 1px solid var(--wfsub-line); border-radius: 4px; background: #fff; }
.wfsub-stripe-element { min-height: 44px; }
.wfsub-recaptcha { margin: 22px 0 0; }
.wfsub-signup-msg { margin-top: 18px; }
.wfsub-signup-msg:empty { display: none; }
.wfsub-signup-form .wfsub-submit { margin: 22px 0 0; }

/* ===== Account: the subscription panel ([pms-account]) ===== */
.wfsub .wfsub-h { margin: 26px 0 12px; font-family: inherit; font-size: 1.3em; font-weight: 600; line-height: 1.3; color: var(--wfsub-text); }
.wfsub .wfsub-sub { margin: 0 0 26px; }
.wfsub .wfsub-sub + .wfsub-sub { padding-top: 22px; border-top: 1px solid var(--wfsub-line); }
.wfsub .wfsub-sub-table { width: auto; max-width: 100%; margin: 0; border: 0; border-collapse: collapse; background: none; }
.wfsub .wfsub-sub-table th,
.wfsub .wfsub-sub-table td {
	padding: 3px 0;
	border: 0;
	background: none;
	font-size: 1.2em;
	line-height: 1.4;
	text-align: left;
	vertical-align: middle;
	color: var(--wfsub-text);
}
.wfsub .wfsub-sub-table th { padding-right: 40px; font-weight: 700; white-space: nowrap; }
.wfsub .wfsub-sub-table td { font-weight: 500; }
.wfsub .wfsub-sub-table .wfsub-btn--sm { margin: 2px 6px 2px 0; font-size: .9em; }
.wfsub .wfsub-sub-table .wfsub-inline { margin: 2px 6px 2px 0; }
.wfsub .wfsub-sub-table .wfsub-inline .wfsub-btn--sm { margin: 0; }
.wfsub .wfsub-sub-table td > .wfsub-btn--sm:first-child { margin-left: 0; }
.wfsub .wfsub-actions { display: inline-flex; flex-wrap: wrap; align-items: center; }
.wfsub .wfsub-ar { display: inline-block; min-width: 2.2em; margin-right: 10px; }
.wfsub-card-brand {
	display: inline-block;
	padding: 2px 6px;
	border-radius: 3px;
	background: #1a1f71;
	color: #fff;
	font-size: .62em;
	font-style: italic;
	font-weight: 800;
	letter-spacing: .02em;
	line-height: 1.5;
	vertical-align: middle;
}
.wfsub-card-brand--mastercard { background: #252525; font-style: normal; }
.wfsub-card-brand--amex { background: #2e77bc; font-style: normal; }
.wfsub-card-num { margin-right: 6px; white-space: nowrap; }
.wfsub-card-exp { margin-right: 8px; white-space: nowrap; }
.wfsub .wfsub-sub .wfsub-notice { margin-top: 14px; }
.wfsub-empty { color: var(--wfsub-muted); }
.wfsub-small { font-size: .93em; }
.wfsub-back { margin-top: 20px; }
.wfsub-back a { color: var(--wfsub-accent); }

/* Tabs, when [pms-account] shows them. */
.wfsub-tabs ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0 0 22px; padding: 0; border-bottom: 1px solid var(--wfsub-line); }
.wfsub-tabs a { display: block; padding: 8px 0; color: var(--wfsub-text); text-decoration: none; border-bottom: 2px solid transparent; }
.wfsub-tab--on a { border-bottom-color: var(--wfsub-accent); font-weight: 600; }

/* Choosing a plan, paying, changing plan, cancelling. */
.wfsub .wfsub-plans { margin: 0 0 20px; padding: 0; border: 0; }
.wfsub .wfsub-plans legend { margin: 0 0 10px; padding: 0; font-weight: 600; }
.wfsub .wfsub-plan { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 2px 12px; margin: 0 0 10px; padding: 14px 16px; border: 1px solid var(--wfsub-line); border-radius: 8px; background: #fff; cursor: pointer; }
.wfsub .wfsub-plan:has(input:checked) { border-color: var(--wfsub-accent); box-shadow: inset 0 0 0 1px var(--wfsub-accent); }
.wfsub-plan-name { font-weight: 600; }
.wfsub-plan-desc { grid-column: 2 / -1; font-size: .93em; color: var(--wfsub-muted); }
.wfsub-ways { list-style: none; display: grid; gap: 10px; margin: 0 0 14px; padding: 0; }
.wfsub-way { display: block; padding: 14px 16px; border: 1px solid var(--wfsub-line); border-radius: 8px; background: #fff; color: inherit; text-decoration: none; }
.wfsub-way:hover, .wfsub-way:focus-visible { border-color: var(--wfsub-accent); box-shadow: inset 0 0 0 1px var(--wfsub-accent); }
.wfsub-way-name { display: block; font-weight: 600; }
.wfsub-way-note { display: block; font-size: .93em; color: var(--wfsub-muted); }
.wfsub-way-chosen { padding: 18px 20px; border: 1px solid var(--wfsub-line); border-radius: 8px; background: #fff; }
.wfsub-way-chosen h4 { margin: 0 0 12px; font-family: inherit; font-size: 1.1em; font-weight: 600; }
.wfsub-pay-msg:empty { display: none; }
.wfsub-pay-msg { margin-top: 14px; }
.wfsub-pay .wfsub-btn--pay { margin-top: 16px; min-width: 200px; }
.wfsub-cancel .wfsub-stack { margin-top: 16px; }

/* Payments table. */
.wfsub .wfsub-table { width: 100%; margin: 0 0 14px; border: 0; border-collapse: collapse; background: none; }
.wfsub .wfsub-table th, .wfsub .wfsub-table td { padding: 10px 12px 10px 0; border: 0; border-bottom: 1px solid var(--wfsub-line); background: none; text-align: left; vertical-align: top; color: var(--wfsub-text); font-size: 1em; }
.wfsub .wfsub-table thead th { font-weight: 700; }

@media (max-width: 600px) {
	.wfsub .wfsub-sub-table, .wfsub .wfsub-sub-table tbody, .wfsub .wfsub-sub-table tr, .wfsub .wfsub-sub-table th, .wfsub .wfsub-sub-table td { display: block; width: 100%; }
	.wfsub .wfsub-sub-table th { padding: 10px 0 0; white-space: normal; }
	.wfsub .wfsub-sub-table td { padding: 0 0 4px; }
	.wfsub-payments thead { display: none; }
	.wfsub-payments tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--wfsub-line); }
	.wfsub .wfsub-payments td { display: flex; justify-content: space-between; padding: 3px 0; border: 0; }
	.wfsub-payments td::before { content: attr(data-label); margin-right: 12px; font-weight: 700; }
	.wfsub-discount-row { flex-wrap: wrap; }
	.wfsub .wfsub-discount-row .wfsub-btn { width: 100%; }
}

/* ===== Restricted content ===== */
.wfsub-restricted { margin: 0 0 20px; padding: 14px 16px; border-radius: 6px; background: var(--wfsub-soft); }
.wppb-user-forms input[type="file"]::file-selector-button {
	margin-right: 12px;
	padding: 6px 16px;
	border: 1px solid var(--wfsub-line);
	border-radius: var(--wfsub-radius);
	background: #fff;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
