/* ══════════════════════════════════════════════════════════
   Boulder Base – Frühzugang · Stylesheet (Hell)
   Touch-optimiert, Kiosk-freundlich
   ══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #f2f4f2;
  --surface:     #ffffff;
  --surface2:    #f7f8f7;
  --border:      #dde3dd;
  --text:        #1a1a1a;
  --text-muted:  #666666;
  --accent:      #6db33f;
  --accent-dark: #58962f;
  --accent-light:#eef6e7;
  --green:       #6db33f;
  --orange:      #e88a2a;
  --red:         #d93025;
  --radius:      12px;
  --shadow:      0 2px 16px rgba(0,0,0,.08);
}

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input, textarea, select { user-select: text; }

/* ── Header ────────────────────────────────────────── */
.app-header {
  background: #1a1a1a;
  border-bottom: 3px solid var(--accent);
  padding: .9rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: .03em;
}
.header-title {
  font-size: .95rem;
  color: #aaaaaa;
}
.header-logout {
  margin-left: auto;
  font-size: .85rem;
  color: #aaaaaa;
  text-decoration: none;
}
.header-logout:hover { color: #ffffff; }

/* ── Fortschrittsleiste ────────────────────────────── */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 0;
}
.step-nav-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-size: .82rem;
}
.step-nav-item.active { color: var(--text); font-weight: 600; }
.step-nav-item.done   { color: var(--accent); }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700;
  flex-shrink: 0;
}
.step-nav-item.active .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-nav-item.done   .step-num { background: var(--accent); border-color: var(--accent); color: #fff; font-size: .9rem; }
.step-connector {
  width: 32px; height: 2px;
  background: var(--border);
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .step-label { display: none; }
  .step-connector { width: 16px; }
}

/* ── Hauptinhalt ───────────────────────────────────── */
.main-content {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1.25rem 4rem;
}

/* ── Card ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1.5rem; }
.card h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--text);
}
.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 .6rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: .4rem;
}
.card-narrow   { max-width: 420px; margin-left: auto; margin-right: auto; }
.card-staff    { border-top: 4px solid var(--orange); }
.card-complete { text-align: center; }

.step-intro {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: .95rem;
}

/* ── Formulare ─────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: .8rem 1rem;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.form-control::placeholder { color: #aaa; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-control-pin { font-size: 1.4rem; letter-spacing: .2em; text-align: center; }
.form-control-inline { width: auto; display: inline-block; margin-right: .5rem; }

.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-group-small { flex: 0 0 100px !important; }
@media (max-width: 540px) {
  .form-row { flex-direction: column; gap: 0; }
  .form-group-small { flex: 1 !important; }
}

.form-actions { margin-top: 1.75rem; text-align: right; }
.form-actions-split { display: flex; justify-content: space-between; align-items: center; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.6rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  min-height: 52px;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(109,179,63,.3);
}
.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(109,179,63,.4);
}
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-secondary:hover { border-color: #aaa; background: #efefef; }
.btn-success {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(109,179,63,.3);
}
.btn-success:hover { background: var(--accent-dark); }
.btn-large  { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-small  { padding: .5rem 1rem; font-size: .88rem; min-height: 38px; }
.btn-tiny   { padding: .3rem .7rem; font-size: .8rem; min-height: 30px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Alerts ────────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: .9rem;
}
.alert-error {
  background: #fff2f1;
  border: 1px solid #f5c6c3;
  color: #8b1a14;
}
.alert-error ul { margin: .4rem 0 0 1.1rem; }
.alert-warn  { background: #fff8ed; border: 1px solid #f5dda0; color: #7a4f00; }

/* ── Quiz ──────────────────────────────────────────── */
.quiz-question {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.quiz-question.quiz-wrong {
  border-color: var(--red);
  background: #fff5f5;
}
.quiz-num { font-weight: 700; color: var(--accent); margin-right: .4rem; }
.quiz-q-text { font-weight: 600; margin-bottom: .75rem; }
.quiz-wrong-hint { color: var(--red); font-size: .85rem; margin-bottom: .5rem; }
.quiz-options { display: flex; flex-direction: column; gap: .5rem; }
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .7rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: .95rem;
}
.quiz-option:hover { border-color: var(--accent); background: var(--accent-light); }
.quiz-option.selected { border-color: var(--accent); background: var(--accent-light); }
.quiz-option input[type="radio"] {
  width: 20px; height: 20px;
  flex-shrink: 0;
  accent-color: var(--accent);
  margin-top: 2px;
  cursor: pointer;
}
.quiz-option span { flex: 1; }

/* ── Vereinbarung ──────────────────────────────────── */
.agreement-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  font-size: .9rem;
  line-height: 1.7;
  user-select: text;
}
.agreement-box h3 { font-size: 1rem; margin-bottom: .5rem; border: none; }
.agreement-box h4 { font-size: .9rem; margin: 1rem 0 .3rem; color: var(--accent-dark); }
.agreement-box p  { margin-bottom: .6rem; }
.agreement-version { font-size: .75rem; color: var(--text-muted); margin-bottom: 1rem; }

.checkbox-group { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: .85rem 1rem;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .92rem;
  line-height: 1.5;
  transition: border-color .15s, background .15s;
}
.checkbox-label:hover    { border-color: var(--accent); background: var(--accent-light); }
.checkbox-label.checked  { border-color: var(--accent); background: var(--accent-light); }
.checkbox-label input[type="checkbox"] {
  width: 22px; height: 22px;
  flex-shrink: 0;
  accent-color: var(--accent);
  margin-top: 1px;
  cursor: pointer;
}

/* ── Unterschrift ──────────────────────────────────── */
.sig-summary {
  background: var(--accent-light);
  border: 1px solid #c5e4a0;
  border-radius: 8px;
  padding: .9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: .9rem;
}
.sig-summary p { margin: .15rem 0; color: var(--text-muted); }
.sig-summary strong { color: var(--text); }

.sig-wrapper {
  position: relative;
  background: #fafafa;
  border: 2px dashed #bbb;
  border-radius: 10px;
  margin-bottom: .75rem;
  overflow: hidden;
}
.sig-canvas {
  display: block;
  width: 100%;
  height: 200px;
  cursor: crosshair;
  touch-action: none;
}
.sig-hint {
  position: absolute;
  bottom: .75rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .8rem;
  color: #ccc;
  pointer-events: none;
  white-space: nowrap;
}
.sig-actions { margin-bottom: 1rem; text-align: right; }
.sig-preview { max-width: 300px; border: 1px solid var(--border); border-radius: 6px; background: #fafafa; }

/* ── Mitarbeiterbereich ────────────────────────────── */
.staff-badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: .25rem .75rem;
  border-radius: 20px;
  margin-bottom: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.staff-pin-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.pfand-section { margin: 1rem 0; }
.pfand-section p { margin-bottom: .5rem; font-weight: 600; }

/* ── Übersichtstabelle ─────────────────────────────── */
.review-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.review-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.review-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  padding: .45rem .6rem .45rem 0;
  white-space: nowrap;
  width: 160px;
}
.review-table td { padding: .45rem .6rem; border-bottom: 1px solid var(--border); }
.review-table tr:last-child td { border-bottom: none; }
.review-sig { margin-top: 1rem; }

/* ── Admin Dashboard ───────────────────────────────── */
.admin-body  { background: #f0f2f0; }
.admin-main  { max-width: 1100px; }
.stats-row   { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stat-box {
  flex: 1; min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-box-green { border-top: 3px solid var(--accent); }
.stat-num   { display: block; font-size: 2.2rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: .8rem; color: var(--text-muted); }
.admin-filter { margin-bottom: 1rem; }
.table-wrapper { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th {
  background: #f0f4ee;
  text-align: left;
  padding: .7rem .9rem;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.admin-table td { padding: .65rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--accent-light); }

/* ── Badges ────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
}
.badge-green  { background: #e4f5d4; color: #3a7a10; }
.badge-orange { background: #fef0dc; color: #a05a00; }
.badge-gray   { background: #eee;    color: #777; }

/* ── Abschlussseite ────────────────────────────────── */
.complete-icon {
  font-size: 3rem;
  width: 90px; height: 90px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--accent);
}
.complete-text { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.complete-reminder {
  background: var(--accent-light);
  border: 1px solid #c5e4a0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  text-align: left;
}
.complete-reminder h3 { font-size: .95rem; margin-bottom: .75rem; color: var(--accent-dark); border: none; }
.complete-reminder ul { padding-left: 1.25rem; }
.complete-reminder li { margin-bottom: .35rem; font-size: .9rem; }
.complete-auto { font-size: .8rem; color: var(--text-muted); margin: 1rem 0 1.5rem; }

/* ── Footer ────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.app-footer p + p { margin-top: .2rem; }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
