/* ----------------------------------------------------------------------------
   Tokens, font and the logo are the real ones from defillama-app:
   values from src/styles/semantics.css + src/tailwind.css, assets vendored from
   its public/ (the font cannot be hotlinked — defillama.com serves it without
   an Access-Control-Allow-Origin header).
---------------------------------------------------------------------------- */

@font-face {
	font-family: 'Inter-fallback';
	size-adjust: 107%;
	ascent-override: 96.9%;
	descent-override: 24.2%;
	line-gap-override: 0%;
	src: local('Arial');
}

@font-face {
	font-family: 'Inter var';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	ascent-override: 96.9%;
	descent-override: 24.2%;
	line-gap-override: 0%;
	src: url('/fonts/inter.woff2') format('woff2');
}

:root {
	--blue-500: #1f67d2;

	--bg-page: #f7f7f7;
	--bg-surface: #ffffff;
	--bg-brand: var(--blue-500);
	--bg-brand-faint: #1f67d20f;

	--text-primary: #090b0c;
	--text-secondary: #484848;
	--text-tertiary: #6f6f6f;
	--text-link: #1853a8;
	--text-on-brand: #ffffff;

	--border-subtle: #00000014;
	--border-medium: #0000001f;
	--border-brand: var(--blue-500);

	--success: #32933f;
	--error: #b53b35;

	/* Repository-owned radius contracts: 8px cards/panels/inputs, 12px roomy cards. */
	--radius-lg: 0.5rem;
	--radius-xl: 0.75rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg-page: #090b0c;
		--bg-surface: #131516;
		--text-primary: #ffffff;
		--text-secondary: #c6c6c6;
		--text-tertiary: #8f8f8f;
		--text-link: #4b86db;
		--border-subtle: #ffffff0f;
		--border-medium: #ffffff1f;
		--success: #5bc46a;
		--error: #e45c51;
	}
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg-page);
	color: var(--text-primary);
	font-family: 'Inter var', 'Inter-fallback', Arial, sans-serif;
	font-size: 15px;
	line-height: 1.55;
}

a { color: var(--text-link); }

/* Header mirrors the app's mobile nav: bg-brand, px-4 py-3, logo at 105x36. */
.site-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	background: var(--bg-brand);
}

.brand { margin-right: auto; display: inline-flex; }
.brand img { display: block; height: 36px; width: auto; object-fit: contain; }

.site-header nav { display: flex; gap: 16px; }

.header-link {
	color: var(--text-on-brand);
	font-size: 14px;
	text-decoration: none;
	opacity: 0.9;
}

.header-link:hover { opacity: 1; text-decoration: underline; }

.page {
	max-width: 760px;
	margin: 0 auto;
	padding: 32px 20px 64px;
}

h1 { font-size: 1.6rem; margin: 0 0 8px; }
.lede { margin: 0 0 24px; color: var(--text-secondary); }

.form-list { display: grid; gap: 12px; }

.form-card-link {
	display: block;
	padding: 16px 18px;
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-lg);
	background: var(--bg-surface);
	text-decoration: none;
	color: var(--text-primary);
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.form-card-link:hover { border-color: var(--border-brand); background: var(--bg-brand-faint); }
.form-card-link:focus-visible { outline: 2px solid var(--border-brand); outline-offset: -2px; }
.form-card-link strong { display: block; font-size: 1rem; }
.form-card-link span { display: block; margin-top: 4px; color: var(--text-tertiary); font-size: 0.9rem; }

/* Google embed: the iframe owns the viewport below the header, the form scrolls inside it. */
.embed-page { display: flex; flex-direction: column; min-height: 100vh; }
.embed-main { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.embed-intro { max-width: 760px; width: 100%; margin: 0 auto; padding: 20px 20px 12px; }
.embed-intro h1 { margin-bottom: 4px; }
.embed-intro p { margin: 0; color: var(--text-secondary); }

.form-embed {
	flex: 1;
	width: 100%;
	min-height: 70vh;
	border: 0;
	background: var(--bg-surface);
}

.embed-fallback {
	margin: 0;
	padding: 10px 20px;
	border-top: 1px solid var(--border-subtle);
	background: var(--bg-surface);
	color: var(--text-tertiary);
	font-size: 0.85rem;
	text-align: center;
}

/* Native forms */
.form-card {
	padding: 20px;
	margin-bottom: 16px;
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-xl);
	background: var(--bg-surface);
}

.section-title { margin: 0 0 4px; font-size: 1.05rem; }
.section-title .icon { margin-right: 6px; }
.section-desc { margin: 0 0 12px; color: var(--text-tertiary); font-size: 0.9rem; }
.optional { color: var(--text-tertiary); font-size: 0.8rem; font-weight: 400; }
.required { color: var(--error); }

.form-group { margin-top: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; }
.hint { display: block; margin-top: 2px; color: var(--text-tertiary); font-size: 0.85rem; font-weight: 400; }

input,
select,
textarea {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--border-medium);
	border-radius: var(--radius-lg);
	background: var(--bg-page);
	color: var(--text-primary);
	font: inherit;
	resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 2px solid var(--border-brand); outline-offset: -2px; }
input[aria-invalid='true'],
select[aria-invalid='true'],
textarea[aria-invalid='true'] { border-color: var(--error); }

.cf-turnstile { margin: 16px 0; }

/* The app's primary button recipe: bg-brand + text-on-brand, hover brightness-110. */
.submit-btn {
	width: 100%;
	padding: 12px 20px;
	border: 1px solid transparent;
	border-radius: var(--radius-lg);
	background: var(--bg-brand);
	color: var(--text-on-brand);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.submit-btn:hover:not(:disabled) { filter: brightness(1.1); }
.submit-btn:focus-visible { outline: 2px solid var(--text-on-brand); outline-offset: -2px; }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.alert { display: none; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-lg); border: 1px solid transparent; }
.alert.show { display: block; }
.alert.error { border-color: var(--error); color: var(--error); }
.alert.success { border-color: var(--success); color: var(--success); }

.site-footer {
	padding: 20px;
	border-top: 1px solid var(--border-subtle);
	color: var(--text-tertiary);
	font-size: 0.85rem;
	text-align: center;
}

@media (max-width: 600px) {
	.page { padding: 24px 16px 48px; }
	.site-header nav { gap: 12px; }
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
