/**
 * Fixvon front end.
 *
 * Every colour is a token defined by Fixvon\Theme, so light and dark share
 * one set of rules. Scoped under .fx so nothing leaks into the theme.
 * Contrast pairs are verified against WCAG AA.
 */

.fx {
	--fx-radius: 10px;
	--fx-radius-sm: 8px;
	--fx-gap: 16px;

	color: var(--fx-text);
	background: transparent;
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.fx *,
.fx *::before,
.fx *::after { box-sizing: border-box; }

.fx em { font-style: normal; color: var(--fx-text-muted); font-size: 13px; }
.fx a { color: var(--fx-info); }
.fx .fx-red { color: var(--fx-danger); }
.fx-empty { color: var(--fx-text-muted); padding: 24px 0; }
.fx-hint { color: var(--fx-text-muted); font-size: 13px; }
.fx-muted { color: var(--fx-text-muted); }

/* Focus is never removed, only restyled. 3:1 against the surface. */
.fx :focus-visible {
	outline: 3px solid var(--fx-focus);
	outline-offset: 2px;
	border-radius: 4px;
}

.fx-visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

/* Brand ---------------------------------------------------------------- */

.fx-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.fx-logo-mark {
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; border-radius: var(--fx-radius-sm);
	background: var(--fx-accent); color: var(--fx-accent-text); font-weight: 800;
}
.fx-logo-img { max-height: 40px; width: auto; }

/* Theme toggle --------------------------------------------------------- */

.fx-theme-toggle {
	display: inline-flex; align-items: center; gap: 4px;
	padding: 4px; border: 1px solid var(--fx-border);
	border-radius: 999px; background: var(--fx-surface-2);
}
.fx-theme-toggle button {
	min-width: 44px; min-height: 36px; padding: 6px 12px;
	border: 0; border-radius: 999px; background: transparent;
	color: var(--fx-text-muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.fx-theme-toggle button[aria-pressed="true"] {
	background: var(--fx-surface); color: var(--fx-text);
	box-shadow: 0 1px 2px var(--fx-shadow);
}

/* KPIs ----------------------------------------------------------------- */

.fx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--fx-gap); margin-bottom: 18px; }
.fx-kpi {
	display: flex; flex-direction: column; gap: 4px; padding: 20px;
	background: var(--fx-surface); border: 1px solid var(--fx-border);
	border-radius: var(--fx-radius);
}
.fx-kpi strong { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fx-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fx-text-muted); }

/* Cards ---------------------------------------------------------------- */

.fx-card {
	padding: 20px; margin-bottom: 18px;
	background: var(--fx-surface); border: 1px solid var(--fx-border);
	border-radius: var(--fx-radius);
}
.fx-card h3 { margin: 0 0 14px; font-size: 17px; font-weight: 600; color: var(--fx-text); }

/* Lists ---------------------------------------------------------------- */

.fx-list { list-style: none; margin: 0; padding: 0; }
.fx-list li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--fx-border); }
.fx-list li:last-child { border-bottom: 0; }
.fx-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fx-amt { text-align: right; font-weight: 600; display: flex; flex-direction: column; }

.fx-tile {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: var(--fx-radius-sm);
	background: var(--fx-brand); color: var(--fx-brand-text);
	font-weight: 700; flex: 0 0 auto;
}

/* Tables --------------------------------------------------------------- */

.fx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fx-table caption { text-align: left; padding-bottom: 10px; color: var(--fx-text-muted); font-size: 13px; }
.fx-table th {
	text-align: left; padding: 10px 8px; font-size: 11px;
	letter-spacing: .06em; text-transform: uppercase;
	color: var(--fx-text-muted); border-bottom: 1px solid var(--fx-border-strong);
}
.fx-table td { padding: 14px 8px; border-bottom: 1px solid var(--fx-border); vertical-align: middle; }
.fx-table tr.is-dim { opacity: .6; }
.fx-table td strong { display: inline-block; margin-left: 4px; }

/* Badges --------------------------------------------------------------- */

.fx-badge {
	display: inline-block; padding: 4px 10px; border-radius: 999px;
	font-size: 11px; font-weight: 700;
	background: var(--fx-surface-2); color: var(--fx-text-muted);
	border: 1px solid transparent;
}
.fx-badge.is-active, .fx-badge.is-paid, .fx-badge.is-sent,
.fx-badge.is-verified, .fx-badge.is-resolved { background: var(--fx-success-bg); color: var(--fx-success); }
.fx-badge.is-paused, .fx-badge.is-pending, .fx-badge.is-draft { background: var(--fx-warning-bg); color: var(--fx-warning); }
.fx-badge.is-cancelled, .fx-badge.is-suspended, .fx-badge.is-failed { background: var(--fx-danger-bg); color: var(--fx-danger); }
.fx-badge.is-scheduled, .fx-badge.is-open, .fx-badge.is-in_progress { background: var(--fx-info-bg); color: var(--fx-info); }

/* Meters and bars ------------------------------------------------------ */

.fx-meter { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.fx-track { flex: 1; min-width: 90px; height: 8px; background: var(--fx-surface-2); border: 1px solid var(--fx-border); border-radius: 999px; overflow: hidden; }
.fx-track i { display: block; height: 100%; background: var(--fx-brand); }
.fx-meter.is-warning .fx-track i { background: var(--fx-warning); }
.fx-meter.is-danger .fx-track i { background: var(--fx-danger); }

.fx-bars { list-style: none; margin: 0; padding: 0; }
.fx-bars li { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: 14px; }
.fx-bars li span { flex: 0 0 140px; }
.fx-bars li strong { flex: 0 0 90px; text-align: right; font-variant-numeric: tabular-nums; }

/* Notices and upsell --------------------------------------------------- */

.fx-note {
	padding: 16px 18px; margin-bottom: 18px;
	border-radius: var(--fx-radius); border-left: 4px solid var(--fx-border-strong);
	background: var(--fx-surface-2); color: var(--fx-text);
}
.fx-note strong { display: block; }
.fx-note p { margin: 4px 0 10px; font-size: 14px; color: var(--fx-text-muted); }
.fx-note.is-success { background: var(--fx-success-bg); border-color: var(--fx-success); }
.fx-note.is-warning { background: var(--fx-warning-bg); border-color: var(--fx-warning); }
.fx-note.is-danger  { background: var(--fx-danger-bg);  border-color: var(--fx-danger); }
.fx-note.is-info    { background: var(--fx-info-bg);    border-color: var(--fx-info); }
.fx-note.is-success strong, .fx-note.is-warning strong,
.fx-note.is-danger strong,  .fx-note.is-info strong { color: var(--fx-text); }

.fx-locked {
	display: flex; flex-direction: column; align-items: center; gap: 12px;
	padding: 32px 20px; text-align: center;
	background: var(--fx-surface-2); border: 1px dashed var(--fx-border-strong);
	border-radius: var(--fx-radius);
}
.fx-locked p { margin: 0; font-size: 14px; max-width: 46ch; }
.fx-chip {
	display: inline-block; padding: 4px 11px; border-radius: 999px;
	background: var(--fx-accent); color: var(--fx-accent-text);
	font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}

.fx-inline-lock { padding: 16px; border: 1px dashed var(--fx-border-strong); border-radius: var(--fx-radius); margin-bottom: 16px; background: var(--fx-surface-2); }
.fx-inline-lock label.is-off { opacity: .7; }
.fx-inline-lock small { display: block; margin-top: 6px; color: var(--fx-text-muted); }

/* Buttons — 44px minimum target ---------------------------------------- */

.fx-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 11px 20px;
	border: 1px solid transparent; border-radius: var(--fx-radius);
	background: var(--fx-action); color: var(--fx-action-text) !important;
	font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.fx-btn:hover { filter: brightness(.94); }
.fx-btn.is-ghost { background: transparent; color: var(--fx-text) !important; border-color: var(--fx-border-strong); }
.fx-btn.is-brand { background: var(--fx-brand); color: var(--fx-brand-text) !important; }
.fx-btn[disabled], .fx-btn.is-disabled { opacity: .6; cursor: not-allowed; }

.fx-link-danger {
	background: none; border: 0; padding: 6px 2px; min-height: 44px;
	color: var(--fx-danger); font-size: 14px; cursor: pointer; text-decoration: underline;
}

.fx-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--fx-gap); flex-wrap: wrap; margin-bottom: var(--fx-gap); }

/* Forms ---------------------------------------------------------------- */

.fx-form { max-width: 560px; }
.fx-form label { display: block; margin-bottom: 16px; font-size: 14px; font-weight: 600; }
.fx-form input,
.fx-form select,
.fx-form textarea {
	display: block; width: 100%; margin-top: 6px;
	min-height: 44px; padding: 11px 13px;
	border: 1px solid var(--fx-border-strong); border-radius: var(--fx-radius-sm);
	background: var(--fx-surface); color: var(--fx-text);
	font-size: 15px; font-weight: 400; font-family: inherit;
}
.fx-form input::placeholder, .fx-form textarea::placeholder { color: var(--fx-text-muted); }
.fx-form textarea { min-height: 110px; }
.fx-form input[aria-invalid="true"] { border-color: var(--fx-danger); border-width: 2px; }
.fx-field-error { display: block; margin-top: 4px; color: var(--fx-danger); font-size: 13px; font-weight: 600; }
.fx-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.fx-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: 14px; }
.fx-check input { width: auto !important; min-height: 0; margin-top: 3px; }

.fx-dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.fx-dl dt { color: var(--fx-text-muted); }
.fx-dl dd { margin: 0; font-weight: 600; }

/* Plans ---------------------------------------------------------------- */

.fx-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--fx-gap); }
.fx-plan {
	padding: 26px 22px; background: var(--fx-surface);
	border: 1px solid var(--fx-border); border-radius: var(--fx-radius);
}
.fx-plan.is-current { border-color: var(--fx-brand); border-width: 2px; }
.fx-plan h3 { margin: 10px 0 6px; font-size: 19px; }
.fx-price { margin: 0 0 4px; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fx-limit { margin: 0 0 16px; color: var(--fx-text-muted); font-size: 14px; }
.fx-plan ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.fx-plan li { padding: 6px 0 6px 24px; position: relative; }
.fx-plan li.has::before { content: "✓"; position: absolute; left: 0; color: var(--fx-success); font-weight: 700; }
.fx-plan li.hasnt { color: var(--fx-text-muted); }
.fx-plan li.hasnt::before { content: "—"; position: absolute; left: 0; }

/* Auth ----------------------------------------------------------------- */

.fx-auth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: var(--fx-gap); align-items: start; }

.fx .login-username, .fx .login-password, .fx .login-remember, .fx .login-submit { margin-bottom: 16px; }
.fx .login-username label, .fx .login-password label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.fx .login-username input, .fx .login-password input {
	width: 100%; min-height: 44px; padding: 11px 13px;
	border: 1px solid var(--fx-border-strong); border-radius: var(--fx-radius-sm);
	background: var(--fx-surface); color: var(--fx-text); font-size: 15px;
}
.fx .login-remember { font-size: 14px; }
.fx .login-remember input { width: auto; margin-right: 8px; }
.fx .login-submit input {
	min-height: 44px; padding: 11px 20px; border: 0; border-radius: var(--fx-radius);
	background: var(--fx-action); color: var(--fx-action-text);
	font-size: 15px; font-weight: 600; cursor: pointer;
}

/* FAQs, roadmap, catalog ----------------------------------------------- */

.fx-faq { border-bottom: 1px solid var(--fx-border); padding: 14px 0; }
.fx-faq:last-child { border-bottom: 0; }
.fx-faq summary { cursor: pointer; font-weight: 600; font-size: 15px; min-height: 44px; display: flex; align-items: center; }
.fx-faq div { padding-top: 8px; color: var(--fx-text-muted); font-size: 14px; }

.fx-kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--fx-gap); }
.fx-col h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--fx-text-muted); }
.fx-kcard { padding: 15px; margin-bottom: 10px; background: var(--fx-surface); border: 1px solid var(--fx-border); border-radius: var(--fx-radius); }
.fx-kcard p { margin: 5px 0 9px; font-size: 13px; color: var(--fx-text-muted); }

.fx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: var(--fx-gap); }
.fx-scard { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 17px; background: var(--fx-surface); border: 1px solid var(--fx-border); border-radius: var(--fx-radius); }
.fx-scard strong { font-size: 15px; }

/* Responsive and motion ------------------------------------------------ */

@media (max-width: 640px) {
	.fx-row { grid-template-columns: 1fr; }
	.fx-table { display: block; overflow-x: auto; }
	.fx-bars li span { flex: 0 0 95px; }
	.fx-dl { grid-template-columns: 1fr; gap: 2px 0; }
	.fx-dl dd { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.fx *, .fx *::before, .fx *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}

@media (prefers-contrast: more) {
	.fx { --fx-border: var(--fx-border-strong); }
}

/* Header and footer ----------------------------------------------------- */

.fx-shell { position: relative; }

.fx-skip {
	position: absolute; left: -9999px; top: 0; z-index: 100;
	padding: 12px 20px; background: var(--fx-accent); color: var(--fx-accent-text);
	font-weight: 700; border-radius: 0 0 var(--fx-radius-sm) 0;
}
.fx-skip:focus { left: 0; }

.fx-header {
	background: var(--fx-surface);
	border-bottom: 1px solid var(--fx-border);
}
.fx-header.is-sticky { position: sticky; top: 0; z-index: 40; }

.fx-header-inner {
	display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
	max-width: 1280px; margin: 0 auto; padding: 14px 24px; min-height: 72px;
}

.fx-header-logo { text-decoration: none; color: var(--fx-text); }
.fx-header-logo:hover { text-decoration: none; }

.fx-header-nav { margin-left: auto; }
.fx-header-nav ul { display: flex; flex-wrap: wrap; gap: 28px; list-style: none; margin: 0; padding: 0; }
.fx-header-nav a {
	display: inline-flex; align-items: center; min-height: 44px;
	color: var(--fx-text-muted); font-size: 15px; font-weight: 500; text-decoration: none;
}
.fx-header-nav a:hover { color: var(--fx-text); text-decoration: underline; }
.fx-header-nav a[aria-current="page"] {
	color: var(--fx-text); font-weight: 700;
	box-shadow: inset 0 -2px 0 var(--fx-accent);
}

.fx-header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.fx-header-link {
	display: inline-flex; align-items: center; min-height: 44px;
	color: var(--fx-text-muted); font-size: 15px; font-weight: 600; text-decoration: none;
}
.fx-header-link:hover { color: var(--fx-text); text-decoration: underline; }

.fx-account { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fx-account-name { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; }
.fx-avatar-sm {
	display: grid; place-items: center; width: 32px; height: 32px;
	border-radius: 50%; background: var(--fx-brand); color: var(--fx-brand-text);
	font-size: 13px; font-weight: 700;
}

.fx-footer { margin-top: 48px; padding: 56px 0 28px; background: var(--fx-surface); border-top: 1px solid var(--fx-border); }
.fx-footer-inner {
	display: grid; grid-template-columns: 2fr repeat(auto-fit, minmax(150px, 1fr));
	gap: 36px; max-width: 1280px; margin: 0 auto; padding: 0 24px;
}
.fx-footer-about p { margin-top: 14px; font-size: 14px; color: var(--fx-text-muted); max-width: 320px; }
.fx-footer h2 { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fx-text-muted); }
.fx-footer nav ul { list-style: none; margin: 0; padding: 0; }
.fx-footer nav li a {
	display: inline-flex; align-items: center; min-height: 40px;
	font-size: 15px; color: var(--fx-text); text-decoration: none;
}
.fx-footer nav li a:hover { text-decoration: underline; }

.fx-footer-bottom {
	display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
	max-width: 1280px; margin: 40px auto 0; padding: 22px 24px 0;
	border-top: 1px solid var(--fx-border);
	font-size: 14px; color: var(--fx-text-muted);
}
.fx-footer-bottom p { margin: 0; }
.fx-footer-social { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.fx-footer-social a {
	display: inline-flex; align-items: center; min-height: 44px;
	font-size: 14px; color: var(--fx-text); text-decoration: none;
}

@media (max-width: 900px) {
	.fx-header-nav { order: 3; width: 100%; margin-left: 0; }
	.fx-header-nav ul { gap: 18px; }
	.fx-header-inner { gap: 12px; }
	.fx-footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
	.fx-footer-inner { grid-template-columns: 1fr; }
	.fx-account-name { display: none; }
}

/* Page heading on member screens --------------------------------------- */

.fx-page-head { margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--fx-border); }
.fx-page-head h1 { margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; }

/* Newsletter ------------------------------------------------------------ */

.fx-newsletter {
	display: grid; grid-template-columns: 1fr minmax(280px, 440px);
	gap: 24px; align-items: center;
	width: 90%; max-width: 1600px; margin: 40px auto 0;
	padding: 26px 0 0; border-top: 1px solid var(--fx-border);
}
.fx-newsletter h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.fx-newsletter p { margin: 0; font-size: 14px; color: var(--fx-text-muted); }
.fx-newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.fx-newsletter-form input[type="email"] {
	flex: 1 1 200px; min-height: 48px; padding: 12px 14px;
	border: 1px solid var(--fx-border-strong); border-radius: var(--fx-radius-sm);
	background: var(--fx-surface); color: var(--fx-text); font-size: 15px;
}
.fx-newsletter .fx-note { margin: 0; }

/* Footer: four columns beside the about block */
.fx-footer-inner { width: 90%; max-width: 1600px; padding: 0; grid-template-columns: 1.6fr repeat(4, 1fr); }
.fx-footer-bottom { width: 90%; max-width: 1600px; padding: 22px 0 0; }

@media (max-width: 1000px) {
	.fx-footer-inner { grid-template-columns: 1fr 1fr; }
	.fx-newsletter { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.fx-footer-inner { grid-template-columns: 1fr; }
}
