/* ProjectK: dark, mobile first, over the horse background */

@font-face { font-family: "Titillium"; src: url("/fonts/Titillium-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Titillium"; src: url("/fonts/Titillium-Semibold.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Titillium"; src: url("/fonts/Titillium-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Jura"; src: url("/fonts/Jura.ttf") format("truetype"); font-display: swap; }

:root {
	--bg: #0c110d;
	--panel: rgba(16, 22, 18, 0.88);
	--panel2: rgba(255, 255, 255, 0.05);
	--line: rgba(255, 255, 255, 0.12);
	--text: #e8efe9;
	--muted: #9fb0a3;
	--green: #3be04f;
	--green2: #1a7f37;
	--amber: #f0b429;
	--red: #ff6b6b;
	--radius: 10px;
	color-scheme: dark;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg) url("/horse_background.webp") center top / cover fixed no-repeat;
	color: var(--text);
	font: 16px/1.5 "Titillium", "Segoe UI", Roboto, Arial, sans-serif;
	display: flex;
	flex-direction: column;
}
body::before { content: ""; position: fixed; inset: 0; background: linear-gradient(180deg, rgba(8,12,9,.82), rgba(8,12,9,.93)); z-index: -1; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: "Jura", "Titillium", sans-serif; font-weight: 400; letter-spacing: .02em; margin: 0 0 .6em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; color: var(--green); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }

/* Header and navigation */
.top { position: sticky; top: 0; z-index: 10; background: rgba(8,12,9,.95); border-bottom: 1px solid var(--line); padding: 8px 16px 0; padding-top: calc(8px + env(safe-area-inset-top, 0px)); display: flex; flex-wrap: wrap; align-items: center; }
.logo img { display: block; height: 42px; width: auto; }
.out { margin-left: auto; }
.nav { width: 100%; display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-top: 6px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: 0 0 auto; padding: 8px 12px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.on { color: var(--green); border-bottom-color: var(--green); }
.nav.guest { width: auto; margin: 0 0 0 auto; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 18px 16px 40px; flex: 1; min-width: 0; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

/* Panels and layout */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; backdrop-filter: blur(4px); }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 16px; }
.grid .grid { margin-bottom: 0; }
.grid > * { min-width: 0; } /* let a wide table scroll inside its panel instead of widening the page */
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > * { flex: 1 1 140px; min-width: 0; }
.row > .shrink { flex: 0 0 auto; }
@media (min-width: 760px) {
	.grid.two { grid-template-columns: 1fr 1fr; }
	.grid.three { grid-template-columns: repeat(3, 1fr); }
	.wrap { padding-top: 24px; }
	.top { padding-left: 24px; padding-right: 24px; }
}

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; font-weight: 600; color: var(--text); }
.stat span { color: var(--muted); font-size: .9rem; }
.stat.warn b { color: var(--amber); }

.flash { background: rgba(59,224,79,.12); border: 1px solid rgba(59,224,79,.45); color: var(--text); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.error { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.5); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.error ul { margin: 0; padding-left: 18px; }
.note { background: var(--panel2); border-left: 3px solid var(--amber); padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }

/* Forms */
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
label > input, label > select, label > textarea { margin-top: 4px; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=tel], input[type=search], select, textarea {
	display: block; width: 100%; min-height: 44px; padding: 9px 11px; color: var(--text); background: rgba(0,0,0,.35);
	border: 1px solid var(--line); border-radius: 8px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green2); border-color: var(--green2); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.check input { width: 20px; height: 20px; accent-color: var(--green2); }

.btn, button.btn { display: inline-block; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--green2); background: var(--green2); color: #fff; cursor: pointer; text-align: center; font-weight: 600; }
.btn:hover { background: #22963f; text-decoration: none; }
.btn.alt { background: transparent; color: var(--green); }
.btn.alt:hover { background: rgba(59,224,79,.1); }
.btn.warn { background: transparent; border-color: var(--red); color: var(--red); }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: .9rem; }
button.link { background: none; border: none; color: var(--muted); cursor: pointer; padding: 8px 0; }
button.link:hover { color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; }

/* Tables: scroll sideways on a phone rather than squash */
.table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; }
table.list td.n, table.list th.n { text-align: right; white-space: nowrap; }
table.list tr:last-child td { border-bottom: none; }
table.list tfoot td { font-weight: 600; border-top: 1px solid var(--line); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.badge.paid { background: rgba(59,224,79,.15); color: var(--green); }
.badge.due { background: rgba(240,180,41,.15); color: var(--amber); }
.badge.over { background: rgba(255,107,107,.15); color: var(--red); }
.stars { color: var(--amber); letter-spacing: 2px; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tabs a.on { border-color: var(--green2); color: var(--text); background: rgba(26,127,55,.35); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* A sent document shown as paper */
.paper { background: #fff; color: #222; border-radius: var(--radius); overflow-x: auto; margin-bottom: 16px; }
@media (max-width: 600px) {
	/* the document carries inline styles for email, so a phone needs !important to tighten it */
	.paper > div { padding: 14px !important; font-size: 13px !important; }
	.paper th, .paper td { padding: 6px 4px !important; }
}

/* Public home */
.hero { border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; border: 1px solid var(--line); }
.hero img { display: block; width: 100%; height: auto; }
.hero .pitch { background: var(--panel); padding: 18px 16px; }
.hero h1 { font-size: 1.9rem; }
.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { padding-left: 26px; position: relative; margin-bottom: 6px; }
.ticks li::before { content: "\2713"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

.narrow { max-width: 480px; margin: 0 auto; }
.secret { font-family: Menlo, Consolas, monospace; font-size: 1.1rem; letter-spacing: 2px; word-break: break-all; background: rgba(0,0,0,.35); padding: 10px; border-radius: 8px; }
