/* Palette taken from akkreditierung.io's tailwind.config.js (see concept, section 7). */
@font-face { font-family: "Outfit"; font-weight: 400; font-display: swap; src: url("fonts/outfit-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url("fonts/outfit-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url("fonts/outfit-latin-600-normal.woff2") format("woff2"); }

:root {
  --accent: #c00;
  --accent-hover: #b30000;
  --accent-active: #900000;
  --on-accent: #fff;
  --bg: #f4f4f4;
  --surface: #fff;
  --text: #555;
  --text-strong: #333;
  --muted: #888;
  --success: #3ca849;
  --warning: #e4a11b;
  --error: #dc4c64;
  --neutral: #999;
  --border: #bebebe;
  --radius: 12px;
  --tap: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

h1, h2 { color: var(--text-strong); font-weight: 600; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid #e6e6e6; margin: 1.25rem 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .9rem; margin: .5rem 0 0; }
.eyebrow { color: var(--muted); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 .25rem; }

/* ---------------------------------------------------------------- layout */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem; padding-top: max(.75rem, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 3px solid var(--accent);
}
.brand { color: var(--accent); font-weight: 600; font-size: 1.1rem; text-decoration: none; }
.topbar-user { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.topbar-user form { margin: 0; }

.container { max-width: 560px; margin: 0 auto; padding: 1rem 1rem 2.5rem; }
.card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stack { display: flex; flex-direction: column; gap: .75rem; margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; font-size: 1.3rem; text-align: center; }

.page-login .container { display: flex; min-height: 100vh; align-items: center; }
.login-card { width: 100%; }
.login-card h1 { color: var(--accent); }

/* ---------------------------------------------------------------- forms & buttons */
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; color: var(--text-strong); }
input[type="text"], input[type="password"], input[type="search"], input:not([type]) {
  font: inherit; color: var(--text-strong);
  min-height: var(--tap); padding: .6rem .9rem;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type="file"] { font: inherit; font-weight: 400; color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--tap); padding: .6rem 1.2rem;
  font: inherit; font-weight: 600; text-align: center; text-decoration: none;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); }
.btn-secondary { background: #fff; color: var(--neutral); border-color: var(--border); }
.btn-secondary:hover { color: #777; border-color: var(--neutral); }
.btn-secondary:active { background: #eee; }
.btn-danger { background: #fff; color: var(--error); border-color: var(--error); }
.btn-danger:active { background: #fdeef1; }
.btn-block { width: 100%; }
.btn-big { min-height: 64px; font-size: 1.15rem; }
.btn-small { min-height: 40px; padding: .35rem .8rem; font-size: .9rem; }
.link-button { background: none; border: 0; padding: .25rem; font: inherit; color: var(--accent); cursor: pointer; }

.actions { display: grid; gap: .75rem; margin-bottom: 1rem; }

/* ---------------------------------------------------------------- alerts & notices */
.alert, .notice { border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; border-left: 5px solid; background: var(--surface); }
.alert-success, .notice-success { border-color: var(--success); background: #eef8ef; color: #2b7a35; }
.alert-error, .notice-error { border-color: var(--error); background: #fdeef1; color: #b0334a; }
.notice-warning { border-color: var(--warning); background: #fdf5e6; color: #8a5f0a; }
.notice-neutral { border-color: var(--neutral); background: #f2f2f2; }
.notice-big { font-size: 1.3rem; font-weight: 600; text-align: center; }
.notice { margin: 1rem 0 0; }

.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge-success { background: var(--success); color: #fff; }
.badge-neutral { background: #ececec; color: var(--muted); }

/* ---------------------------------------------------------------- home stats */
.subevent-name { word-break: break-word; }
.stats { display: flex; gap: 2rem; margin: 1rem 0 .75rem; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 2.4rem; font-weight: 600; line-height: 1; color: var(--text-strong); }
.stat:first-child .stat-value { color: var(--success); }
.stat-label { color: var(--muted); font-size: .9rem; }
.progress { height: 10px; background: #ececec; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--success); transition: width .4s ease; }

/* ---------------------------------------------------------------- scanner */
.scanner {
  position: relative; overflow: hidden; border-radius: var(--radius); background: #111;
  aspect-ratio: 1 / 1; max-height: 60vh; margin: 0 auto 1rem; width: 100%;
}
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame {
  position: absolute; inset: 15%; border: 3px solid rgba(255,255,255,.85); border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.25); pointer-events: none; transition: border-color .2s;
}
.scanner.is-paused video { filter: grayscale(1) brightness(.6); }
.scanner.is-paused .scanner-frame { border-color: transparent; }
.scanner-message {
  position: absolute; left: 1rem; right: 1rem; bottom: 1rem; padding: .6rem .8rem;
  background: rgba(0,0,0,.65); color: #fff; border-radius: 10px; text-align: center; font-size: .95rem;
}
.scanner-message.is-error { background: var(--error); }

/* ---------------------------------------------------------------- match card */
.match-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
  border-top: 6px solid var(--neutral); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.match-card.is-success { border-top-color: var(--success); }
.match-card.is-warning { border-top-color: var(--warning); }
.match-card.is-error { border-top-color: var(--error); }
.match-card.is-error .match-name { color: var(--error); margin-bottom: 1rem; }
.match-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.match-name { font-size: 1.5rem; margin: 0; word-break: break-word; }
.match-details { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin: .9rem 0 0; }
.match-details dt { color: var(--muted); }
.match-details dd { margin: 0; color: var(--text-strong); font-weight: 500; font-size: 1.15rem; }
.match-actions { display: grid; gap: .6rem; margin-top: 1.25rem; }

/* ---------------------------------------------------------------- search */
.search-input { font-size: 1.1rem; margin-bottom: .75rem; }
.guest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.guest-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%;
  min-height: var(--tap); padding: .7rem 1rem; text-align: left;
  font: inherit; color: inherit; background: var(--surface); border: 1px solid #e6e6e6; border-radius: 10px; cursor: pointer;
}
.guest-row:active { background: #f8f8f8; }
.guest-row-main { display: flex; flex-direction: column; min-width: 0; }
.guest-row-name { color: var(--text-strong); font-weight: 500; overflow-wrap: anywhere; }
.guest-row-seat { color: var(--muted); font-size: .9rem; }

.empty-state { text-align: center; }
