
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg:         #f0f4ff;
  --white:      #ffffff;
  --border:     #e1e8f5;
  --blue:       #2563eb;
  --blue-dark:  #1d4ed8;
  --blue-deep:  #1e40af;
  --blue-mid:   #3b82f6;
  --blue-light: #60a5fa;
  --blue-pale:  #bfdbfe;
  --blue-100:   #dbeafe;
  --blue-50:    #eff6ff;
  --text:       #0f172a;
  --muted:      #64748b;
  --muted2:     #cbd5e1;
  --radius:     14px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
}

/* ── HEADER ── */
.header {
  text-align: center;
  padding: 3rem 0 2.25rem;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--blue-50);
  border: 1.5px solid var(--blue-100);
  border-radius: 99px;
  padding: 0.32rem 0.95rem;
  margin-bottom: 1.1rem;
}

.header-badge span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--blue);
}

.header h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.45rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.header p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

/* ── CARD ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(37,99,235,0.07);
}

/* ── START ── */
#start-screen { display: flex; flex-direction: column; gap: 1rem; }

.start-card { padding: 1.75rem; }

.section-label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
  margin-bottom: 0.875rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group select {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
  background: var(--white);
}
.form-group input.field-error,
.form-group select.field-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
  background: #fff8f8;
}
.form-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius);
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
}

.cats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.cat-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  background: var(--blue-50);
  border: 1.5px solid var(--blue-100);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.start-footer {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
  text-align: center;
}

.btn-primary {
  width: 100%;
  padding: 0.95rem;
  background: var(--blue);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 6px 22px rgba(37,99,235,0.38);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

/* ── QUIZ TOPBAR ── */
#quiz-screen { display: none; }

.quiz-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 1.1rem;
}

.quiz-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.btn-cancel {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 0.32rem 0.9rem;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.btn-cancel:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

/* ── PROGRESS ── */
.progress-area { margin-bottom: 1.5rem; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.prog-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prog-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
}

.prog-outer {
  height: 6px;
  background: var(--blue-100);
  border-radius: 99px;
  overflow: hidden;
}

.prog-inner {
  height: 100%;
  background: var(--blue);
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}

.cat-tag {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.22rem 0.75rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--blue-50);
  color: var(--blue);
  letter-spacing: 0.02em;
  border: 1px solid var(--blue-100);
}

/* ── QUESTION CARD ── */
.q-card {
  padding: 1.75rem 1.75rem 1.5rem;
  margin-bottom: 1rem;
  animation: fadeUp 0.25s ease;
}

@keyframes fadeUp {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}

.q-num {
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

/* ── QUESTION BODY: side-by-side ── */
.q-body {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.q-main {
  flex: 1;
  min-width: 0;
}

.q-illustration {
  flex-shrink: 0;
  width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.q-illustration img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: block;
}
.q-caption {
  margin-top: 0.5rem;
  text-align: center;
  width: 100%;
}
.q-cap-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.q-cap-src {
  display: block;
  font-size: 0.63rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.1rem;
  line-height: 1.4;
}

/* Tablet */
@media (max-width: 600px) {
  .q-illustration { width: 155px; }
  .q-body { gap: 1rem; }
  .q-cap-title { font-size: 0.67rem; }
  .q-cap-src { font-size: 0.6rem; }
}

/* iPhone */
@media (max-width: 430px) {
  .q-illustration { width: 120px; }
  .q-body { gap: 0.75rem; }
  .q-cap-title { font-size: 0.63rem; }
}

/* Sehr kleines Gerät – stapeln */
@media (max-width: 340px) {
  .q-body { flex-direction: column; align-items: center; }
  .q-illustration { width: 100%; align-items: center; }
  .q-illustration img { max-width: 200px; }
}

.q-text {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.65;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* ── SCALE ── */
.scale-wrap {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  margin-top: 0.25rem;
}

.scale-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.scale-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
  user-select: none;
}

.scale-btn:hover {
  border-color: var(--blue-pale);
  color: var(--blue);
  background: var(--blue-50);
  box-shadow: 0 2px 8px rgba(37,99,235,0.12);
}

.scale-btn.sel {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  box-shadow: 0 2px 10px rgba(37,99,235,0.3);
}

.scale-lbl {
  font-size: 0.61rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

.scale-lbl.sel { color: var(--blue); font-weight: 600; }

/* ── NAVIGATION ── */
.nav-row { display: flex; gap: 0.75rem; }

.btn-back {
  flex: 1;
  padding: 0.82rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-back:hover {
  border-color: var(--blue-pale);
  color: var(--blue);
  background: var(--blue-50);
}

.btn-next {
  flex: 2.5;
  padding: 0.82rem;
  background: var(--blue);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.3;
  pointer-events: none;
  transition: opacity 0.15s, background 0.15s, transform 0.1s;
}

.btn-next.on { opacity: 1; pointer-events: all; }
.btn-next.on:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-next.on:active { transform: translateY(0); }

/* ── RESULTS ── */
#result-screen { display: none; }

.res-header { text-align: center; padding: 2.5rem 0 1.75rem; }
.res-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}
.res-header .name { color: var(--blue); }
.res-meta { font-size: 0.82rem; color: var(--muted); font-weight: 400; }

.spider-wrap {
  padding: 1.5rem 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.score-card { padding: 1.3rem; }

.sc-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.sc-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 0.15rem;
  letter-spacing: -0.025em;
}

.sc-sub { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.6rem; }

.sc-bar { height: 4px; background: var(--blue-100); border-radius: 99px; overflow: hidden; }
.sc-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 99px;
  transition: width 0.9s cubic-bezier(0.4,0,0.2,1);
}

/* ── HELP SECTION ── */
.help-card { padding: 1.5rem; margin-bottom: 0.75rem; }

.help-ok {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.help-ok-icon { flex-shrink: 0; display: flex; align-items: center; }
.help-ok-title { font-size: 0.95rem; font-weight: 700; color: #15803d; margin-bottom: 0.25rem; }
.help-ok-sub { font-size: 0.82rem; color: #166534; line-height: 1.5; }

.help-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.help-header .section-label { margin-bottom: 0; }
.help-count {
  font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.65rem;
  background: #fef2f2; color: #dc2626; border-radius: 99px;
  border: 1px solid #fca5a5;
}
.help-intro { font-size: 0.82rem; color: var(--muted); margin-bottom: 1rem; line-height: 1.5; }

.help-list { display: flex; flex-direction: column; gap: 0.75rem; }
.help-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.help-item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.help-q-num { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.help-score-badge {
  font-size: 0.72rem; font-weight: 700;
  background: #fef2f2; color: #dc2626;
  border-radius: 99px; padding: 0.15rem 0.55rem;
  border: 1px solid #fca5a5;
}
.help-q-text { font-size: 0.85rem; font-weight: 500; color: var(--text); line-height: 1.5; margin-bottom: 0.6rem; }
.help-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.8rem; font-weight: 600; color: var(--blue);
  text-decoration: none;
  background: var(--blue-50); border: 1px solid var(--blue-100);
  border-radius: 6px; padding: 0.3rem 0.7rem;
  transition: background 0.13s, border-color 0.13s;
}
.help-link:hover { background: var(--blue-100); border-color: var(--blue); }

/* ── SVG UTILS ── */
@keyframes spin { to { transform: rotate(360deg); } }
.svg-spin { animation: spin 0.9s linear infinite; display: inline-block; vertical-align: middle; }
button svg, a svg { vertical-align: middle; }

.save-status {
  display: none;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  text-align: center;
}
.save-status--loading { display: flex; background: var(--blue-50);  color: var(--blue);      border: 1.5px solid var(--blue-100); }
.save-status--ok      { display: flex; background: #f0fdf4;          color: #16a34a;          border: 1.5px solid #bbf7d0; }
.save-status--err     { display: flex; background: #fef2f2;          color: #dc2626;          border: 1.5px solid #fca5a5; }

.excel-card { padding: 1.5rem; margin-bottom: 0.75rem; }
.excel-card h3 {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.excel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.excel-row:last-child { border-bottom: none; }
.excel-row .ek { color: var(--muted); }
.excel-row .ev { font-weight: 600; font-family: monospace; font-size: 0.83rem; }

.btn-copy {
  width: 100%;
  padding: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--blue-50);
  border: 2px dashed var(--blue-pale);
  border-radius: var(--radius);
  color: var(--blue);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 0.75rem;
}

.btn-copy:hover { background: var(--blue-100); border-color: var(--blue); }

.btn-restart {
  width: 100%;
  padding: 0.95rem;
  background: var(--blue);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 16px rgba(37,99,235,0.25);
}

.btn-restart:hover { background: var(--blue-dark); transform: translateY(-1px); }

@media(max-width:600px){
  .form-row, .cats-grid, .score-grid { grid-template-columns: 1fr; }
  .btn-primary, .btn-restart { font-size: 0.9rem; padding: 0.88rem; }
}

@media(max-width:430px){
  .nav-row { gap: 0.5rem; }
  .btn-back, .btn-next { font-size: 0.82rem; padding: 0.72rem; }
  #app { padding: 0 0.75rem 3.5rem; }
}
