/* =====================================================================
   MAMI AUSZEIT – GESTALTUNG
   Leitfarbe Pastelllila, Akzente Rosa / Gelb / Grün / Blau.
   Mobile first. Viel Ruhe, viel Weißraum, weiche Rundungen.
   ===================================================================== */

:root {
  /* Leitfarbe */
  --lila-100: #F4F0FB;
  --lila-200: #E7DFF7;
  --lila-300: #D3C5EF;
  --lila-400: #B9A5E2;
  --lila-500: #9C86CE;
  --lila-700: #6B5A99;

  /* Akzente */
  --rosa: #F6D3DF;
  --rosa-tief: #E2A8BC;
  --gelb: #FBEAC0;
  --gelb-tief: #E7C878;
  --gruen: #CFE4CB;
  --gruen-tief: #9BC095;
  --blau: #CEDFEE;
  --blau-tief: #93B7D4;

  /* Flächen */
  --bg: #FDFBFE;
  --karte: rgba(255, 255, 255, 0.78);
  --karte-voll: #FFFFFF;
  --linie: rgba(155, 133, 200, 0.16);

  /* Schrift */
  --text: #443C55;
  --text-weich: #7B7189;
  --text-zart: #A79FB3;

  /* Einheitliche Textgröße: Fließtext und Überschriften in den Kapiteln
     sind gleich groß. Fett sind nur die Überschriften. */
  --text-gross: 1.06rem;

  --radius: 26px;
  --radius-klein: 18px;
  --schatten: 0 10px 34px -14px rgba(114, 92, 168, 0.30);
  --schatten-weich: 0 4px 20px -10px rgba(114, 92, 168, 0.22);

  --breite: 560px;
  --tabbar: 74px;
}

* { box-sizing: border-box; }

/* Grundgröße für alle Icons.
   Ohne diese Regel wird ein SVG ohne width/height riesig (Browser-Standard
   300x150 px). Es bleibt zwar unsichtbar, fängt aber Klicks ab, die
   eigentlich den Button daneben treffen sollten. Spezifischere Regeln
   weiter unten (.tab svg, .stern svg …) überschreiben diesen Wert. */
svg {
  width: 1em;
  height: 1em;
  flex: none;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Sanfte Farbschleier im Hintergrund – bewusst sehr zurückhaltend */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(62% 46% at 10% -6%, rgba(196, 178, 234, 0.72), transparent 72%),
    radial-gradient(52% 38% at 98% 6%, rgba(211, 197, 239, 0.58), transparent 74%),
    radial-gradient(46% 30% at 88% 40%, rgba(246, 211, 223, 0.22), transparent 76%),
    radial-gradient(64% 42% at 46% 106%, rgba(185, 165, 226, 0.42), transparent 76%);
}

/* ---------- Markenlogo oben rechts ---------- */

.marken-logo {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 18px;
  z-index: 5;
  width: 68px;
  height: auto;
  opacity: 0.92;
  pointer-events: none;
  user-select: none;
}

/* Auf den Einstiegsseiten steht das Logo groß in der Mitte,
   dort wäre es in der Ecke doppelt. */
body.ohne-tabbar .marken-logo { display: none; }

@media (min-width: 620px) {
  .marken-logo { width: 78px; right: 24px; }
}

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: 1.65rem; }
h2 { font-size: 1.3rem; }

/* Überschriften in den Kapiteln: gleiche Größe wie der Fließtext,
   unterschieden nur durch das Gewicht. */
h3 { font-size: var(--text-gross); font-weight: 600; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

/* ---------- Grundgerüst ---------- */

#app {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 0 20px calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 28px);
  min-height: 100vh;
}

body.ohne-tabbar #app { padding-bottom: 40px; }

.screen {
  animation: sanft-rein 0.5s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

@keyframes sanft-rein {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.kopf {
  padding: calc(env(safe-area-inset-top, 0px) + 34px) 0 20px;
}

/* Platz für das Logo nur dort lassen, wo der Text wirklich bis ganz nach
   oben reicht. In den Kapiteln steht über der Überschrift der
   Zurück-Knopf – dort liegt das Logo ohnehin daneben und die Überschrift
   darf die volle Breite nutzen. */
body:not(.ohne-tabbar) .kopf > .gruss,
body:not(.ohne-tabbar) .kopf > .gruss + h1 { padding-right: 74px; }

.kopf .gruss {
  font-size: 0.9rem;
  color: var(--text-weich);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

/* ---------- Karten ---------- */

.karte {
  background: var(--karte);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 24px 22px;
  margin-bottom: 16px;
}

.karte.zart {
  box-shadow: var(--schatten-weich);
  background: rgba(255, 255, 255, 0.6);
}

.karte-label {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--lila-500);
  margin-bottom: 10px;
}

.karte h2 { margin-bottom: 12px; }

.hinweis {
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--text-weich);
  margin-top: 10px;
}

/* ---------- Buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 16px 24px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.985); }

.btn-primaer {
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--lila-400) 0%, var(--lila-500) 100%);
  box-shadow: 0 10px 26px -12px rgba(124, 100, 184, 0.75);
}

.btn-sanft {
  color: var(--lila-700);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--linie);
  box-shadow: var(--schatten-weich);
}

.btn-still {
  min-height: 48px;
  background: none;
  color: var(--text-weich);
  font-size: 0.94rem;
  font-weight: 400;
  box-shadow: none;
}

.btn-still:hover { color: var(--lila-700); }

.btn + .btn { margin-top: 10px; }

/* ---------- Untere Navigation ---------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(253, 251, 254, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--linie);
}

.tabbar-inner {
  display: flex;
  width: 100%;
  max-width: var(--breite);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 58px;
  padding: 7px 4px;
  border: none;
  background: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-zart);
  cursor: pointer;
  transition: color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab svg { width: 23px; height: 23px; stroke-width: 1.6; }
.tab.aktiv { color: var(--lila-500); font-weight: 500; }

/* ---------- Themenpunkte ---------- */

.punkt {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: none;
}

.thema-lila  { background: var(--lila-300); }
.thema-rosa  { background: var(--rosa); }
.thema-gelb  { background: var(--gelb); }
.thema-gruen { background: var(--gruen); }
.thema-blau  { background: var(--blau); }

.karte[data-akzent='lila']  { border-top: 3px solid var(--lila-300); }
.karte[data-akzent='rosa']  { border-top: 3px solid var(--rosa); }
.karte[data-akzent='gelb']  { border-top: 3px solid var(--gelb); }
.karte[data-akzent='gruen'] { border-top: 3px solid var(--gruen); }
.karte[data-akzent='blau']  { border-top: 3px solid var(--blau); }

/* ---------- Kapitel ---------- */

.kapitel-thema {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lila-500);
  margin-bottom: 8px;
}

.kapitel-dauer {
  font-size: 0.85rem;
  color: var(--text-zart);
  margin-top: 8px;
}

/* Fließtext in Impuls und Übung: gleiche Größe wie die Überschriften,
   aber bewusst nicht fett. */
.impuls p,
.uebung li {
  font-size: var(--text-gross);
  font-weight: 400;
  line-height: 1.72;
}

.gedanke {
  position: relative;
  text-align: center;
  padding: 30px 22px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(244, 240, 251, 0.9), rgba(246, 211, 223, 0.42));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--schatten-weich);
  margin-bottom: 16px;
}

.gedanke .karte-label { color: var(--lila-500); }

.gedanke p {
  font-size: 1.17rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--lila-700);
}

.uebung {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.88), rgba(246, 211, 223, 0.42));
}

.uebung ul { margin: 0; padding: 0; list-style: none; }
.uebung li { margin-bottom: 0.85em; }
.uebung li:last-child { margin-bottom: 0; }

/* ---------- Energie-Check-in (Akku) ---------- */

.akku {
  display: flex;
  gap: 5px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--linie);
}

.akku-zelle {
  flex: 1;
  height: 52px;
  min-width: 0;
  border: none;
  border-radius: 9px;
  background: rgba(160, 145, 190, 0.13);
  cursor: pointer;
  transition: background-color 0.35s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.akku-zelle:first-child { border-radius: 12px 9px 9px 12px; }
.akku-zelle:last-child  { border-radius: 9px 12px 12px 9px; }
.akku-zelle:active { transform: scaleY(0.94); }

.akku-wert {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-weich);
}

.akku-wert strong {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
}

/* ---------- Eingaben ---------- */

.feld {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 15px 18px;
  margin-bottom: 10px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--linie);
  border-radius: var(--radius-klein);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  -webkit-appearance: none;
}

.feld::placeholder { color: var(--text-zart); }

.feld:focus {
  border-color: var(--lila-300);
  box-shadow: 0 0 0 4px rgba(211, 197, 239, 0.35);
}

textarea.feld {
  min-height: 110px;
  resize: vertical;
}

.feld-nummer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.feld-nummer .zahl {
  flex: none;
  width: 28px;
  font-size: 0.9rem;
  color: var(--lila-400);
  text-align: center;
}

.feld-nummer .feld { margin-bottom: 0; }

.gespeichert {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 18px;
  font-size: 0.78rem;
  color: var(--gruen-tief);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;   /* reine Rückmeldung – darf nie einen Klick abfangen */
}

.gespeichert svg { width: 14px; height: 14px; }

.gespeichert.zeigen { opacity: 1; }

/* ---------- Bewertung ---------- */

.sterne {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.stern {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--lila-200);
  transition: color 0.25s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.stern svg { width: 30px; height: 30px; }
.stern.an { color: var(--gelb-tief); }
.stern:active { transform: scale(0.9); }

/* ---------- Meine Reise ---------- */

.thema-karte {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.thema-kopf {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.thema-kopf h3 { flex: 1; font-size: 1.12rem; }

.thema-intro {
  font-size: 0.95rem;
  color: var(--text-weich);
  margin-bottom: 16px;
}

.kapitel-liste {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}

.kapitel-zeile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 0.93rem;
  color: var(--text-weich);
}

.kapitel-zeile .marke {
  flex: none;
  width: 20px;
  display: grid;
  place-items: center;
  color: var(--gruen-tief);
}

.kapitel-zeile .marke svg { width: 15px; height: 15px; }

.kapitel-zeile.offen { color: var(--text-zart); }
.kapitel-zeile.offen .marke::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(160, 145, 190, 0.24);
}

.kapitel-zeile.naechste {
  color: var(--lila-700);
  font-weight: 500;
}

.kapitel-zeile.naechste .marke { color: var(--lila-400); }

.thema-fertig {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--gruen-tief);
  pointer-events: none;
}

.thema-fertig svg { width: 15px; height: 15px; }

/* ---------- Journal ---------- */

.journal-eintrag {
  padding: 20px 22px;
}

.journal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-zart);
  margin-bottom: 12px;
}

.journal-block { margin-bottom: 16px; }
.journal-block:last-child { margin-bottom: 0; }

.journal-frage {
  font-size: 0.83rem;
  color: var(--lila-500);
  margin-bottom: 4px;
}

.journal-text {
  font-size: 0.99rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.journal-text li { margin-bottom: 2px; }
.journal-text ul { margin: 0; padding-left: 20px; }

.leer {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-weich);
}

.leer .emoji { font-size: 2rem; display: block; margin-bottom: 12px; }

/* ---------- Einstellungen ---------- */

.zeile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid var(--linie);
  background: none;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.zeile:last-child { border-bottom: none; }
.zeile .wert { margin-left: auto; color: var(--text-zart); font-size: 0.92rem; }
.zeile.gefahr { color: var(--rosa-tief); }

.schalter {
  flex: none;
  position: relative;
  width: 52px;
  height: 31px;
  margin-left: auto;
  border: none;
  border-radius: 999px;
  background: rgba(160, 145, 190, 0.24);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.schalter::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(90, 70, 140, 0.28);
  transition: transform 0.3s cubic-bezier(0.3, 0.8, 0.3, 1);
}

.schalter[aria-checked='true'] { background: var(--lila-400); }
.schalter[aria-checked='true']::after { transform: translateX(21px); }

/* ---------- Onboarding & Zugang ---------- */

.mitte {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 40px;
}

.onb-punkte {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 34px;
}

.onb-punkt {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lila-200);
  transition: width 0.35s ease, background-color 0.35s ease;
}

.onb-punkt.aktiv { width: 22px; background: var(--lila-400); }

.onb-text {
  text-align: center;
  margin-bottom: 40px;
}

.onb-text h1 { margin-bottom: 18px; }

.onb-text p {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-weich);
}

.logo {
  text-align: center;
  margin-bottom: 26px;
}

.logo img {
  width: 148px;
  height: auto;
}

.code-feld {
  text-align: center;
  font-size: 1.14rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.fehler {
  font-size: 0.9rem;
  color: var(--rosa-tief);
  text-align: center;
  min-height: 22px;
  margin-top: 10px;
}

/* ---------- Abschluss eines Kapitels ---------- */

.abschluss {
  text-align: center;
  padding: 42px 26px;
  background: linear-gradient(155deg, rgba(244, 240, 251, 0.95), rgba(246, 211, 223, 0.5));
}

.abschluss .herz {
  font-size: 2.1rem;
  display: block;
  margin-bottom: 14px;
}

.abschluss h2 { margin-bottom: 12px; }
.abschluss p { color: var(--text-weich); }

/* ---------- Kleinigkeiten ---------- */

.zurueck {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 4px;
  margin-left: -4px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--text-weich);
  cursor: pointer;
}

.zurueck svg { width: 17px; height: 17px; }

.trenner {
  height: 1px;
  border: none;
  background: var(--linie);
  margin: 26px 0;
}

.fliesstext { font-size: 0.97rem; line-height: 1.7; color: var(--text-weich); }
.fliesstext h3 { color: var(--text); margin: 24px 0 8px; }
.fliesstext h3:first-child { margin-top: 0; }
.fliesstext ul { padding-left: 20px; }
.fliesstext li { margin-bottom: 6px; }
.fliesstext a { color: var(--lila-700); }

.mt { margin-top: 26px; }
.zentriert { text-align: center; }

/* ---------- Bestätigungsdialog ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(68, 60, 85, 0.32);
  backdrop-filter: blur(6px);
  animation: sanft-rein 0.3s ease both;
}

.dialog {
  width: 100%;
  max-width: 380px;
  padding: 28px 24px 22px;
  background: var(--karte-voll);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -20px rgba(80, 60, 130, 0.45);
}

.dialog h3 { margin-bottom: 10px; }
.dialog p { font-size: 0.95rem; color: var(--text-weich); }

/* ---------- Größere Displays ---------- */

@media (min-width: 620px) {
  body { font-size: 17.5px; }
  h1 { font-size: 1.85rem; }
  .karte { padding: 28px 26px; }
}
