/* ProxyTun — dark theme site chrome + marketing page utilities */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
	--radius: 0.75rem;

	--background: oklch(0.16 0.012 250);
	--foreground: oklch(0.97 0.005 240);

	--card: oklch(0.19 0.015 250);
	--card-foreground: oklch(0.97 0.005 240);

	--primary: oklch(0.78 0.16 220);
	--primary-foreground: oklch(0.14 0.02 250);

	--secondary: oklch(0.24 0.018 250);
	--secondary-foreground: oklch(0.93 0.008 240);

	--muted: oklch(0.22 0.014 250);
	--muted-foreground: oklch(0.65 0.02 240);

	--accent: oklch(0.27 0.03 220);
	--accent-foreground: oklch(0.95 0.01 230);

	--destructive: oklch(0.65 0.22 27);
	--destructive-foreground: oklch(0.98 0.01 27);

	--border: oklch(1 0 0 / 12%);
	--input: oklch(1 0 0 / 14%);
	--ring: oklch(0.78 0.16 220 / 55%);

	--electric: oklch(0.82 0.17 218);

	--font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
	--font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

	--shadow-glow: 0 0 0 1px oklch(0.78 0.16 220 / 25%), 0 8px 30px -8px oklch(0.78 0.16 220 / 45%);
}

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

html, body {
	margin: 0;
	padding: 0;
	min-height: 100%;
}

body {
	background: var(--background);
	color: var(--foreground);
	font-family: var(--font-sans);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-family: var(--font-display);
	letter-spacing: -0.01em;
	line-height: 1.15;
	margin: 0 0 0.75rem;
	color: var(--foreground);
}

p { margin: 0 0 1rem; color: color-mix(in srgb, var(--foreground) 82%, transparent); }

a { color: var(--electric); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, kbd {
	font-family: var(--font-mono);
	background: var(--secondary);
	padding: 0.1rem 0.4rem;
	border-radius: 0.3rem;
	font-size: 0.9em;
	color: var(--foreground);
}
kbd { border: 1px solid var(--border); }

::selection { background: color-mix(in srgb, var(--primary) 45%, transparent); color: var(--primary-foreground); }

hr { border: none; border-top: 1px solid var(--border); }

/* =========================================================
   Custom utilities (marketing page)
   ========================================================= */

.bg-grid {
	background-image:
		linear-gradient(to right, oklch(1 0 0 / 6%) 1px, transparent 1px),
		linear-gradient(to bottom, oklch(1 0 0 / 6%) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
	mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

.text-gradient {
	background-image: linear-gradient(90deg, var(--primary), var(--electric));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.glow-ring {
	box-shadow: var(--shadow-glow);
}

.card-surface {
	background: color-mix(in srgb, var(--card) 88%, transparent);
	border: 1px solid var(--border);
	box-shadow: 0 1px 0 0 oklch(1 0 0 / 4%) inset, 0 20px 50px -30px oklch(0 0 0 / 60%);
}

.flow-line {
	stroke-dasharray: 6 6;
	animation: flow 2.4s linear infinite;
}

@keyframes flow {
	from { stroke-dashoffset: 24; }
	to { stroke-dashoffset: 0; }
}

/* Tailwind-utility fallbacks — kept in sync with the tokens above so the
   marketing page (application/views/home/index.php) renders correctly even
   if the Tailwind CDN config in the layout hasn't been wired to these
   semantic color names yet. Real Tailwind utilities (if configured) will
   simply match these same values. */
.bg-background { background-color: var(--background); }
.text-foreground { color: var(--foreground); }
.bg-foreground { background-color: var(--foreground); }
.text-background { color: var(--background); }
.bg-card { background-color: var(--card); }
.text-card-foreground { color: var(--card-foreground); }
.bg-primary { background-color: var(--primary); }
.text-primary { color: var(--primary); }
.text-primary-foreground { color: var(--primary-foreground); }
.bg-secondary { background-color: var(--secondary); }
.text-secondary-foreground { color: var(--secondary-foreground); }
.bg-muted { background-color: var(--muted); }
.text-muted-foreground { color: var(--muted-foreground); }
.bg-accent { background-color: var(--accent); }
.text-accent-foreground { color: var(--accent-foreground); }
.border-border { border-color: var(--border); }
.bg-electric { background-color: var(--electric); }
.text-electric { color: var(--electric); }
.shadow-electric { box-shadow: 0 0 12px var(--electric); }
.font-display { font-family: var(--font-display); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

/* =========================================================
   Site chrome
   ========================================================= */

.site-header {
	position: sticky; top: 0; z-index: 40;
	backdrop-filter: blur(10px);
	background: color-mix(in srgb, var(--background) 82%, transparent);
	border-bottom: 1px solid var(--border);
}
.site-header-inner {
	max-width: 72rem; margin: 0 auto; padding: 0.85rem 1.25rem;
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
	display: flex; align-items: center; gap: 0.6rem; color: var(--foreground); text-decoration: none; font-weight: 700;
	font-family: var(--font-display);
}
.brand:hover { text-decoration: none; }
.brand-mark {
	width: 1.9rem; height: 1.9rem; border-radius: 0.5rem;
	background: linear-gradient(135deg, var(--primary), var(--electric));
	color: var(--primary-foreground);
	display: grid; place-items: center; font-size: 0.75rem; font-family: var(--font-display); font-weight: 700;
	box-shadow: var(--shadow-glow);
}
.brand-ver { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-foreground); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--muted-foreground); font-size: 0.92rem; font-weight: 500; }
.nav a:hover { color: var(--foreground); text-decoration: none; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
	padding: 0.7rem 1.25rem; border-radius: var(--radius); border: 1px solid transparent;
	font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none;
	font-family: var(--font-sans); transition: transform .15s ease, box-shadow .15s ease, background .15s, opacity .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-glow); }
.btn-primary:hover { filter: brightness(1.05); color: var(--primary-foreground); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); border-color: var(--border); }
.btn-secondary:hover { background: color-mix(in srgb, var(--secondary) 80%, var(--foreground) 6%); }
.btn-ghost { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn-ghost:hover { background: color-mix(in srgb, var(--card) 60%, transparent); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

.site-main { min-height: 60vh; }
.hero-bg {
	background:
		radial-gradient(1200px 500px at 10% -10%, oklch(0.78 0.16 220 / 16%), transparent 60%),
		radial-gradient(900px 400px at 90% 0%, oklch(0.82 0.17 218 / 14%), transparent 60%);
}
.page {
	max-width: 48rem; margin: 0 auto; padding: 3rem 1.25rem 4rem;
}
.page.wide { max-width: 72rem; }
.eyebrow {
	font-family: var(--font-mono); font-size: 0.8rem; color: var(--electric);
	margin-bottom: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.lead { font-size: 1.1rem; color: var(--muted-foreground); max-width: 40rem; }

.section { padding: 3.5rem 1.25rem; }
.section-inner { max-width: 72rem; margin: 0 auto; }
.section h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.section-lead { color: var(--muted-foreground); margin-bottom: 2rem; max-width: 36rem; }

.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.feature {
	padding: 1.25rem; border-radius: calc(var(--radius) + 2px);
	background: color-mix(in srgb, var(--card) 70%, transparent);
	border: 1px solid var(--border);
}
.feature h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.feature p { font-size: 0.95rem; margin: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.5rem 0; }
.steps li {
	position: relative; padding: 1rem 0 1rem 3.25rem;
	border-bottom: 1px solid var(--border);
}
.steps li::before {
	counter-increment: step; content: counter(step);
	position: absolute; left: 0; top: 1rem;
	width: 2.1rem; height: 2.1rem; border-radius: 999px;
	background: var(--primary); color: var(--primary-foreground);
	display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
}
.steps strong { display: block; margin-bottom: 0.2rem; color: var(--foreground); }

.compare {
	width: 100%; border-collapse: collapse; margin: 1.5rem 0;
	font-size: 0.95rem;
}
.compare th, .compare td {
	text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
}
.compare th { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted-foreground); }
.compare td:nth-child(3) { color: var(--electric); font-weight: 600; }
.yes { color: oklch(0.75 0.16 150); }
.no { color: var(--muted-foreground); }

.price-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 2rem 0; }
.price-card {
	border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
	padding: 1.5rem; background: var(--card); position: relative;
}
.price-card.featured { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.price-card .term { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted-foreground); }
.price-card .amount { font-size: 2rem; font-family: var(--font-display); font-weight: 700; margin: 0.4rem 0; color: var(--foreground); }
.price-card .amount span { font-size: 0.95rem; font-weight: 500; color: var(--muted-foreground); }
.price-card ul { list-style: none; padding: 0; margin: 1rem 0; font-size: 0.92rem; }
.price-card li { padding: 0.3rem 0 0.3rem 1.3rem; position: relative; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--electric); font-weight: 700; }

.form { display: grid; gap: 1rem; max-width: 28rem; }
.form label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; color: var(--foreground); }
.form input, .form select, .form textarea {
	font: inherit; padding: 0.7rem 0.85rem; border-radius: var(--radius);
	border: 1px solid var(--input); background: var(--card); color: var(--foreground);
}
.form input:focus, .form select:focus, .form textarea:focus {
	outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring);
}
.form textarea { min-height: 120px; resize: vertical; }
.form .hint { font-weight: 400; font-size: 0.85rem; color: var(--muted-foreground); }
.radio-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.radio-pill {
	display: inline-flex; align-items: center; gap: 0.4rem;
	padding: 0.55rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius);
	background: var(--card); cursor: pointer; font-weight: 500; color: var(--foreground);
}
.radio-pill:has(input:checked) { border-color: var(--primary); background: var(--accent); }

.alert {
	padding: 0.85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.95rem;
	border: 1px solid var(--border);
}
.alert-ok { background: oklch(0.30 0.06 150 / 40%); color: oklch(0.85 0.12 150); border-color: oklch(0.5 0.1 150 / 40%); }
.alert-err { background: oklch(0.32 0.09 25 / 40%); color: oklch(0.85 0.12 20); border-color: oklch(0.55 0.15 25 / 40%); }
.alert-info { background: var(--accent); color: var(--accent-foreground); border-color: var(--border); }

.code-box {
	font-family: var(--font-mono); font-size: 1.25rem; letter-spacing: 0.04em;
	padding: 1rem 1.25rem; background: var(--secondary); border-radius: var(--radius);
	border: 1px dashed var(--primary); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	word-break: break-all; color: var(--foreground);
}

.faq details {
	border-bottom: 1px solid var(--border); padding: 1rem 0;
}
.faq summary {
	cursor: pointer; font-weight: 600; font-family: var(--font-mono); font-size: 0.98rem;
	list-style: none; color: var(--foreground);
}
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { color: var(--electric); }
.faq details p { margin-top: 0.75rem; }

.prose h2 { margin-top: 2.25rem; font-size: 1.25rem; }
.prose ul, .prose ol { margin: 0.75rem 0 1.25rem 1.25rem; }
.prose li { margin-bottom: 0.35rem; }

.site-footer {
	border-top: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 60%, var(--background));
	padding: 3rem 1.25rem 2rem; margin-top: 2rem;
}
.footer-inner { max-width: 72rem; margin: 0 auto; display: grid; gap: 2rem; grid-template-columns: 1.4fr repeat(3, 1fr); }
.footer-inner h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
.footer-inner a { display: block; color: var(--muted-foreground); margin: 0.35rem 0; font-size: 0.92rem; }
.footer-blurb { color: var(--muted-foreground); font-size: 0.92rem; max-width: 18rem; }
.footer-copy { max-width: 72rem; margin: 2rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 0.85rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.badge {
	display: inline-flex; align-items: center; gap: 0.35rem;
	font-family: var(--font-mono); font-size: 0.75rem; padding: 0.3rem 0.7rem;
	border-radius: 999px; background: var(--secondary); color: var(--secondary-foreground); border: 1px solid var(--border);
}

/* =========================================================
   Admin
   ========================================================= */

.admin-wrap { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; background: var(--background); }
.admin-nav { background: oklch(0.13 0.014 255); color: oklch(0.85 0.01 240); padding: 1.5rem 1rem; border-right: 1px solid var(--border); }
.admin-nav a { display: block; color: oklch(0.72 0.015 240); padding: 0.5rem 0.75rem; border-radius: 0.4rem; margin-bottom: 0.25rem; }
.admin-nav a:hover, .admin-nav a.active { background: color-mix(in srgb, var(--primary) 22%, transparent); color: #fff; text-decoration: none; }
.admin-main { padding: 1.5rem 2rem; color: var(--foreground); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--border); }
.admin-table th { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-foreground); }

.status { font-family: var(--font-mono); font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 0.3rem; display: inline-block; }
.status-pending_redemption { background: oklch(0.35 0.09 85 / 45%); color: oklch(0.85 0.13 85); }
.status-active { background: oklch(0.32 0.08 150 / 45%); color: oklch(0.82 0.13 150); }
.status-revoked { background: oklch(0.32 0.09 25 / 45%); color: oklch(0.83 0.13 20); }
.status-paid { background: oklch(0.32 0.08 150 / 45%); color: oklch(0.82 0.13 150); }
.status-pending { background: oklch(0.3 0.01 250); color: oklch(0.75 0.02 240); }

@media (max-width: 800px) {
	.footer-inner { grid-template-columns: 1fr 1fr; }
	.admin-wrap { grid-template-columns: 1fr; }
	.nav { display: none; }
	.site-header-inner { justify-content: space-between; }
}
@media (max-width: 520px) {
	.footer-inner { grid-template-columns: 1fr; }
	h1 { font-size: 1.75rem; }
}
