/*
 * The controls: buttons, surfaces, chips, form fields, and the utility classes.
 *
 * Everything here is used on both the marketing pages and the dashboard, which
 * is the line this file is drawn on. The utilities are last on purpose -- they
 * are the deliberate override, so they have to win a specificity tie against
 * anything above them, and that only holds if they load last.
 */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 18px;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	white-space: nowrap;
	transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.btn:hover {
	background: var(--accent-strong);
	transform: translateY(-1px);
	box-shadow: 0 8px 22px var(--accent-glow);
}

.btn:active { transform: translateY(0); }

.btn:disabled,
.btn[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: var(--radius); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.btn-ghost {
	background: transparent;
	border-color: var(--line-strong);
	color: var(--text-dim);
}

.btn-ghost:hover {
	background: var(--panel);
	color: var(--text);
	box-shadow: none;
}

.btn-quiet {
	background: var(--panel);
	border-color: var(--line);
	color: var(--text);
}

.btn-quiet:hover { background: var(--panel-hover); box-shadow: none; }

.btn-danger { background: var(--bad); }
.btn-danger:hover { background: #c0393b; box-shadow: 0 8px 22px rgba(237, 66, 69, 0.3); }

.btn-discord::before {
	content: "";
	width: 18px;
	height: 18px;
	flex: none;
	background: currentColor;
	-webkit-mask: var(--discord-mask) center / contain no-repeat;
	mask: var(--discord-mask) center / contain no-repeat;
}

:root {
	--discord-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127 96'><path d='M107 8A105 105 0 0 0 81 0l-3 7a97 97 0 0 0-29 0l-4-7a105 105 0 0 0-26 8C2 33-1 57 1 81a106 106 0 0 0 32 16l6-11a69 69 0 0 1-11-5l3-2a75 75 0 0 0 64 0l3 2a68 68 0 0 1-11 5l6 11a106 106 0 0 0 32-16c3-28-2-52-18-73ZM42 66c-6 0-12-6-12-13s5-13 12-13 12 6 12 13-5 13-12 13Zm43 0c-7 0-12-6-12-13s5-13 12-13 12 6 12 13-5 13-12 13Z'/></svg>");
}

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */

.card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
}

.card-hover {
	transition: border-color 0.18s, transform 0.18s, background 0.18s;
}

.card-hover:hover {
	border-color: var(--line-strong);
	background: var(--panel-hover);
	transform: translateY(-2px);
}

.card-feature {
	position: relative;
	overflow: hidden;
}

.card-feature::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
	opacity: 0;
	transition: opacity 0.25s;
}

.card-feature:hover::before { opacity: 1; }

.panel {
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	overflow: hidden;
}

.panel-head {
	padding: 16px 20px;
	border-bottom: 1px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: var(--panel);
}

.panel-body { padding: 20px; }

/* --------------------------------------------------------------------------
   Chips, badges, pills
   -------------------------------------------------------------------------- */

.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	background: var(--bg-raised);
	font-size: 12px;
	font-weight: 550;
	color: var(--text-dim);
	white-space: nowrap;
}

.chip-accent {
	border-color: transparent;
	background: var(--accent-soft);
	color: #b6bdfb;
}

.chip-premium {
	border-color: rgba(240, 178, 50, 0.35);
	background: rgba(240, 178, 50, 0.12);
	color: var(--premium);
}

.chip-good {
	border-color: rgba(59, 165, 93, 0.35);
	background: rgba(59, 165, 93, 0.12);
	color: #6fce8d;
}

.chip-bad {
	border-color: rgba(237, 66, 69, 0.35);
	background: rgba(237, 66, 69, 0.12);
	color: #f27d7f;
}

.dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--text-faint);
	flex: none;
}

.dot-good { background: var(--good); box-shadow: 0 0 0 3px rgba(59, 165, 93, 0.18); }
.dot-bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(237, 66, 69, 0.18); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(240, 178, 50, 0.18); }

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 620;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

label.field {
	display: grid;
	gap: 6px;
	font-size: 13px;
	font-weight: 560;
	color: var(--text-dim);
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="color"],
select,
textarea {
	width: 100%;
	padding: 10px 12px;
	background: var(--bg);
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-sm);
	color: var(--text);
	font: inherit;
	font-size: 14px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder,
textarea::placeholder { color: var(--text-faint); }

input[type="color"] {
	padding: 4px;
	height: 40px;
	cursor: pointer;
}

textarea {
	resize: vertical;
	min-height: 90px;
	line-height: 1.55;
}

input:disabled,
select:disabled,
textarea:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.hint {
	font-size: 12px;
	color: var(--text-faint);
	font-weight: 450;
	line-height: 1.5;
}

.switch {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch .track {
	width: 38px;
	height: 22px;
	border-radius: 999px;
	background: var(--line-strong);
	position: relative;
	transition: background 0.18s;
	flex: none;
}

.switch .track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.18s;
}

.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch input:disabled + .track { opacity: 0.45; }

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 8px;
	z-index: 100;
	background: var(--accent);
	color: #fff;
	padding: 10px 16px;
	border-radius: var(--radius-sm);
}

.skip-link:focus { left: 16px; }

.spinner {
	width: 16px;
	height: 16px;
	border: 2px solid var(--line-strong);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
	flex: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fade-in 0.35s ease both; }

@keyframes fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}
