@font-face {
  font-family: 'Author';
  src: url('/static/fonts/Author-Variable.ttf') format('truetype-variations'),
       url('/static/fonts/Author-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --blauw: #004077;
  --diepblauw: #00335E;
  --donkerder: #001F3A;
  --lichtblauw: #178FCF;
  --cyaan: #008ECF;
  --middenblauw: #005096;
  --indigo: #241F59;
  --wit: #FFFFFF;
  --bijna-zwart: #272626;
  --signaal-rood: #FF4D4D;

  --font-main: 'Author', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --r-pill: 3px 9px 3px 9px;
  --r-nav: 12px 4px 12px 4px;
  --r-card: 16px;

  --line: rgba(255, 255, 255, 0.10);
  --muted: rgba(255, 255, 255, 0.55);
  --surface: rgba(255, 255, 255, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 100%;
  min-height: 100vh;
  font-family: var(--font-main);
  background: var(--donkerder);
  color: var(--wit);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed; inset: -10%;
  background:
    radial-gradient(ellipse at 22% 30%, rgba(0,119,221,0.35), transparent 60%),
    radial-gradient(ellipse at 80% 78%, rgba(23,143,207,0.22), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background:
    linear-gradient(rgba(0,80,150,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,80,150,0.10) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

header.app, main.container, footer.appfoot { position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--lichtblauw); }
::selection { background: var(--lichtblauw); color: var(--wit); }

h1, h2, h3 {
  font-family: var(--font-main);
  font-variation-settings: 'wght' 480;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 { font-size: clamp(28px, 3.2vw, 40px); margin: 0; }
h2 { font-size: 20px; margin: 0; font-variation-settings: 'wght' 460; }
h3 { font-size: 16px; margin: 0; }

p { margin: 0; }
small, code { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; }
code { color: rgba(255,255,255,0.7); }

/* Header */
header.app {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 56px;
  gap: 24px;
}
header.app .brand {
  display: inline-flex;
  align-items: center;
}
header.app .brand img,
header.app .brand svg {
  height: 38px;
  width: auto;
  display: block;
}

/* Topbar status chip (right side, when not logged in) */
.topbar__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}
.topbar__meta::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lichtblauw);
  box-shadow: 0 0 14px var(--lichtblauw);
}

/* Container */
.container {
  width: 100%;
  max-width: 920px;
  justify-self: center;
  padding: 32px 56px 64px;
}

/* Footer */
footer.appfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 56px 32px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.appfoot__left, .appfoot__right { display: inline-flex; align-items: center; gap: 14px; }
.appfoot__dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,0.3); }

/* Hero (login + error pages) */
.hero {
  width: 100%;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 240px);
  padding: 24px 0;
}

/* Panel: two-pane card (intro + form) */
.panel {
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-card);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.04) inset;
}

.panel__intro {
  padding: 56px 48px;
  background:
    linear-gradient(180deg, rgba(0,64,119,0.55), rgba(0,31,58,0.7)),
    radial-gradient(circle at 30% 20%, rgba(8,89,158,0.6), transparent 60%);
  display: grid;
  align-content: space-between;
  gap: 40px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.panel__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lichtblauw);
  margin-bottom: 14px;
}
.panel__title {
  font-family: var(--font-main);
  font-variation-settings: 'wght' 480;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-transform: lowercase;
  color: var(--wit);
}
.panel__title em {
  font-style: normal;
  color: var(--lichtblauw);
}
.panel__sub {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,0.72);
  max-width: 32ch;
}
.panel__signature {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.panel__signature::before {
  content: '';
  width: 28px; height: 1px;
  background: rgba(255,255,255,0.3);
}

.panel__form {
  padding: 56px 48px;
  background: rgba(0,15,28,0.55);
  display: grid;
  align-content: center;
  gap: 22px;
}
.form__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.form__head h2 {
  font-family: var(--font-main);
  font-variation-settings: 'wght' 480;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.form__head span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.field { display: grid; gap: 8px; }
.field > label { margin: 0; }

.help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}
.help a {
  color: var(--lichtblauw);
  border-bottom: 1px solid rgba(23,143,207,0.4);
  padding-bottom: 1px;
}
.help a:hover {
  color: var(--wit);
  border-color: var(--wit);
}

.feedback {
  min-height: 22px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.55);
}
.feedback:empty { min-height: 0; }
.feedback.is-success { color: var(--lichtblauw); }
.feedback.is-error { color: var(--signaal-rood); }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 30px 60px -30px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.04) inset;
}

/* Tile (project list) */
.tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  text-decoration: none;
  color: var(--wit);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tile:hover {
  border-color: rgba(23,143,207,0.6);
  background: rgba(23,143,207,0.06);
  transform: translateY(-1px);
  color: var(--wit);
}
.tile:hover .tile__cta { transform: translateX(3px); color: var(--lichtblauw); }
.tile strong {
  font-variation-settings: 'wght' 520;
  letter-spacing: -0.01em;
  font-size: 17px;
}
.tile__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease;
}
.tile:hover .tile__cta { border-color: rgba(23,143,207,0.5); }

/* Page head (eyebrow + h1) */
.page-head {
  margin-bottom: 28px;
}
.page-head h1 { margin-top: 0; }
.page-head .panel__eyebrow { margin-bottom: 12px; }

/* Section spacing */
.section { padding: 4px 0; }
.section h2 + .stack,
.section h2 + table,
.section h2 + ul { margin-top: 18px; }
.section + .section { margin-top: 8px; }

/* Empty state */
.empty-state {
  padding: 22px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--r-card);
  background: rgba(255,255,255,0.02);
  font-size: 14px;
}

/* Task list */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14.5px;
}

/* Stat grid (admin) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}
.stat {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.stat__value {
  font-family: var(--font-main);
  font-variation-settings: 'wght' 520;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat__label {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Event log */
.event-log td:first-child code,
.event-log td:last-child code {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
}
.event-log td:nth-child(2) {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--lichtblauw);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--lichtblauw);
  color: var(--wit);
  border: 0;
  border-radius: 8px;
  font-family: var(--font-main);
  font-variation-settings: 'wght' 460;
  font-size: 15px;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 12px 30px -12px rgba(23,143,207,0.55);
}
.btn:hover {
  background: #1ea1e6;
  color: var(--wit);
  transform: translateY(-1px);
  box-shadow: 0 16px 38px -12px rgba(23,143,207,0.7);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--ghost {
  background: rgba(255,255,255,0.06);
  color: var(--wit);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
  box-shadow: none;
}

/* Inputs */
.input, .textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-nav);
  color: var(--wit);
  font-family: var(--font-main);
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: border-color 160ms ease, background 160ms ease;
}
.input::placeholder, .textarea::placeholder { color: rgba(255,255,255,0.32); }
.input:focus, .textarea:focus {
  outline: 0;
  border-color: var(--lichtblauw);
  background: rgba(23,143,207,0.08);
}
.textarea { min-height: 120px; resize: vertical; }

/* Form labels (mono uppercase eyebrow) */
label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
label .input, label .textarea { margin-top: 6px; }

/* Layout helpers */
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }

/* Chips (asymmetrische pill) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  background: rgba(23,143,207,0.16);
  border: 1px solid rgba(23,143,207,0.32);
  border-radius: var(--r-pill);
  color: var(--lichtblauw);
}

.muted { color: var(--muted); }
.error { color: var(--signaal-rood); font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* Comments */
.thread { display: flex; flex-direction: column; gap: 14px; }
.comment {
  padding: 14px 16px;
  border-left: 2px solid var(--lichtblauw);
  background: rgba(255,255,255,0.025);
  border-radius: 0 8px 8px 0;
}
.comment__head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Tables (admin audit-log) */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th, table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); border-bottom-color: rgba(255,255,255,0.18); }
table td code { color: rgba(255,255,255,0.7); font-size: 11.5px; }

/* Mobile */
@media (max-width: 760px) {
  header.app { padding: 20px 22px; }
  header.app .brand img { height: 30px; }
  .container { padding: 28px 22px 56px; }
  footer.appfoot { padding: 20px 22px 28px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .card { padding: 22px; }
  .topbar__meta { display: none; }
  .panel { grid-template-columns: 1fr; }
  .panel__intro,
  .panel__form { padding: 36px 28px; }
  .panel__intro { border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.06); gap: 28px; }
  .hero { min-height: auto; padding: 8px 0 24px; }
}
