/*
 * Theme styling for contentlab-billing's portal.
 *
 * portal.css is deliberately restrained: it sets layout and spacing and
 * almost no typography or colour. This file supplies what it left out. It
 * EXTENDS portal.css and does not replace it, so the plugin can be updated
 * without this file being rewritten.
 *
 * Three rules are load-bearing rather than cosmetic. portal.css styles
 * .clab-button-primary, .clab-toggle.is-on and .clab-plan-flag as
 * `background: currentColor` alongside `color: #fff`, which resolves to
 * white on white on any site that does not override it.
 */

/* ===================================================================
   SHARED
   =================================================================== */

.clab-pricing, .clab-form, .clab-account {
	font-family: var(--rcl-text);
	color: var(--rcl-ink-2);
}
.clab-pricing { max-width: 76rem; }

.clab-account h2, .clab-form h2, .clab-pricing h3 {
	font-family: var(--rcl-display);
	font-weight: 800;
	letter-spacing: -.022em;
	color: var(--rcl-ink);
}

.clab-form h2 {
	font-size: 1.4rem;
	margin: 2.75rem 0 1.25rem;
	padding-bottom: .7rem;
	border-bottom: 1px solid var(--rcl-line);
}
.clab-form h2:first-of-type { margin-top: 0; }
.clab-form h3 {
	font-family: var(--rcl-display);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--rcl-ink-3);
	margin: 0 0 .8rem;
}

.clab-muted { color: var(--rcl-ink-2); opacity: 1; }
.clab-hint { font-size: .875rem; color: var(--rcl-ink-3); opacity: 1; line-height: 1.5; }


/* ===================================================================
   INTERVAL TOGGLE
   =================================================================== */

.clab-interval-toggle {
	border: 1px solid var(--rcl-line-strong);
	border-radius: 999px;
	padding: 4px;
	gap: 4px;
	opacity: 1;
	background: var(--rcl-ground-2);
}
.clab-toggle {
	font-family: var(--rcl-display);
	font-size: .9375rem;
	font-weight: 700;
	color: var(--rcl-ink-3);
	border-radius: 999px;
	padding: .6em 1.5em;
	transition: background-color .18s ease, color .18s ease;
}
.clab-toggle:hover { color: var(--rcl-ink); }
/* Load-bearing: portal.css leaves this white on white. */
.clab-toggle.is-on { background: var(--rcl-ink); color: var(--rcl-ground); }


/* ===================================================================
   PLAN CARDS
   =================================================================== */

.clab-plan-grid { gap: 1.5rem; }

.clab-plan {
	border: 1px solid var(--rcl-line);
	border-radius: var(--rcl-r);
	background: var(--rcl-card);
	padding: 2.25rem 1.9rem 2rem;
	box-shadow: var(--rcl-shadow-sm);
}

/* The featured plan is the black card. Red stays on its button. */
.clab-plan.is-featured {
	border-width: 1px;
	border-color: transparent;
	background:
		radial-gradient(30rem 20rem at 110% -20%, rgba(200,38,42,.4), transparent 60%),
		#0B0B0D;
	color: #B4B4BC;
	box-shadow: var(--rcl-shadow-lg);
}
.clab-plan.is-featured .clab-plan-name,
.clab-plan.is-featured .clab-amount { color: #FFFFFF; }
.clab-plan.is-featured .clab-plan-blurb,
.clab-plan.is-featured .clab-features li { color: #C4C4CB; }
.clab-plan.is-featured .clab-per { color: #9A9AA3; }

/* Load-bearing. */
.clab-plan-flag {
	background: var(--rcl-red);
	color: var(--rcl-on-red);
	font-family: var(--rcl-display);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: .45em .9em;
	border-radius: 999px;
	top: -.85rem;
}

.clab-plan-name { font-size: 1.5rem; margin-bottom: .35rem; }
.clab-plan-blurb {
	/* Two lines' height whether a blurb needs it or not, so the prices in a
	   row of cards sit on one line. */
	min-height: 3.1em;
	font-size: .975rem;
	line-height: 1.55;
	color: var(--rcl-ink-2);
	opacity: 1;
	margin-bottom: 1.5rem;
}
.clab-price { margin-bottom: .4rem; }
.clab-amount {
	font-family: var(--rcl-display);
	font-weight: 800;
	font-size: clamp(2.75rem, 4vw, 3.4rem);
	letter-spacing: -.04em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--rcl-ink);
}
.clab-per {
	display: block;
	font-size: .9375rem;
	font-weight: 600;
	color: var(--rcl-ink-3);
	opacity: 1;
	margin-top: .4rem;
}
.clab-saving { font-size: .875rem; font-weight: 700; color: var(--rcl-red-ink); opacity: 1; margin-top: .5rem; }
.clab-plan.is-featured .clab-saving { color: #FF7377; }

.clab-features { font-size: .975rem; line-height: 1.5; margin: 1.6rem 0; }
.clab-features li { padding: 0 0 0 1.75rem; color: var(--rcl-ink-2); margin-bottom: .7rem; }
.clab-features li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .2em;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	opacity: 1;
	background: var(--rcl-red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 70% no-repeat;
}

.clab-addons-note h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 1.25rem; }
.clab-addons-note ul { list-style: none; padding: 0; }
.clab-addons-note ul > li {
	padding: 1.1rem 1.25rem 1.1rem 3rem;
	border: 1px solid var(--rcl-line);
	border-radius: var(--rcl-r-sm);
	background: var(--rcl-card);
	margin-bottom: .75rem;
	font-size: .975rem;
}
/* The theme's list marker sits from the top of the item; these rows have
   padding, so it has to be pushed down and in by the same amount. */
.clab-addons-note ul > li::before { top: calc(1.1rem + .3em); left: 1.1rem; }
.clab-addons-note strong { font-family: var(--rcl-display); font-weight: 700; color: var(--rcl-ink); }


/* ===================================================================
   FORMS
   =================================================================== */

.clab-field label {
	font-family: var(--rcl-display);
	font-weight: 700;
	font-size: .9375rem;
	color: var(--rcl-ink);
	margin-bottom: .45rem;
}
.clab-field input[type="text"],
.clab-field input[type="email"],
.clab-field input[type="url"],
.clab-field input[type="password"] {
	font-family: var(--rcl-text);
	font-size: 1rem;
	color: var(--rcl-ink);
	background: var(--rcl-field);
	border: 1.5px solid var(--rcl-line-strong);
	border-radius: var(--rcl-r-sm);
	padding: .85rem 1rem;
}
.clab-field input:focus { border-color: var(--rcl-red-ink); }
.clab-field input:focus-visible { outline: 2px solid var(--rcl-red-ink); outline-offset: 1px; }

/* Stripe's iframe cannot take an outline, so the card row draws its own. */
.clab-card-element {
	background: var(--rcl-field);
	border: 1.5px solid var(--rcl-line-strong);
	border-radius: var(--rcl-r-sm);
	padding: .95rem 1rem;
}
.clab-card-element.StripeElement--focus { border-color: var(--rcl-red-ink); box-shadow: 0 0 0 2px var(--rcl-red-ink); }

.clab-plan-option {
	border: 1.5px solid var(--rcl-line);
	border-radius: var(--rcl-r-sm);
	padding: 1rem 1.15rem;
	background: var(--rcl-card);
	transition: border-color .16s ease, background-color .16s ease;
}
.clab-plan-option:hover { border-color: var(--rcl-line-strong); }
.clab-plan-option.is-on {
	border-color: var(--rcl-red);
	border-width: 1.5px;
	padding: 1rem 1.15rem;
	background: var(--rcl-red-soft);
}
.clab-plan-option-name { font-family: var(--rcl-display); font-weight: 700; color: var(--rcl-ink); }
.clab-plan-option-price { font-size: .9rem; font-weight: 600; color: var(--rcl-ink-2); opacity: 1; font-variant-numeric: tabular-nums; }

.clab-addon { padding: .8rem 0; border-bottom: 1px solid var(--rcl-line); font-size: .975rem; }
.clab-addon:last-child { border-bottom: 0; }
.clab-addon strong { font-family: var(--rcl-display); font-weight: 700; }
.clab-addon-price { font-size: .875rem; font-weight: 600; color: var(--rcl-ink-2); opacity: 1; }

.clab-total {
	border-top: 1px solid var(--rcl-line-strong);
	font-family: var(--rcl-display);
	font-weight: 700;
	font-size: 1.3rem;
	color: var(--rcl-ink);
	padding-top: 1.2rem;
}
.clab-total strong { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }


/* ===================================================================
   BUTTONS
   =================================================================== */

.clab-button,
.clab-button:visited {
	font-family: var(--rcl-display);
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.2;
	padding: .95rem 1.6rem;
	border-radius: 999px;
	border: 1.5px solid var(--rcl-line-strong);
	color: var(--rcl-ink);
	background: transparent;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.clab-button:hover, .clab-button:focus-visible { border-color: var(--rcl-ink); background: var(--rcl-ground-2); }

/* Load-bearing: portal.css leaves this white on white. */
.clab-button-primary,
.clab-button-primary:visited {
	background: var(--rcl-red);
	border-color: var(--rcl-red);
	color: var(--rcl-on-red);
}
.clab-button-primary:hover:not(:disabled),
.clab-button-primary:focus-visible:not(:disabled) {
	background: var(--rcl-red-deep);
	border-color: var(--rcl-red-deep);
	color: #FFFFFF;
}
.clab-button-primary:disabled { opacity: .55; }

/* The form's own submit (Start, Sign in) fills the form, as portal.css
   intends. Written at (0,2,1) so the theme's generic submit-button rule,
   which sets width:auto for content forms, does not shrink it. */
.clab-form button.clab-button-primary { width: 100%; padding: 1rem 1.6rem; }

/* The plan CTAs fill the card. Only the featured plan's is red, so the
   pricing page still has one loudest button. */
.clab-plan .clab-plan-cta { width: 100%; }
.clab-plan.is-featured .clab-plan-cta {
	background: var(--rcl-red);
	border-color: var(--rcl-red);
	color: #FFFFFF;
}
.clab-plan.is-featured .clab-plan-cta:hover { background: var(--rcl-red-deep); border-color: var(--rcl-red-deep); }

.clab-link {
	font-family: var(--rcl-display);
	font-weight: 700;
	color: var(--rcl-red-ink);
	text-decoration: none;
	border-bottom: 2px solid currentColor;
	padding-bottom: 1px;
}
.clab-link-quiet {
	font-family: var(--rcl-text);
	font-size: .875rem;
	font-weight: 600;
	color: var(--rcl-ink-3);
	opacity: 1;
	border-bottom-color: transparent;
}
.clab-link-quiet:hover { color: var(--rcl-ink); border-bottom-color: var(--rcl-line-strong); }


/* ===================================================================
   NOTICES
   =================================================================== */

.clab-notice {
	border: 1px solid var(--rcl-line);
	border-left: 4px solid var(--rcl-line-strong);
	border-radius: var(--rcl-r-sm);
	background: var(--rcl-ground-2);
	padding: 1rem 1.25rem;
	font-size: .975rem;
	line-height: 1.55;
}
.clab-notice-error { border-left-color: var(--rcl-bad); }
.clab-notice-warn { border-left-color: var(--rcl-warn); }


/* Signed out, Your account shows the sign-in form. The page itself carries
   no card (the signed-in account draws its own cards), so the form gets one
   here, matching the Sign in page. */
.rcl-portal-account .clab-login {
	background: var(--rcl-card);
	border: 1px solid var(--rcl-line);
	border-radius: var(--rcl-r);
	box-shadow: var(--rcl-shadow-sm);
	padding: clamp(1.6rem, 2.4vw, 2.25rem);
}

/* ===================================================================
   ACCOUNT
   =================================================================== */

.clab-account > h2 { font-size: clamp(2rem, 3.4vw, 2.75rem); margin-bottom: 2rem; }
.clab-account h2 + h2, .clab-account .clab-table + h2 { margin-top: 3.5rem; }

.clab-sub-card {
	border: 1px solid var(--rcl-line);
	border-radius: var(--rcl-r);
	background: var(--rcl-card);
	padding: 2rem 1.9rem;
	margin-bottom: 1.5rem;
	box-shadow: var(--rcl-shadow-sm);
}
.clab-sub-card h3 { font-family: var(--rcl-display); font-weight: 800; font-size: 1.75rem; letter-spacing: -.025em; margin-bottom: .35rem; color: var(--rcl-ink); }
.clab-sub-price { font-family: var(--rcl-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--rcl-ink); }

.clab-entitlements { display: grid; gap: .4rem; margin: 1rem 0; font-size: 1rem; }
.clab-entitlements li { color: var(--rcl-ink-2); }
.clab-entitlements strong { font-family: var(--rcl-display); font-weight: 800; color: var(--rcl-red-ink); font-variant-numeric: tabular-nums; }

.clab-table { font-size: .975rem; }
.clab-table th {
	font-family: var(--rcl-display);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--rcl-ink-3);
	border-bottom: 1px solid var(--rcl-line-strong);
	padding: .6rem .7rem;
}
.clab-table td { border-bottom: 1px solid var(--rcl-line); padding: .8rem .7rem; font-variant-numeric: tabular-nums; }


/* ===================================================================
   THE DOWNLOAD BOX

   Until a station connects they are paying and receiving nothing, so this
   is the loudest thing on the page. The plugin swaps in
   .clab-download-done the moment they connect.
   =================================================================== */

.clab-download {
	border: 0;
	border-radius: var(--rcl-r);
	background:
		radial-gradient(30rem 20rem at 110% -30%, rgba(255,255,255,.2), transparent 60%),
		var(--rcl-red);
	color: rgba(255,255,255,.9);
	box-shadow: 0 30px 60px -30px rgba(200,38,42,.75);
	padding: 1.9rem 2rem;
	margin: 1.75rem 0;
}
/* The plugin's own heading here is "One thing to do": set as a label. */
.clab-download h4 {
	font-family: var(--rcl-display);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #FFFFFF;
	margin-bottom: .7rem;
}
.clab-download:not(.clab-download-done) > p:first-of-type {
	font-family: var(--rcl-display);
	font-weight: 700;
	font-size: 1.35rem;
	letter-spacing: -.015em;
	line-height: 1.3;
	color: #FFFFFF;
	margin-bottom: 1.2rem;
}
.clab-download p { font-size: .975rem; color: rgba(255,255,255,.9); line-height: 1.6; max-width: 36rem; }
.clab-download .clab-hint { color: rgba(255,255,255,.82); margin-top: 1.1rem; }
.clab-download .clab-button-primary { background: #0B0B0D; border-color: #0B0B0D; }
.clab-download .clab-button-primary:hover { background: #000; border-color: #000; }

/* Connected: the box steps back. */
.clab-download-done {
	background: var(--rcl-ground-2);
	color: var(--rcl-ink-2);
	box-shadow: none;
	border: 1px solid var(--rcl-line);
	padding: 1rem 1.25rem;
}
.clab-download-done p { color: var(--rcl-ink-2); }
.clab-download-done a { color: var(--rcl-red-ink); }
