/**
 * Reader account screens. Deliberately reuses the child theme's design
 * tokens rather than defining its own palette, so the app follows any
 * future rebrand without a second set of colours to keep in step.
 * Fallback values keep it presentable if the theme is ever swapped out.
 */

.fl-app {
	max-width: 720px;
	margin: 0 auto;
	padding: 2rem 1rem 3rem;
	/* Clears Raptive's bottom sticky ad when one is present. */
	padding-bottom: calc(3rem + var(--fosbas-ad-clearance, 0px));
}

.fl-app .fosbas-library-grid {
	max-width: none;
}

/* Wider, because the pattern grid needs the room the forms do not. */
.fl-screen-home .fl-app {
	max-width: 1100px;
}

/* ------------------------------------------------------------- account bar */

.fl-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	padding: 0 0 1.25rem;
	margin-bottom: 1.75rem;
	border-bottom: 1px solid var(--fosbas-bg-subtle, #EDF2F7);
}

.fl-bar__who {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.fl-bar__hello {
	font-family: var(--fosbas-font-heading, sans-serif);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: var(--fosbas-tracking-tight, -0.02em);
	color: var(--fosbas-text-strongest, #1A202C);
}

.fl-bar__count {
	font-size: 14px;
	color: var(--fosbas-text-subtle, #718096);
}

.fl-bar__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.fl-bar__link {
	padding: 0.4rem 0.9rem;
	border-radius: var(--fosbas-radius-pill, 9999px);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	color: var(--fosbas-text-medium, #4A5568);
	background: var(--fosbas-bg-lighter, #F7FAFC);
	transition: background 0.15s ease, color 0.15s ease;
}

.fl-bar__link:hover,
.fl-bar__link:focus-visible {
	background: var(--fosbas-bg-subtle, #EDF2F7);
	color: var(--fosbas-text-strongest, #1A202C);
}

.fl-bar__link.is-current {
	background: var(--fosbas-accent, #2B6CB0);
	color: #fff;
}

/* ------------------------------------------------------------------- cards */

.fl-card {
	max-width: 420px;
	margin: 0 auto;
	padding: 2rem 1.75rem;
	background: var(--fosbas-white, #fff);
	border: 1px solid var(--fosbas-bg-subtle, #EDF2F7);
	border-radius: var(--fosbas-radius-card-inner, 20px);
	box-shadow: var(--fosbas-shadow-soft, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
}

.fl-card__title {
	margin: 0 0 0.4rem;
	font-family: var(--fosbas-font-heading, sans-serif);
	font-size: 24px;
	font-weight: 700;
	letter-spacing: var(--fosbas-tracking-tight, -0.02em);
	color: var(--fosbas-text-strongest, #1A202C);
}

.fl-card__sub {
	margin: 0 0 1.5rem;
	font-size: 15px;
	line-height: 1.5;
	color: var(--fosbas-text-subtle, #718096);
}

.fl-card__foot {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--fosbas-bg-subtle, #EDF2F7);
	font-size: 14px;
	color: var(--fosbas-text-subtle, #718096);
}

.fl-card__foot a {
	color: var(--fosbas-accent, #2B6CB0);
	font-weight: 600;
	text-decoration: none;
}

.fl-card__foot a:hover {
	text-decoration: underline;
}

/* ------------------------------------------------------------------- forms */

.fl-form label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 14px;
	font-weight: 600;
	color: var(--fosbas-text-strong, #2D3748);
}

.fl-form input[type="text"],
.fl-form input[type="email"],
.fl-form input[type="password"] {
	width: 100%;
	margin-bottom: 1.1rem;
	padding: 0.75rem 0.9rem;
	font-size: 16px; /* below 16px iOS Safari zooms the whole page on focus */
	color: var(--fosbas-text-strongest, #1A202C);
	background: var(--fosbas-bg-lighter, #F7FAFC);
	border: 1px solid var(--fosbas-bg-subtle, #EDF2F7);
	border-radius: var(--fosbas-radius-button, 8px);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fl-form input:focus {
	outline: none;
	background: var(--fosbas-white, #fff);
	border-color: var(--fosbas-accent, #2B6CB0);
	box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.fl-check {
	display: flex !important;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
	font-weight: 500 !important;
	color: var(--fosbas-text-medium, #4A5568) !important;
}

.fl-check input {
	width: auto;
	margin: 0;
}

.fl-hint {
	margin: -0.7rem 0 1.1rem;
	font-size: 13px;
	color: var(--fosbas-text-subtle, #718096);
}

.fl-rule {
	margin: 0.5rem 0 1.25rem;
	border: 0;
	border-top: 1px solid var(--fosbas-bg-subtle, #EDF2F7);
}

/* Off-screen rather than display:none — bots skip fields they can tell are hidden. */
.fl-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ----------------------------------------------------------------- buttons */

.fl-btn {
	display: inline-block;
	padding: 0.8rem 1.6rem;
	font-family: var(--fosbas-font-heading, sans-serif);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: var(--fosbas-button-tracking, 0.04em);
	text-align: center;
	text-decoration: none;
	color: #fff;
	background: var(--fosbas-accent, #2B6CB0);
	border: 0;
	border-radius: var(--fosbas-radius-button, 8px);
	cursor: pointer;
	transition: background 0.15s ease, box-shadow 0.15s ease;
}

.fl-btn:hover,
.fl-btn:focus-visible {
	background: var(--fosbas-accent-alt, #215387);
	box-shadow: var(--fosbas-shadow-accent, 0 4px 24px rgba(43, 108, 176, 0.34));
	color: #fff;
}

.fl-btn--block {
	display: block;
	width: 100%;
}

/* ------------------------------------------------------------------ alerts */

.fl-alert {
	max-width: 420px;
	margin: 0 auto 1.25rem;
	padding: 0.8rem 1rem;
	font-size: 14px;
	line-height: 1.45;
	border-radius: var(--fosbas-radius-button, 8px);
}

.fl-screen-home .fl-alert {
	max-width: none;
}

.fl-alert--error {
	color: #9B2C2C;
	background: #FFF5F5;
	border: 1px solid #FEB2B2;
}

.fl-alert--ok {
	color: #22543D;
	background: #F0FFF4;
	border: 1px solid #9AE6B4;
}

/* ------------------------------------------------------------- empty state */

.fl-empty {
	max-width: 420px;
	margin: 2rem auto;
	text-align: center;
}

.fl-empty__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	margin-bottom: 1.25rem;
	color: var(--fosbas-accent, #2B6CB0);
	background: var(--fosbas-bg-lighter, #F7FAFC);
	border-radius: var(--fosbas-radius-pill, 9999px);
}

.fl-empty h2 {
	margin: 0 0 0.5rem;
	font-family: var(--fosbas-font-heading, sans-serif);
	font-size: 20px;
	font-weight: 700;
	color: var(--fosbas-text-strongest, #1A202C);
}

.fl-empty p {
	margin: 0 0 1.5rem;
	font-size: 15px;
	line-height: 1.6;
	color: var(--fosbas-text-subtle, #718096);
}

@media (max-width: 600px) {
	.fl-app {
		padding-top: 1.25rem;
	}

	.fl-card {
		padding: 1.5rem 1.25rem;
		border: 0;
		box-shadow: none;
	}

	.fl-bar {
		align-items: flex-start;
	}
}

/* ------------------------------------------------------- install prompt */

.fl-install {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin: 1.5rem 0 0;
	padding: 1rem 1.1rem;
	background: var(--fosbas-bg-lighter, #F7FAFC);
	border: 1px solid var(--fosbas-bg-subtle, #EDF2F7);
	border-radius: var(--fosbas-radius-button, 8px);
}

.fl-screen-home .fl-install {
	margin: 0 0 1.75rem;
}

.fl-install__text {
	flex: 1 1 12rem;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	font-size: 14px;
	line-height: 1.45;
}

.fl-install__text strong {
	font-size: 15px;
	color: var(--fosbas-text-strongest, #1A202C);
}

.fl-install__text span {
	color: var(--fosbas-text-subtle, #718096);
}

.fl-install .fl-btn {
	padding: 0.55rem 1.2rem;
	font-size: 14px;
}

.fl-install__steps {
	flex: 1 1 100%;
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--fosbas-text-medium, #4A5568);
}

/* ---------------------------------------------------------------- membership
   The allowance strip, the picker grid and the claimed collection. Sized off
   the same tokens as the rest of the app so a member screen reads as part of
   My Library rather than a bolted-on shop. */

.fl-allowance {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 18px;
	margin: 0 0 22px;
	padding: 14px 18px;
	border: 1px solid var(--fl-line, #e3e8ee);
	border-radius: 12px;
	background: var(--fl-surface-2, #f7f9fb);
}

.fl-allowance__count strong { font-size: 1.5rem; line-height: 1; margin-right: 6px; }
.fl-allowance__meta { color: var(--fl-ink-2, #5b6b7c); font-size: 0.9rem; }

.fl-section-title { margin: 0 0 16px; font-size: 1.25rem; }

.fl-choose-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
}

.fl-choose-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px;
	border: 1px solid var(--fl-line, #e3e8ee);
	border-radius: 12px;
	background: var(--fl-surface, #fff);
}

.fl-choose-card.is-mine { border-color: var(--fl-accent, #2b6cb0); }
.fl-choose-card__thumb { display: block; border-radius: 8px; overflow: hidden; }
.fl-choose-card__thumb img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.fl-choose-card__title { margin: 0; font-size: 0.98rem; line-height: 1.35; }
.fl-choose-card__title a { text-decoration: none; }
.fl-choose-card form { margin: auto 0 0; }
.fl-choose-card__spent { color: var(--fl-ink-3, #8595a6); font-size: 0.85rem; margin-top: auto; }

.fl-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px 0 0; }
.fl-pager__at { color: var(--fl-ink-2, #5b6b7c); font-size: 0.9rem; }

@media (max-width: 480px) {
	.fl-choose-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
}

/* --------------------------------------------------------------- the tiers
   Shown on the membership page via [fosbas_membership]. Three cards that
   stack on a phone, where most of her readers are. */

.fl-tiers {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
	margin: 20px 0;
}

.fl-tier {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px 18px;
	border: 1px solid var(--fl-line, #e3e8ee);
	border-radius: 12px;
	background: var(--fl-surface, #fff);
}

.fl-tier.is-current { border-color: var(--fl-accent, #2b6cb0); border-width: 2px; }

.fl-tier__badge {
	position: absolute;
	top: -11px;
	left: 22px;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 0.72rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: #fff;
	background: var(--fl-accent, #2b6cb0);
}

.fl-tier__name { margin: 0; font-size: 1rem; }
.fl-tier__price { margin: 0; font-size: 0.95rem; }
.fl-tier__price strong { font-size: 1.6rem; line-height: 1; }
.fl-tier__price span { color: var(--fl-ink-2, #5b6b7c); }
.fl-tier__price--tbc { font-size: 1rem !important; color: var(--fl-ink-2, #5b6b7c); font-weight: 600; }
.fl-tier__what { margin: 0; color: var(--fl-ink-2, #5b6b7c); font-size: 0.92rem; }

.fl-tier__list { margin: 2px 0 0; padding: 0 0 0 18px; color: var(--fl-ink-2, #5b6b7c); font-size: 0.87rem; line-height: 1.45; }
.fl-tier__list li { margin: 0 0 3px; }

.fl-tier .fl-btn { margin-top: auto; padding: 0.6rem 1.1rem; }
.fl-tier__soon {
	margin-top: auto;
	padding: 9px 14px;
	border-radius: 8px;
	text-align: center;
	font-size: 0.9rem;
	color: var(--fl-ink-3, #8595a6);
	background: var(--fl-surface-2, #f7f9fb);
}

.fl-tiers__foot { color: var(--fl-ink-2, #5b6b7c); }

/* On the membership page the tiers render inside the theme's .entry-content,
   whose own rule -- .single-content.entry-content a -- matches .fl-btn's
   specificity exactly and wins only by loading later, turning the button
   label blue-on-blue. One extra class outranks it without !important, and
   stays scoped to this page rather than changing every app screen. */
.entry-content .fl-tiers a.fl-btn,
.entry-content .fl-tiers a.fl-btn:hover,
.entry-content .fl-tiers a.fl-btn:focus-visible,
.entry-content .fl-tiers a.fl-btn:visited {
	color: #fff;
	text-decoration: none;
}

/* Secondary button: the extra files in a listing, and paging. Outlined so the
   main download stays the obvious first tap. */
.fl-btn--quiet,
.fl-btn--quiet:visited {
	color: var(--fosbas-accent, #2B6CB0);
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--fosbas-accent, #2B6CB0);
}

.fl-btn--quiet:hover,
.fl-btn--quiet:focus-visible {
	color: #fff;
	background: var(--fosbas-accent, #2B6CB0);
}

/* Band at the top of My Library: what a member has left, or what a free
   account is missing. */
.fl-banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 18px;
	margin: 0 0 22px;
	padding: 14px 18px;
	border: 1px solid var(--fl-line, #e3e8ee);
	border-radius: 12px;
	background: var(--fl-surface-2, #f7f9fb);
}
.fl-banner__text { margin: 0; }

/* The membership page is a decision, not an article: the theme's full-height
   title banner pushes the tiers themselves below the fold on a laptop. */
.fosbas-membership-page .entry-hero-container .entry-header,
.fosbas-membership-page .page-hero-section .entry-header {
	padding-top: 1.6rem;
	padding-bottom: 1.6rem;
}

.fosbas-membership-page .entry-content > p:first-of-type {
	margin-bottom: 0.4rem;
}
