/* Parts Desk website. Same colours as the app; light and dark. */
:root {
  --bg: #F4F5F7; --card: #FFFFFF; --border: #DDE1E6; --fg: #1B1F24; --fg2: #555C66; --muted: #7A828C;
  --accent: #1565C0; --accent-fg: #FFFFFF; --tint: #DCE8F7; --input: #FFFFFF;
  --ok-bg: #E3F1E4; --ok-fg: #1B5E20; --err-bg: #FDE7E7; --err-fg: #B71C1C; --info-bg: #DCE8F7; --info-fg: #0D3C78;
  --accent2: #2E9D57; --ok-icon: #2E9D57; --glow: rgba(21, 101, 192, 0.16); --shadow: 0 12px 32px rgba(16, 24, 40, 0.12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17191C; --card: #212429; --border: #30343A; --fg: #E6E8EB; --fg2: #B0B6BE; --muted: #8A919A;
    --accent: #5B9BE6; --accent-fg: #0B1220; --tint: #243A55; --input: #1C1F23;
    --ok-bg: #1F3A24; --ok-fg: #A5D6A7; --err-bg: #4A2226; --err-fg: #FFABAB; --info-bg: #243A55; --info-fg: #CFE0F7;
    --accent2: #81C784; --ok-icon: #81C784; --glow: rgba(91, 155, 230, 0.22); --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17191C; --card: #212429; --border: #30343A; --fg: #E6E8EB; --fg2: #B0B6BE; --muted: #8A919A;
  --accent: #5B9BE6; --accent-fg: #0B1220; --tint: #243A55; --input: #1C1F23;
  --ok-bg: #1F3A24; --ok-fg: #A5D6A7; --err-bg: #4A2226; --err-fg: #FFABAB; --info-bg: #243A55; --info-fg: #CFE0F7;
  --accent2: #81C784; --ok-icon: #81C784; --glow: rgba(91, 155, 230, 0.22); --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 28px 0 10px; }
p { margin: 0 0 12px; }

header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--card);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; color: var(--fg); text-decoration: none; }
nav { display: flex; align-items: center; gap: 14px; }
nav a { text-decoration: none; }
button.theme {
  background: none; border: 1px solid var(--border); color: var(--fg2); border-radius: 8px;
  width: 34px; height: 34px; font-size: 16px; cursor: pointer;
}

main { flex: 1; width: 100%; margin: 0 auto; padding: 32px 16px 48px; }
main.narrow { max-width: 460px; }
main.wide { max-width: 960px; }
footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; padding: 20px 16px;
  border-top: 1px solid var(--border); font-size: 14px;
}
footer a { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.secondary { color: var(--fg2); }
.small-text { font-size: 14px; }

label { display: block; font-size: 14px; color: var(--fg2); margin: 14px 0 5px; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--fg); background: var(--input);
  border: 1px solid var(--border); border-radius: 8px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px;
  font: inherit; font-weight: 600; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-fg); text-decoration: none; cursor: pointer;
}
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.secondary { background: var(--card); color: var(--fg); border-color: var(--border); }
.btn.danger { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-fg); }
.btn.block { width: 100%; margin-top: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.notice { padding: 12px 14px; border-radius: 8px; font-size: 15px; }
.notice.ok { background: var(--ok-bg); color: var(--ok-fg); }
.notice.error { background: var(--err-bg); color: var(--err-fg); }
.notice.info { background: var(--info-bg); color: var(--info-fg); }

/* Home page */
main.home { max-width: 1160px; padding-top: 0; }
.center { text-align: center; }
.narrow-text { max-width: 720px; margin-left: auto; margin-right: auto; }
.block { margin: 72px 0 0; }
.block h2 { font-size: 30px; letter-spacing: -0.01em; margin: 0 0 10px; }

.hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center;
  padding: 56px 0 8px;
}
.hero::before {   /* soft glow behind the screenshot */
  content: ""; position: absolute; z-index: -1; inset: -40px -20vw 0 30%;
  background: radial-gradient(closest-side, var(--glow), transparent 75%);
}
.hero h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.06; letter-spacing: -0.025em; margin: 18px 0 18px; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 19px; color: var(--fg2); margin-bottom: 26px; }
.pill {
  display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--accent); background: var(--tint);
}
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 10px; }
.hero .row + p { margin-top: 14px; }
.shot { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: #1B1F24; }
.shot img { display: block; width: 100%; height: auto; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 32px; }
.feature {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.feature h3 { margin: 14px 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--fg2); font-size: 15px; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature .icon { width: 44px; height: 44px; padding: 10px; border-radius: 12px; color: var(--accent); background: var(--tint); }

.showcase { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 44px; align-items: center; }
ul.checks { list-style: none; padding: 0; margin: 14px 0 0; }
ul.checks li { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; color: var(--fg2); }
ul.checks .icon { flex: none; width: 20px; height: 20px; margin-top: 3px; color: var(--ok-icon); stroke-width: 2.4; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 32px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 26px; }
.plan h3 { margin: 0; font-size: 18px; }
.plan .price { font-size: 36px; font-weight: 750; letter-spacing: -0.02em; margin: 8px 0 0; }
.plan .price + p { margin: 0; }
.plan ul.checks { flex: 1; margin: 18px 0 20px; }
.plan .btn.block { margin-top: auto; }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.badge {
  position: absolute; top: -13px; left: 24px; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 650;
  background: var(--accent); color: var(--accent-fg);
}

main.home { overflow-x: clip; }   /* the glow may reach past the screen edge; never scroll sideways */
@media (max-width: 520px) {
  header.top { padding: 10px 14px; }
  nav { gap: 10px; }
  nav .btn.small { padding: 6px 10px; }
  .brand { font-size: 16px; }
}
@media (max-width: 860px) {
  .hero, .showcase { grid-template-columns: 1fr; gap: 28px; }
  .hero::before { inset: 30% 0 0 0; }
  .hero { padding-top: 32px; }
  .block { margin-top: 52px; }
  .block h2 { font-size: 25px; }
}

/* Account page */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--bg); border-radius: 8px; padding: 12px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td form { margin: 0; }

@media (max-width: 560px) {
  .hero { flex-direction: column; text-align: center; }
  h1 { font-size: 25px; }
  header.top { padding: 10px 16px; }
  nav { gap: 10px; }
}
.row.spread { justify-content: space-between; }
h2.first { margin-top: 0; }
.gap-top { margin-top: 12px; }
form.limited { max-width: 380px; }

/* Shared project pages (share.php) */
.share h1 { margin-bottom: 6px; }
.share section { margin-top: 26px; }
.share h2 { border-left: 4px solid var(--accent); padding-left: 10px; }
.share h3 { font-size: 17px; margin: 14px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); font-size: 14px; }
.chip.status { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
ul.notes { list-style: none; padding: 0; margin: 0 0 12px; }
ul.notes li { padding: 3px 0 3px 18px; position: relative; }
ul.notes li::before { content: "•"; position: absolute; left: 4px; color: var(--muted); }
ul.notes li.todo { padding-left: 30px; }
ul.notes li.todo::before { content: none; }
ul.notes li .box { position: absolute; left: 2px; top: 5px; width: 18px; height: 18px; border: 2px solid var(--muted); border-radius: 5px;
                   font-size: 12px; line-height: 15px; text-align: center; font-weight: 800; color: #fff; }
ul.notes li.done { color: var(--muted); text-decoration: line-through; }
ul.notes li.done .box { background: var(--ok-fg); border-color: var(--ok-fg); text-decoration: none; }
ul.notes li.d1 { margin-left: 1.2em; } ul.notes li.d2 { margin-left: 2.4em; } ul.notes li.d3 { margin-left: 3.6em; }
ul.notes li.d4 { margin-left: 4.8em; } ul.notes li.d5 { margin-left: 6em; } ul.notes li.d6 { margin-left: 7.2em; }
.share figure { margin: 0 0 10px; }
.share figure img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.share figcaption { color: var(--muted); font-size: 14px; margin-top: 4px; }
.share details { margin: 4px 0 18px; }
.share summary { cursor: pointer; color: var(--accent); }
table.parts td.qty { width: 60px; font-weight: 700; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
ul.links { padding-left: 20px; }
.small { font-size: 13px; }

/* Dashboard (admin.php) and gift codes */
.stats.dash { margin: 18px 0 16px; }
.stats.dash .stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stats.dash .stat b { font-size: 26px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.dash-grid .card { margin-bottom: 0; }
.dash-grid + .card, .dash-grid + .card + .card { margin-top: 16px; }
.chart { width: 100%; height: auto; }
.chart .bar { fill: var(--accent); }
.chart .bar-n, .chart .bar-label { font-size: 12px; text-anchor: middle; fill: var(--muted); }
.chart .bar-n { fill: var(--fg2); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.mono, .code-list { font-family: ui-monospace, Consolas, "DejaVu Sans Mono", monospace; letter-spacing: 0.02em; }
.code-list { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0; font-size: 16px; user-select: all; white-space: pre-wrap; }
.new-codes { margin-top: 16px; padding: 14px; border-radius: 10px; background: var(--ok-bg); }
.codes-form { align-items: flex-end; }
.codes-form label { margin: 0; display: flex; flex-direction: column; gap: 5px; }
.codes-form .grow { flex: 1; min-width: 200px; }
.codes-form input[type=number] { width: 90px; }
select, input[type=number] {
  font: inherit; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--input); color: var(--fg);
}
.table-wrap { overflow-x: auto; margin-top: 10px; }
tr.dim td { opacity: 0.55; }
form.redeem input[type=text] { flex: 1; min-width: 220px; }

/* Download button and section */
.btn .icon { width: 19px; height: 19px; margin: -3px 8px -3px -2px; vertical-align: middle; stroke-width: 2.2; }
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; }
.download {
  display: flex; gap: 14px; align-items: flex-start; padding: 20px; border-radius: 14px; text-decoration: none; color: var(--fg);
  background: var(--card); border: 1px solid var(--border); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.download:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.download.yours { border: 2px solid var(--accent); }
.download .icon { flex: none; width: 42px; height: 42px; padding: 9px; border-radius: 12px; color: var(--accent); background: var(--tint); }
.download span { display: flex; flex-direction: column; gap: 2px; }
.download b { font-size: 17px; }
.download small { font-size: 14px; color: var(--fg2); }
.download small.muted { color: var(--muted); font-size: 13px; }
