/* Gestaltung: schlicht, mobil, gut lesbar. Shop-Bildschirme und Studienrahmen
   sind optisch getrennt (Studienrahmen grau, Shop weiß). */

:root {
  --ink: #1d232b;
  --muted: #5d6673;
  --line: #dfe3e8;
  --bg: #f4f5f7;
  --brand: #1f5f8b;
  --brand-ink: #ffffff;
  --info-bg: #eaf3fb;
  --info-line: #b9d6ee;
  --danger: #b3261e;
  --ok: #1e7b45;
  --radius: 12px;
  font-size: 17px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

#app { max-width: 520px; margin: 0 auto; min-height: 100vh; background: #fff; }

h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .6rem; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 .5rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); font-size: .92rem; }
.small { font-size: .85rem; }

.page { padding: 20px 20px 32px; }
.study { background: var(--bg); min-height: 100vh; }
.study .card { background: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }

/* Buttons */
.btn {
  display: block; width: 100%;
  padding: 14px 16px; margin: 10px 0 0;
  font: inherit; font-weight: 600;
  border-radius: 10px; border: 1.5px solid var(--brand);
  background: var(--brand); color: var(--brand-ink);
  cursor: pointer; text-align: center;
}
.btn.secondary { background: #fff; color: var(--brand); }
.btn.link { background: none; border: none; color: var(--brand); font-weight: 500; padding: 10px 0; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-row { margin-top: 18px; }

/* Formulare */
label.field { display: block; margin: 14px 0 4px; font-weight: 600; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], textarea {
  width: 100%; font: inherit; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); }
.error { color: var(--danger); font-size: .9rem; margin-top: 6px; }

.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; margin: 8px 0; cursor: pointer; }
.choice input { margin-top: 4px; width: 20px; height: 20px; flex: none; }
.choice.checked { border-color: var(--brand); background: var(--info-bg); }

/* Studienleiste */
#studybar {
  position: sticky; top: 0; z-index: 20;
  max-width: 520px; margin: 0 auto;
  background: #2b313a; color: #fff;
  font-size: .82rem; padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
}
#studybar .grow { flex: 1; }
#studybar button { font: inherit; background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.testbadge { background: #c77700; color: #fff; padding: 1px 6px; border-radius: 4px; font-weight: 700; }

/* Shop */
.shop-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 1.3rem; letter-spacing: .5px; color: var(--brand); }
.logo span { color: #e0a100; }
.back { font: inherit; background: none; border: none; color: var(--brand); padding: 0; cursor: pointer; }
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.product { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.product .img { height: 90px; }
.product .txt { padding: 8px 10px; font-size: .9rem; }
.menu { list-style: none; padding: 0; margin: 12px 0; border-top: 1px solid var(--line); }
.menu li { border-bottom: 1px solid var(--line); }
.menu button { width: 100%; text-align: left; font: inherit; background: none; border: none; padding: 15px 2px; cursor: pointer; display: flex; justify-content: space-between; color: var(--ink); }
.menu button::after { content: "›"; color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.status-ok { color: var(--ok); font-weight: 600; font-size: .92rem; }
.status-no { color: var(--muted); font-size: .92rem; }
.btn.inline { display: inline-block; width: auto; margin: 0; padding: 8px 12px; font-size: .9rem; }

.passkey-icon { width: 56px; height: 56px; margin: 8px 0 12px; }
.center { text-align: center; }
.center .passkey-icon { margin-left: auto; margin-right: auto; display: block; }

/* Info-Kasten (nur Variante B) */
.info { display: flex; gap: 10px; background: var(--info-bg); border: 1px solid var(--info-line); border-radius: 10px; padding: 12px; margin: 14px 0; font-size: .93rem; text-align: left; }
.info svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.info p { margin: 0 0 6px; }
.info p:last-child { margin-bottom: 0; }

/* Autofill-Vorschlag (nachgebildet) */
.autofill { border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.12); overflow: hidden; }
.autofill button { width: 100%; display: flex; gap: 10px; align-items: center; padding: 12px; background: #fff; border: none; font: inherit; text-align: left; cursor: pointer; }
.autofill svg { width: 28px; height: 28px; flex: none; }
.autofill .sub { color: var(--muted); font-size: .85rem; }

/* Overlay: Systemabfrage, Fragen, Dialoge */
#overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.info.above-sheet { margin: 16px; width: calc(100% - 32px); max-width: 488px; }
#overlay[hidden] { display: none; }
.sheet { width: 100%; max-width: 520px; background: #fff; border-radius: 18px 18px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
.sheet.system { background: #f2f2f4; text-align: center; }
.sheet.system .sys-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }
.sheet.system .bio { width: 64px; height: 64px; margin: 6px auto 12px; display: block; }
.sheet.system .btn { border-radius: 12px; }
.dialog { width: calc(100% - 32px); max-width: 440px; background: #fff; border-radius: 14px; padding: 20px; margin: auto; max-height: 90vh; overflow: auto; }

/* PIN */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 14px 0; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots span.on { background: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 0 auto; }
.keypad button { font: inherit; font-size: 1.3rem; padding: 14px 0; border-radius: 50px; border: none; background: #fff; cursor: pointer; }
.keypad .empty { visibility: hidden; }

/* Benachrichtigung (nachgebildete E-Mail mit Code) */
.notice { position: fixed; top: 46px; left: 50%; transform: translateX(-50%); width: calc(100% - 24px); max-width: 496px; background: #fff; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); padding: 12px 14px; z-index: 60; font-size: .92rem; }

/* Skalen im Fragebogen */
.item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.item .q { font-weight: 500; margin-bottom: 10px; }
.scale { display: grid; gap: 4px; }
.scale.s5 { grid-template-columns: repeat(5, 1fr); }
.scale.s7 { grid-template-columns: repeat(7, 1fr); }
.scale label { display: flex; flex-direction: column; align-items: center; font-size: .85rem; cursor: pointer; }
.scale input { width: 24px; height: 24px; margin: 0 0 2px; }
.scale-ends { display: flex; justify-content: space-between; gap: 12px; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.scale-ends span { max-width: 45%; }
.scale-ends span:last-child { text-align: right; }
.missing .q { color: var(--danger); }
.progress { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.id-box { font-size: 1.6rem; font-weight: 800; letter-spacing: 2px; text-align: center; padding: 16px; border: 2px dashed var(--brand); border-radius: 12px; margin: 12px 0; }
.consent-text { font-size: .93rem; }
.consent-text h2 { font-size: 1rem; margin: 1rem 0 .3rem; }
