/*
 * Companion experience — core tokens and primitives.
 * Shared by signup, the companion workspace and the public profile.
 * Values alias the site tokens in override.css where they already agree.
 */

:root {
	--cx-canvas: var(--bg-primary, #0E0E0E);
	--cx-surface: #181818;
	--cx-raised: #222222;
	--cx-raised-2: #2A2A2A;
	--cx-ink: var(--text-primary, #ECECEC);
	--cx-ink-2: var(--text-secondary, #B4B4B4);
	--cx-ink-3: #9A9A9A;
	--cx-rule: rgba(255, 255, 255, 0.08);
	--cx-rule-strong: rgba(255, 255, 255, 0.14);
	--cx-control: #737373;
	--cx-control-hover: #8A8A8A;
	--cx-accent: #B80F29;
	--cx-accent-hover: #D71936;
	--cx-accent-press: var(--brand-primary-active, #6E0816);
	--cx-on-accent: #F4F4F4;
	--cx-gold: var(--gold-accent, #E6C46A);
	--cx-success: #70D5AB;
	--cx-warning: #E6C46A;
	--cx-error: #FF9B9B;
	--cx-pending: #9DB7F5;
	--cx-font: 'Manrope', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--cx-display: 'Manrope', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--cx-r-control: 8px;
	--cx-r-panel: 8px;
	--cx-r-media: 10px;
	--cx-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	--cx-fast: 150ms;
	--cx-sheet: 220ms;
	--cx-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ------------------------------------------------------------------ */
/* Base text roles                                                     */
/* ------------------------------------------------------------------ */

.cx-title {
	margin: 0;
	font-family: var(--cx-font);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.015em;
	color: var(--cx-ink);
}

.cx-section-title {
	margin: 0;
	font-family: var(--cx-font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var(--cx-ink);
}

.cx-lede,
.cx-body {
	margin: 0;
	font-family: var(--cx-font);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.55;
	color: var(--cx-ink-2);
}

.cx-meta {
	margin: 0;
	font-family: var(--cx-font);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.45;
	color: var(--cx-ink-3);
}

@media (min-width: 900px) {
	.cx-title {
		font-size: 28px;
	}

	.cx-section-title {
		font-size: 22px;
	}
}

.cx-icon {
	display: inline-block;
	flex: 0 0 auto;
	vertical-align: middle;
}

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

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

.cx-btn,
a.cx-btn,
button.cx-btn,
input.cx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	margin: 0;
	padding: 0 20px;
	border: 1px solid var(--cx-control);
	border-radius: var(--cx-r-control);
	background: transparent;
	box-shadow: none;
	color: var(--cx-ink);
	font-family: var(--cx-font);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--cx-fast) var(--cx-ease), border-color var(--cx-fast) var(--cx-ease), color var(--cx-fast) var(--cx-ease);
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.cx-btn:hover {
	border-color: var(--cx-control-hover);
	background: var(--cx-raised);
	color: var(--cx-ink);
	text-decoration: none;
}

.cx-btn--primary,
a.cx-btn--primary,
button.cx-btn--primary,
input.cx-btn--primary {
	border-color: var(--cx-accent);
	background: var(--cx-accent);
	color: var(--cx-on-accent);
}

.cx-btn--primary:hover {
	border-color: var(--cx-accent-hover);
	background: var(--cx-accent-hover);
	color: var(--cx-on-accent);
}

.cx-btn--primary:active {
	background: var(--cx-accent-press);
}

.cx-btn--quiet,
a.cx-btn--quiet,
button.cx-btn--quiet {
	border-color: transparent;
	background: transparent;
	color: var(--cx-ink-2);
	padding: 0 12px;
}

.cx-btn--quiet:hover {
	border-color: transparent;
	background: var(--cx-raised);
	color: var(--cx-ink);
}

.cx-btn--danger:hover {
	border-color: var(--cx-error);
	color: var(--cx-error);
	background: transparent;
}

.cx-btn--sm {
	min-height: 44px;
	padding: 0 14px;
	font-size: 14px;
}

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

.cx-btn[disabled],
.cx-btn[aria-disabled='true'] {
	opacity: 0.55;
	cursor: not-allowed;
}

.cx-btn.is-busy {
	cursor: progress;
}

.cx-btn.is-busy::after {
	content: '';
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: cx-spin 700ms linear infinite;
}

@keyframes cx-spin {
	to {
		transform: rotate(360deg);
	}
}

.cx-link,
a.cx-link {
	color: var(--cx-ink);
	font-family: var(--cx-font);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--cx-control);
	text-underline-offset: 4px;
	text-decoration-thickness: 1px;
	transition: text-decoration-color var(--cx-fast) var(--cx-ease);
}

.cx-link:hover {
	color: var(--cx-ink);
	text-decoration-color: var(--cx-ink);
}

/* One focus language everywhere. */
.cx-btn:focus-visible,
.cx-link:focus-visible,
.cx-row:focus-visible,
.cx-tab:focus-visible,
.cx-nav__link:focus-visible,
.cx-tabbar__link:focus-visible,
.cx-check__input:focus-visible + .cx-check__box,
.cx-choice__input:focus-visible + .cx-choice__body,
.cx-summary:focus-visible,
[data-cx-focus]:focus-visible {
	outline: 2px solid var(--cx-gold) !important;
	outline-offset: 2px !important;
	box-shadow: none !important;
}

/* ------------------------------------------------------------------ */
/* Status                                                              */
/* ------------------------------------------------------------------ */

.cx-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--cx-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--cx-ink-2);
}

.cx-status::before {
	content: '';
	width: 8px;
	height: 8px;
	flex: 0 0 8px;
	border-radius: 50%;
	background: var(--cx-ink-3);
}

.cx-status--success { color: var(--cx-success); }
.cx-status--success::before { background: var(--cx-success); }
.cx-status--warning { color: var(--cx-warning); }
.cx-status--warning::before { background: var(--cx-warning); }
.cx-status--error { color: var(--cx-error); }
.cx-status--error::before { background: var(--cx-error); }
.cx-status--pending { color: var(--cx-pending); }
.cx-status--pending::before { background: var(--cx-pending); }

/* ------------------------------------------------------------------ */
/* Notice                                                              */
/* ------------------------------------------------------------------ */

.cx-notice {
	--cx-tone: var(--cx-ink-3);
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 4px 12px;
	align-items: start;
	padding: 16px;
	border: 1px solid var(--cx-rule);
	border-left: 3px solid var(--cx-tone);
	border-radius: var(--cx-r-panel);
	background: var(--cx-surface);
	font-family: var(--cx-font);
}

.cx-notice > .cx-icon {
	grid-row: span 2;
	margin-top: 2px;
	color: var(--cx-tone);
}

.cx-notice__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--cx-ink);
}

.cx-notice__text {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	color: var(--cx-ink-2);
}

.cx-notice__actions {
	grid-column: 2;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.cx-notice--success { --cx-tone: var(--cx-success); }
.cx-notice--warning { --cx-tone: var(--cx-warning); }
.cx-notice--error { --cx-tone: var(--cx-error); }
.cx-notice--pending { --cx-tone: var(--cx-pending); }

/* ------------------------------------------------------------------ */
/* Rows: a list of destinations or facts separated by hairlines        */
/* ------------------------------------------------------------------ */

.cx-rows {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--cx-rule);
}

.cx-rows > li {
	margin: 0;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid var(--cx-rule);
}

.cx-rows > li::before {
	content: none !important;
}

.cx-row,
a.cx-row,
button.cx-row {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 12px 4px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--cx-ink);
	font-family: var(--cx-font);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--cx-fast) var(--cx-ease);
}

a.cx-row:hover,
button.cx-row:hover {
	background: rgba(255, 255, 255, 0.03);
	color: var(--cx-ink);
	text-decoration: none;
}

.cx-row > .cx-icon:first-child {
	color: var(--cx-ink-2);
}

.cx-row__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.cx-row__meta {
	font-size: 14px;
	font-weight: 500;
	color: var(--cx-ink-3);
}

.cx-row__end {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	color: var(--cx-ink-3);
	font-size: 14px;
	font-weight: 600;
}

.cx-row--done .cx-row__label {
	color: var(--cx-ink-3);
}

.cx-row--done > .cx-icon:first-child {
	color: var(--cx-success);
}

/* ------------------------------------------------------------------ */
/* Tabs: text links with an underline for the current section        */
/* ------------------------------------------------------------------ */

.cx-tabs {
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	border-bottom: 1px solid var(--cx-rule);
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	list-style: none;
}

.cx-tabs::-webkit-scrollbar {
	display: none;
}

.cx-tab,
a.cx-tab,
button.cx-tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	min-height: 48px;
	margin: 0;
	padding: 0 12px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--cx-ink-2);
	font-family: var(--cx-font);
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
}

.cx-tab:hover {
	color: var(--cx-ink);
	background: transparent;
	text-decoration: none;
}

.cx-tab[aria-selected='true'],
.cx-tab[aria-current='page'],
.cx-tab.is-active {
	color: var(--cx-ink);
}

.cx-tab[aria-selected='true']::after,
.cx-tab[aria-current='page']::after,
.cx-tab.is-active::after {
	content: '';
	position: absolute;
	right: 12px;
	bottom: -1px;
	left: 12px;
	height: 2px;
	border-radius: 2px;
	background: var(--cx-ink);
}

.cx-tab__flag {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--cx-error);
}

.cx-tab__flag[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Error summary                                                       */
/* ------------------------------------------------------------------ */

.cx-summary {
	margin: 0 0 24px;
	padding: 16px;
	border: 1px solid rgba(255, 155, 155, 0.35);
	border-left: 3px solid var(--cx-error);
	border-radius: var(--cx-r-panel);
	background: #1C1313;
	font-family: var(--cx-font);
}

.cx-summary[hidden] {
	display: none;
}

.cx-summary__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 8px;
	color: var(--cx-ink);
	font-size: 16px;
	font-weight: 700;
}

.cx-summary__title .cx-icon {
	color: var(--cx-error);
}

.cx-summary__list {
	margin: 0;
	padding: 0 0 0 30px;
	color: var(--cx-ink-2);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.6;
}

.cx-summary__list li {
	margin: 0;
	list-style: disc;
}

.cx-summary__list a {
	color: var(--cx-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Checkbox                                                            */
/* ------------------------------------------------------------------ */

.cx-check {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-height: 44px;
	margin: 0;
	padding: 10px 0;
	color: var(--cx-ink-2);
	font-family: var(--cx-font);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
	text-align: left;
	cursor: pointer;
}

.cx-check__input {
	position: absolute !important;
	width: 22px !important;
	height: 22px !important;
	margin: 0 !important;
	opacity: 0 !important;
	pointer-events: none;
}

.cx-check__box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	margin-top: 1px;
	border: 1.5px solid var(--cx-control-hover);
	border-radius: 6px;
	background: var(--cx-raised);
	color: transparent;
	transition: background-color var(--cx-fast) var(--cx-ease), border-color var(--cx-fast) var(--cx-ease);
}

.cx-check__input:checked + .cx-check__box {
	border-color: var(--cx-ink);
	background: var(--cx-ink);
	color: var(--cx-canvas);
}

.cx-check__label a {
	color: var(--cx-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cx-check.is-invalid .cx-check__box,
.cx-consent.is-invalid .cx-check__box {
	border-color: var(--cx-error);
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                      */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.cx-btn,
	.cx-row,
	.cx-check__box,
	.cx-link {
		transition: none !important;
	}

	.cx-btn.is-busy::after {
		animation-duration: 2s;
	}
}
