/* ══════════════════════════════════════════════════════════
   Boulder Base – Frühzugang · CSS v7 (Helles Design)
   ══════════════════════════════════════════════════════════ */

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

:root {
  --bg:           #f0f2f0;
  --surface:      #ffffff;
  --surface2:     #f6f8f6;
  --border:       #dde5dd;
  --text:         #1a1a1a;
  --text-muted:   #666666;
  --accent:       #6db33f;
  --accent-dark:  #57922e;
  --accent-light: #edf6e3;
  --orange:       #e88a2a;
  --red:          #d93025;
  --radius:       12px;
  --shadow:       0 2px 12px rgba(0,0,0,.07);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.12);
}

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 – immer weiß für Kundenbereich
   ════════════════════════════════════════════════════ */
.app-header {
  background: #ffffff;
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  padding: .8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 200;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: .02em;
}
.header-title {
  font-size: .9rem;
  color: var(--text-muted);
}

/* ── Sprachauswahl ────────────────────────────────── */
.lang-switcher {
  margin-left: auto;
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  align-items: center;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .65rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: .8rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.lang-btn:hover { background: var(--accent-light); color: var(--accent-dark); }
.lang-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.lang-flag { font-size: 1rem; line-height: 1; }
.lang-name { font-weight: 500; }

.lang-switcher-compact { margin-left: auto; }
.lang-btn-mini {
  display: inline-block;
  padding: .28rem .38rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1.1rem;
  opacity: .45;
  transition: opacity .15s, background .15s;
  border: 1px solid transparent;
  line-height: 1;
}
.lang-btn-mini:hover { opacity: .85; background: var(--accent-light); }
.lang-btn-mini.active { opacity: 1; background: var(--accent-light); border-color: var(--accent); }

/* ── Admin-Header: dunkel ─────────────────────────── */
.admin-body .app-header {
  background: #1c1c1c;
  box-shadow: none;
}
.admin-body .header-brand  { color: var(--accent); }
.admin-body .header-title  { color: #aaa; }
.admin-body .lang-btn      { color: #aaa; }
.admin-body .lang-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-body .lang-btn.active { background: var(--accent); color: #fff; }
.admin-body .lang-btn-mini  { color: #bbb; }
.admin-body .lang-btn-mini:hover { background: rgba(255,255,255,.1); }
.admin-body .lang-btn-mini.active { background: rgba(109,179,63,.25); border-color: var(--accent); }
.admin-body .header-logout { color: var(--orange) !important; }

/* ── Fortschrittsleiste ──────────────────────────── */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.step-nav-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-size: .8rem;
}
.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; }
.step-connector { width: 28px; height: 2px; background: var(--border); flex-shrink: 0; }
@media (max-width:480px) { .step-label { display:none; } .step-connector { width:12px; } }

/* ── 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.4rem; font-weight: 700; margin-bottom: .5rem; }
.card h3 {
  font-size: 1rem; font-weight: 600;
  margin: 1.5rem 0 .6rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .4rem;
}
.card-narrow   { max-width: 420px; margin: 0 auto; }
.card-complete { text-align: center; }
.step-intro    { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .95rem; }

/* ════════════════════════════════════════════════════
   STARTSEITE
   ════════════════════════════════════════════════════ */
.welcome-main { max-width: 920px; margin: 0 auto; padding: 0 1.25rem 4rem; }

.welcome-hero {
  background: linear-gradient(135deg, #1c2e14 0%, #2d5a1a 60%, #3a7022 100%);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  margin: 1.75rem 0 1.25rem;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.welcome-lead {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: .75rem;
  line-height: 1.2;
}
.welcome-intro {
  font-size: 1rem;
  color: rgba(255,255,255,.85);
  max-width: 560px;
  line-height: 1.65;
}

.welcome-cards {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.welcome-info-card {
  flex: 1;
  min-width: 190px;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.welcome-info-card strong { display: block; font-size: .9rem; margin-bottom: .1rem; }
.welcome-info-card p { color: var(--text-muted); font-size: .82rem; line-height: 1.4; }
.welcome-info-icon { font-size: 1.6rem; flex-shrink: 0; line-height: 1.2; }

.welcome-steps-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.welcome-steps-card h2 { font-size: 1.15rem; margin-bottom: 1.25rem; font-weight: 700; }
.welcome-steps {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.welcome-step-item {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  flex: 1;
  min-width: 140px;
}
.welcome-step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: .88rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: .05rem;
}
.welcome-step-text { font-size: .88rem; font-weight: 500; line-height: 1.35; }
.welcome-step-arrow { color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; padding-top: .35rem; }
@media (max-width:600px) { .welcome-step-arrow { display: none; } }

.welcome-note {
  font-size: .88rem;
  color: var(--text-muted);
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: .75rem 1rem;
  border-radius: 0 8px 8px 0;
}

.welcome-cta-area { text-align: center; padding: .5rem 0; }
.btn-welcome {
  font-size: 1.1rem;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  box-shadow: 0 4px 16px rgba(109,179,63,.35);
}

/* ════════════════════════════════════════════════════
   FORMULARE
   ════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.2rem; }
.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: #bbb; }
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 110px !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); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 2px solid var(--border); }
.btn-secondary:hover { border-color: #aaa; }
.btn-success { background: var(--accent); color: #fff; }
.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.2rem 1.4rem;
  margin-bottom: .9rem;
}
.quiz-question.quiz-wrong { border-color: var(--red); background: #fff5f5; }
.quiz-num { font-weight: 700; color: var(--accent); margin-right: .35rem; }
.quiz-q-text { font-weight: 600; margin-bottom: .7rem; }
.quiz-wrong-hint { color: var(--red); font-size: .83rem; margin-bottom: .4rem; }
.quiz-options { display: flex; flex-direction: column; gap: .45rem; }
.quiz-option {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .65rem .9rem;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 8px; cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: .93rem;
}
.quiz-option:hover, .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; }

/* ════════════════════════════════════════════════════
   VEREINBARUNG
   ════════════════════════════════════════════════════ */
.agreement-box {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  max-height: 380px;
  overflow-y: auto;
  font-size: .87rem;
  line-height: 1.7;
  user-select: text;
}
.agreement-box h4 { font-size: .9rem; margin: 1rem 0 .35rem; color: var(--accent-dark); font-weight: 700; }
.agreement-box p  { margin-bottom: .55rem; }
.agreement-version { font-size: .75rem; color: var(--text-muted); margin-bottom: .9rem; }
.agreement-header {
  background: var(--surface);
  border-radius: 8px;
  padding: .85rem 1.1rem;
  margin-bottom: 1rem;
  font-size: .85rem;
  border: 1px solid var(--border);
}
.agreement-personal {
  background: var(--accent-light);
  border: 1px solid #c5e4a0;
  border-radius: 8px;
  padding: .85rem 1.1rem;
  margin-bottom: 1rem;
  font-size: .88rem;
}
.agreement-date-block {
  margin-top: 1.25rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  font-size: .9rem;
}
.ph { background: #fff9e6; border: 1px solid #f0d070; border-radius: 3px; padding: 0 .3rem; font-style: italic; color: #5a4000; }
.cb-line { padding-left: 1.5rem; text-indent: -1.5rem; }

.scroll-indicator {
  text-align: center;
  padding: .55rem;
  background: linear-gradient(to bottom, transparent, var(--accent-light));
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  font-size: .82rem;
  color: var(--accent-dark);
  margin-bottom: 1rem;
  animation: bounce 1.5s ease-in-out infinite;
}
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
.scroll-prompt {
  text-align: center; font-size: .85rem; color: var(--text-muted);
  padding: .6rem; background: var(--surface2); border-radius: 8px; margin-bottom: 1rem;
}

/* ════════════════════════════════════════════════════
   CHECKBOXEN
   ════════════════════════════════════════════════════ */
.checkbox-group { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1.25rem; }
.checkbox-label {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: .8rem .95rem;
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: 8px; cursor: pointer;
  font-size: .9rem; line-height: 1.5;
  transition: border-color .15s, background .15s;
}
.checkbox-label:hover, .checkbox-label.checked { border-color: var(--accent); background: var(--accent-light); }
.checkbox-label.locked { opacity: .4; cursor: not-allowed; pointer-events: none; }
.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: .85rem 1.1rem; margin-bottom: 1.2rem; font-size: .9rem;
}
.sig-summary p { margin: .1rem 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; }

/* ════════════════════════════════════════════════════
   PENDING / ABSCHLUSS
   ════════════════════════════════════════════════════ */
.complete-icon {
  font-size: 2.5rem; width: 80px; height: 80px;
  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: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.complete-auto { font-size: .8rem; color: var(--text-muted); margin: 1rem 0 1.5rem; }
.pending-next-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.25rem 1.5rem; margin: 1.25rem 0; text-align: left;
}
.pending-step { display: flex; align-items: flex-start; gap: .9rem; padding: .6rem 0; }
.pending-step-num {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem; flex-shrink: 0;
  background: var(--border); color: var(--text-muted);
}
.pending-step-num.done   { background: var(--accent); color: #fff; }
.pending-step-num.active { background: var(--orange);  color: #fff; }
.pending-arrow { padding: .2rem 0 .2rem 2.4rem; color: var(--text-muted); font-size: 1.1rem; }
.pending-info-box {
  background: var(--accent-light); border: 1px solid #c5e4a0;
  border-radius: 10px; padding: 1.2rem 1.4rem; margin-bottom: 1rem; text-align: left;
}
.pending-info-box h3 { font-size: .9rem; color: var(--accent-dark); border: none; margin-bottom: .4rem; }
.pending-info-box p + p { margin-top: .4rem; }
.pending-ref { font-size: .85rem; color: var(--text-muted); margin-top: .5rem; }
.text-muted { color: var(--text-muted); }

/* ════════════════════════════════════════════════════
   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; }
::-webkit-scrollbar-track { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
/* ── Anhang zu style.css: Abbrechen-Button ─────────── */

/* Abbrechen-Button im Header */
.btn-cancel {
  margin-left: .5rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
  color: var(--red);
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-cancel:hover {
  background: #fff2f1;
  border-color: var(--red);
}

/* Admin-Header: Abbrechen-Button anpassen */
.admin-body .btn-cancel {
  color: var(--orange);
  border-color: transparent;
}
.admin-body .btn-cancel:hover {
  background: rgba(232,138,42,.15);
  border-color: var(--orange);
}

/* ── Sprachhinweis Schritt 2 ────────────────────────── */
.alert-lang-notice {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: #fff8ed;
  border: 1px solid #f5c842;
  border-left: 4px solid #e8a020;
  border-radius: 8px;
  padding: .9rem 1.1rem;
  margin-bottom: 1.1rem;
  font-size: .88rem;
  line-height: 1.55;
  color: #5a3a00;
}
.alert-lang-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }

/* ── Abbrechen-Button ──────────────────────────────── */
.btn-cancel {
  margin-left: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .9rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  color: #c0392b;
  background: #fff2f1;
  border: 1.5px solid #e8b4b0;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-cancel:hover { background: #fde8e6; border-color: #c0392b; color: #9b2317; }
.btn-cancel-icon { font-size: .9rem; line-height: 1; }
@media (max-width: 500px) { .btn-cancel-text { display: none; } .btn-cancel { padding: .4rem .55rem; } }

/* ── Sprachhinweis Schritt 2 ───────────────────────── */
.alert-lang-notice {
  display: flex; align-items: flex-start; gap: .75rem;
  background: #fff8ed; border: 1px solid #f5c842;
  border-left: 4px solid #e8a020; border-radius: 8px;
  padding: .9rem 1.1rem; margin-bottom: 1.1rem;
  font-size: .88rem; line-height: 1.55; color: #5a3a00;
}
.alert-lang-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
