/* Fahrlizenz - look after docs/design-vorlage.md and the colleague's prototype
   (src/app/globals.css). System fonts only: nothing is loaded from anywhere. */

:root {
  /* Colours (design-vorlage.md, "Farben") */
  --navy-950: #050a18;
  --navy-900: #0a1128;
  --navy-850: #0d1633;
  --navy-800: #111c3f;
  --navy-700: #1b2a5c;
  --navy-600: #26397a;
  --coral-600: #d9463b;
  --coral-500: #f55a4d;
  --coral-400: #ff7a63;
  --orange-400: #ff8a3d;
  --helix-blue: #3b6cff;
  --helix-violet: #7b3bff;
  --helix-magenta: #c53bff;
  --helix-lavender: #b8c4f5;
  --mint-400: #34d399;
  --mint-300: #6ee7b7;
  --ink-50: #f4f6fb;
  --ink-200: #c9d1e8;
  --ink-400: #9aa6c9;
  --ink-500: #6f7ba3; /* placeholders and decoration only, never small readable text */

  --card-border: rgba(184, 196, 245, 0.12);
  --line: rgba(184, 196, 245, 0.1);
  --line-faint: rgba(184, 196, 245, 0.05);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -30px rgba(0, 0, 0, 0.8);
  --focus: 3px solid rgba(255, 138, 61, 0.8);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--navy-950);
  color: var(--ink-50);
  font: 400 1rem/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

a { color: var(--coral-400); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: var(--focus); outline-offset: 3px; }

h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; margin: 0 0 0.25rem; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
p { margin: 0 0 0.75rem; }

.muted { color: var(--ink-400); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --- Background: three soft lights over navy (.bg-stage) ------------------ */
.bg-stage {
  background-color: var(--navy-950);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(59, 108, 255, 0.28), transparent 60%),
    radial-gradient(700px 500px at -10% 40%, rgba(123, 59, 255, 0.22), transparent 60%),
    radial-gradient(600px 400px at 60% 110%, rgba(197, 59, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #070d20 0%, #050a18 100%);
  background-attachment: fixed;
}

/* --- Building blocks ------------------------------------------------------ */
.card {
  background: linear-gradient(180deg, rgba(17, 28, 63, 0.85), rgba(10, 17, 40, 0.9));
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 1.25rem;
}

.text-gradient-brand {
  background: linear-gradient(90deg, #ff7a63 0%, #f55a4d 40%, #c53bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin: 1rem 0 0.5rem;
}
.label:first-child { margin-top: 0; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin: 0;
}
.eyebrow.coral { color: var(--coral-400); }

.stripe {
  height: 3px;
  width: 3rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #f55a4d, #ff8a3d);
}

.input {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1rem;
  border-radius: 16px;
  background: rgba(5, 10, 24, 0.6);
  border: 1px solid rgba(184, 196, 245, 0.18);
  color: var(--ink-50);
  font: inherit;
  font-size: 1.0625rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input::placeholder { color: var(--ink-500); }
.input:focus {
  outline: none;
  border-color: rgba(255, 122, 99, 0.7);
  box-shadow: 0 0 0 4px rgba(245, 90, 77, 0.18);
}
.input[aria-invalid="true"] { border-color: rgba(245, 90, 77, 0.8); }
select.input { padding-right: 2.5rem; }
.input.code {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.35em;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.wide { width: 100%; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #ff7a63 0%, #f55a4d 55%, #e64a3d 100%);
  box-shadow: 0 10px 30px -10px rgba(245, 90, 77, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { box-shadow: 0 14px 36px -10px rgba(245, 90, 77, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3); }

.btn-secondary {
  color: var(--ink-50);
  background: rgba(184, 196, 245, 0.08);
  border: 1px solid rgba(184, 196, 245, 0.18);
}
.btn-secondary:hover { background: rgba(184, 196, 245, 0.14); }

.btn-ghost { color: var(--ink-200); background: transparent; }
.btn-ghost:hover { background: rgba(184, 196, 245, 0.08); }

.btn-sm { min-height: 2.75rem; padding: 0 1rem; font-size: 0.9375rem; border-radius: 12px; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* Status pills: outlined, upper case. The text carries the meaning, not the colour. */
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(184, 196, 245, 0.2);
  background: rgba(184, 196, 245, 0.05);
  color: var(--ink-200);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.pill.mint { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.1); color: var(--mint-300); }
.pill.coral { border-color: rgba(245, 90, 77, 0.4); background: rgba(245, 90, 77, 0.1); color: var(--coral-400); }
.pill.blue { border-color: rgba(59, 108, 255, 0.4); background: rgba(59, 108, 255, 0.1); color: var(--helix-lavender); }

/* Messages and refusals */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.notice {
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  border: 1px solid rgba(184, 196, 245, 0.2);
  background: rgba(184, 196, 245, 0.06);
}
.notice.error, .messages .error { border-color: rgba(245, 90, 77, 0.4); background: rgba(245, 90, 77, 0.1); color: var(--coral-400); }
.notice.success, .messages .success, .messages .info { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.1); color: var(--mint-300); }
.errorlist { list-style: none; padding: 0; margin: 0.4rem 0 0; color: var(--coral-400); font-size: 0.9rem; }

.hint { font-size: 0.9rem; color: var(--ink-400); margin-top: 1rem; }
.hint strong { color: var(--ink-200); }

/* --- Participant screens --------------------------------------------------- */
.visitor {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 28rem;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(1rem, env(safe-area-inset-bottom));
}
.visitor-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.5rem; }
.visitor-top img { display: block; width: 140px; height: auto; }
.visitor-top form { margin: 0; }
.visitor-hero { margin-top: 2.5rem; }
.visitor-hero h1 { font-size: 2.35rem; line-height: 1.05; margin-top: 0.75rem; }
.visitor-hero .stripe { margin-top: 1.25rem; }
.visitor-hero .lead { margin-top: 1.25rem; font-size: 1.125rem; color: var(--ink-200); }
.visitor .card { margin-top: 2rem; }
.visitor-foot { margin-top: auto; padding-top: 2.5rem; }
.visitor-foot img { display: block; width: 100%; height: 6rem; opacity: 0.8; }
.visitor-foot p { text-align: center; font-size: 0.8rem; color: var(--ink-400); margin: 0.25rem 0 0; }

.signed-in-name { font-size: 2rem; font-weight: 700; line-height: 1.1; margin: 0.25rem 0 0; overflow-wrap: anywhere; }

/* --- Admin ---------------------------------------------------------------- */
.admin { display: flex; min-height: 100vh; min-height: 100dvh; }

.admin-side {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: 15rem;
  flex-shrink: 0;
  flex-direction: column;
  padding: 1.25rem;
  border-right: 1px solid var(--line);
  background: rgba(5, 10, 24, 0.7);
}
.admin-side img { display: block; width: 130px; height: auto; }
.admin-side .eyebrow { margin-top: 0.5rem; }
.admin-side nav { margin-top: 1.5rem; }
.admin-side-foot { margin-top: auto; font-size: 0.8rem; color: var(--ink-400); }
.admin-side-foot p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.admin-nav a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  color: var(--ink-200);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.admin-nav a:hover { background: rgba(184, 196, 245, 0.08); color: #fff; }
.admin-nav a[aria-current="page"] { background: rgba(245, 90, 77, 0.15); color: #fff; }

.admin-body { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.admin-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 10, 24, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.admin-top img { display: block; width: 100px; height: auto; }

/* The phone menu: <details>, so it works without a script. */
.admin-menu { position: relative; }
.admin-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 12px;
  color: var(--ink-200);
  font-size: 1.25rem;
  cursor: pointer;
}
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu summary:hover { background: rgba(184, 196, 245, 0.08); }
.admin-menu-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: rgba(5, 10, 24, 0.97);
  box-shadow: var(--shadow-card);
}
.admin-menu-panel form { margin-top: 0.75rem; }

.admin-main { flex: 1; padding: 1.5rem 1rem 3rem; max-width: 64rem; width: 100%; }
.page-head { margin-bottom: 1.25rem; }
.page-head p { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--ink-400); }

@media (min-width: 1024px) {
  .admin-side { display: flex; }
  .admin-top { display: none; }
  .admin-main { padding: 2rem; }
}

/* Forms in the admin: a card, labels above fields */
.form-card { max-width: 32rem; }

/* --- QR page -------------------------------------------------------------- */
.qr-name { font-size: 1.75rem; font-weight: 700; margin: 0.25rem 0 1rem; overflow-wrap: anywhere; }
.qr-frame { margin: 0; }
/* Black on white, whatever the page: a camera needs the contrast. */
.sign-in-qr {
  display: block;
  width: 100%;
  max-width: 20rem;
  height: auto;
  background: #fff;
  border-radius: 16px;
}
.qr-frame figcaption { margin-top: 0.75rem; font-size: 0.9rem; color: var(--ink-400); }

/* --- Motion --------------------------------------------------------------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.qr-card { display: inline-block; max-width: 100%; }

/* --- Participant list: built for the registration desk -------------------- */
/* The search stays in reach while scrolling. Below 1024 px it sits under the
   sticky top bar, above it at the very top. */
.people-search {
  position: sticky;
  top: var(--admin-top-height, 0px);
  z-index: 20;
  margin: 0 -1rem 1rem;
  padding: 0.5rem 1rem;
  background: rgba(5, 10, 24, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.admin { --admin-top-height: 4.25rem; }
@media (min-width: 1024px) {
  .admin { --admin-top-height: 0px; }
  .people-search { margin: 0 -2rem 1rem; padding: 0.75rem 2rem; }
}

.people-card { padding: 0; overflow: hidden; }
.people-head {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
}
.people { list-style: none; margin: 0; padding: 0; }
.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--line-faint);
}
.person-row:last-child { border-bottom: 0; }
.person-row:hover { background: rgba(184, 196, 245, 0.04); }
.person-row.empty { color: var(--ink-400); padding: 1rem; }
.person-row .who { min-width: 0; }
.person-row p { margin: 0; line-height: 1.35; }
.person-row .line1 { font-size: 1rem; }
.person-row .line1 .pill { margin-left: 0.25rem; }
.person-row .line2 { font-size: 0.85rem; color: var(--ink-400); }
.person-row .address { overflow-wrap: anywhere; }
.person-row .status.seen { color: var(--mint-300); }
.person-row form { margin: 0; flex-shrink: 0; }

/* Phone: the button goes under the text rather than squeezing the row. */
@media (max-width: 599px) {
  .person-row { flex-direction: column; align-items: flex-start; padding: 0.6rem 1rem; }
}

.known-address { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: 0 0 0.5rem; font-size: 1.0625rem; }
.known-address span { font-weight: 600; overflow-wrap: anywhere; }
.known-address a { font-size: 0.9rem; }
