/**
 * TNEC Affiliate front-end styles.
 * Design system: Swiss minimalism, navy + sky palette, Fira type.
 * Tokens: --tnec-* custom properties; type scale 12/13/14/16/18/24/32;
 * spacing on an 8px rhythm; 200ms transitions; reduced-motion respected.
 */

:root {
	--tnec-primary: #0F172A;
	--tnec-accent: #0369A1;
	--tnec-accent-hover: #075985;
	--tnec-accent-active: #0C4A6E;
	--tnec-bg: #F8FAFC;
	--tnec-card: #FFFFFF;
	--tnec-fg: #0F172A;
	--tnec-fg-soft: #334155;
	--tnec-muted: #475569;
	--tnec-border: #E2E8F0;
	--tnec-border-soft: #EEF2F6;
	--tnec-muted-bg: #F1F5F9;
	--tnec-destructive: #DC2626;
	--tnec-ring: 0 0 0 3px rgba(3, 105, 161, 0.18);
	--tnec-radius: 8px;
	--tnec-radius-sm: 6px;
	--tnec-shadow: 0 1px 2px rgba(2, 6, 23, 0.05), 0 8px 24px rgba(2, 6, 23, 0.06);
	--tnec-font: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--tnec-mono: 'Fira Code', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

.tnec-area,
.tnec-register-wrap {
	font-family: var(--tnec-font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--tnec-fg-soft);
	-webkit-font-smoothing: antialiased;
}

.tnec-area {
	max-width: 920px;
	margin-inline: auto;
}

.tnec-register-wrap {
	max-width: 560px;
	margin-inline: auto;
}

/* Type scale: 12 / 13 / 14 / 16 / 18 / 24 */
.tnec-area h2,
.tnec-register-wrap h2 {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--tnec-fg);
}

/* Cards */
.tnec-card {
	background: var(--tnec-card);
	border: 1px solid var(--tnec-border);
	border-radius: var(--tnec-radius);
	box-shadow: var(--tnec-shadow);
	margin-bottom: 24px;
}

.tnec-card__header {
	padding: 20px 24px 0;
}

.tnec-card__content {
	padding: 20px 24px 24px;
}

/* Notices */
.tnec-notice {
	border: 1px solid #BAE6FD;
	background: #E0F2FE;
	color: #075985;
	border-radius: var(--tnec-radius-sm);
	padding: 12px 16px;
	margin: 0 0 16px;
	font-size: 14px;
}

.tnec-notice--error {
	border-color: #FECACA;
	background: #FEF2F2;
	color: #B91C1C;
}

.tnec-notice--success {
	border-color: #A7F3D0;
	background: #ECFDF5;
	color: #047857;
}

/* Tabs: underline style, 200ms hover, visible focus */
.tnec-tabs {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 24px;
	padding: 0;
	border-bottom: 1px solid var(--tnec-border);
}

.tnec-tabs li {
	margin: 0;
}

.tnec-tabs a {
	display: inline-block;
	padding: 10px 12px 12px;
	margin-bottom: -1px;
	border-bottom: 2px solid transparent;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	color: var(--tnec-muted);
	transition: color 200ms ease, border-color 200ms ease;
}

.tnec-tabs a:hover {
	color: var(--tnec-accent);
}

.tnec-tabs a:focus-visible {
	outline: none;
	box-shadow: var(--tnec-ring);
	border-radius: var(--tnec-radius-sm);
}

.tnec-tabs .tnec-active a {
	color: var(--tnec-accent);
	border-bottom-color: var(--tnec-accent);
	font-weight: 600;
}

/* Stat cards */
.tnec-stats {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	margin: 0 0 24px;
	padding: 0;
}

.tnec-stat {
	background: var(--tnec-card);
	border: 1px solid var(--tnec-border);
	border-radius: var(--tnec-radius);
	box-shadow: var(--tnec-shadow);
	padding: 16px 20px;
}

.tnec-stat__label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--tnec-muted);
	margin-bottom: 4px;
}

.tnec-stat__value {
	display: block;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--tnec-fg);
}

/* Tables: horizontal rules only, uppercase header, hover row */
.tnec-table-wrap {
	overflow-x: auto;
}

.tnec-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	font-size: 14px;
}

.tnec-table th {
	text-align: left;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--tnec-muted);
	padding: 0 12px 12px;
	border-bottom: 1px solid var(--tnec-border);
}

.tnec-table td {
	padding: 12px;
	border-bottom: 1px solid var(--tnec-border-soft);
	color: var(--tnec-fg-soft);
	vertical-align: top;
}

.tnec-table tbody tr:last-child td {
	border-bottom: none;
}

.tnec-table tbody tr {
	transition: background-color 200ms ease;
}

.tnec-table tbody tr:hover {
	background: var(--tnec-bg);
}

/* Forms: labeled fields, 8px rhythm, focus ring */
.tnec-form {
	margin: 0;
}

.tnec-form p {
	margin: 0 0 16px;
}

.tnec-form p:last-child {
	margin-bottom: 0;
}

.tnec-form label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--tnec-fg);
	margin-bottom: 8px;
	cursor: pointer;
}

.tnec-form small {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: var(--tnec-muted);
	margin-top: 6px;
}

.tnec-form input[type="text"],
.tnec-form input[type="email"],
.tnec-form input[type="url"],
.tnec-form input[type="password"],
.tnec-form select,
.tnec-form textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #CBD5E1;
	border-radius: var(--tnec-radius-sm);
	background: var(--tnec-card);
	color: var(--tnec-fg);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	transition: border-color 200ms ease, box-shadow 200ms ease;
}

.tnec-form input:focus,
.tnec-form select:focus,
.tnec-form textarea:focus {
	outline: none;
	border-color: var(--tnec-accent);
	box-shadow: var(--tnec-ring);
}

.tnec-form input:focus-visible,
.tnec-form select:focus-visible {
	outline: none;
}

/* Primary button */
.tnec-button {
	display: inline-block;
	background: var(--tnec-accent);
	color: #FFFFFF;
	border: none;
	border-radius: var(--tnec-radius);
	padding: 11px 22px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 200ms ease, transform 200ms ease;
}

.tnec-button:hover,
.tnec-button:focus-visible {
	background: var(--tnec-accent-hover);
	color: #FFFFFF;
}

.tnec-button:active {
	background: var(--tnec-accent-active);
}

.tnec-button:focus-visible {
	outline: none;
	box-shadow: var(--tnec-ring);
}

/* Affiliate code chip */
.tnec-card__content code {
	font-family: var(--tnec-mono);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.08em;
	background: var(--tnec-muted-bg);
	color: var(--tnec-accent);
	padding: 4px 10px;
	border-radius: var(--tnec-radius-sm);
}

/* Read-only copy inputs */
.tnec-copy {
	display: block;
	box-sizing: border-box;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--tnec-border);
	border-radius: var(--tnec-radius-sm);
	background: var(--tnec-bg);
	font-family: var(--tnec-mono);
	font-size: 13px;
	color: var(--tnec-fg);
	cursor: pointer;
	transition: border-color 200ms ease;
}

.tnec-copy:hover {
	border-color: var(--tnec-accent);
}

.tnec-copy:focus {
	outline: none;
	border-color: var(--tnec-accent);
	box-shadow: var(--tnec-ring);
}

/* Links inside the area */
.tnec-area a {
	color: var(--tnec-accent);
}

.tnec-area a:hover {
	color: var(--tnec-accent-hover);
}

/* Small screens: 375px first */
@media (max-width: 600px) {
	.tnec-card__header,
	.tnec-card__content {
		padding-left: 16px;
		padding-right: 16px;
	}

	.tnec-stats {
		grid-template-columns: repeat(2, 1fr);
	}

	.tnec-tabs {
		gap: 0;
	}

	.tnec-tabs a {
		padding: 8px 8px 10px;
	}
}

/* Reduced motion: kill transitions */
@media (prefers-reduced-motion: reduce) {
	.tnec-tabs a,
	.tnec-table tbody tr,
	.tnec-form input,
	.tnec-form select,
	.tnec-button,
	.tnec-copy {
		transition: none;
	}
}
