/* ============================================================
   GEBURT IN VERTRAUEN — Design Tokens
   Teal/Sand/Cream Palette, consistent with the existing
   workbook + PDF materials (#1B5E5E header teal).
   ============================================================ */

:root {
  --teal: #1B5E5E;
  --teal-deeper: #143F3F;
  --teal-soft: #DCEDED;
  --sand: #C9A876;
  --sand-soft: #EADFC9;
  --cream: #FAF7F1;
  --white: #FFFFFF;
  --text-dark: #222222;
  --text-grey: #666666;
  --shadow: 0 8px 24px rgba(20, 40, 40, 0.10);

  /* Funnel-specific tokens */
  --gold: #B0813F;
  --charcoal: #2A2823;

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Karla", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--text-dark);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

p { margin: 0; line-height: 1.55; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--sand);
  outline-offset: 2px;
}

a { color: inherit; }

/* ---------- App shell ---------- */

.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.app-frame {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  position: relative;
}

/* ---------- Top bar (shared) ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: calc(1.1rem + env(safe-area-inset-top, 0px)) 1.25rem 0.9rem;
}

.topbar .back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.topbar .back svg { width: 16px; height: 16px; }

.topbar .title {
  font-size: 1rem;
  color: var(--text-grey);
  letter-spacing: 0.02em;
  flex: 1;
}

.topbar-logo {
  height: 22px;
  width: auto;
  opacity: 0.55;
  flex-shrink: 0;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */

#screen-login .app-frame {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: calc(2rem + env(safe-area-inset-top, 0px)) 1.75rem calc(2rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream) 62%, var(--teal-soft) 100%);
  overflow: hidden;
}

.login-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 38vh;
  z-index: 0;
}

.login-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}

.login-logo {
  display: block;
  width: 80px;
  height: auto;
  margin: 0 auto 1rem;
}

.login-content h1 {
  font-size: 1.7rem;
  color: var(--teal-deeper);
  line-height: 1.25;
}

.login-content .sub {
  color: var(--text-grey);
  font-size: 0.97rem;
  max-width: 22rem;
}

.code-form {
  width: 100%;
  max-width: 19rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.code-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1.5px solid rgba(27, 94, 94, 0.18);
  background: var(--white);
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.04em;
  color: var(--text-dark);
  font-family: var(--font-body);
}

.code-form input::placeholder { color: #a9a39a; letter-spacing: normal; }

.btn-primary, .btn-secondary { text-decoration: none; }

.btn-primary {
  background: var(--teal);
  color: var(--white);
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:active { transform: scale(0.98); }
.btn-primary:hover { background: var(--teal-deeper); }

.login-error {
  color: #9c4b3a;
  font-size: 0.86rem;
  min-height: 1.1rem;
}

.login-foot {
  position: relative;
  z-index: 1;
  margin-top: 2.2rem;
  font-size: 0.78rem;
  color: var(--text-grey);
}

/* ============================================================
   HOME SCREEN
   ============================================================ */

.home-header {
  padding: calc(2rem + env(safe-area-inset-top, 0px)) 1.5rem 1.25rem;
}

.home-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.home-logo {
  display: block;
  width: 48px;
  height: auto;
}

.logout-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(27, 94, 94, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.logout-btn svg {
  width: 14px;
  height: 14px;
  fill: var(--text-grey);
}

.logout-btn:hover { background: rgba(27, 94, 94, 0.13); }

.home-header .eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand);
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: block;
}

.home-header h1 {
  font-size: 1.55rem;
  color: var(--teal-deeper);
  margin-bottom: 0.55rem;
}

.home-header p {
  color: var(--text-grey);
  font-size: 0.92rem;
}

.section-label {
  padding: 0 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-grey);
  margin: 1.5rem 0 0.7rem;
  display: block;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0 1.25rem 1.5rem;
}

.audio-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  text-align: left;
  width: 100%;
}

.audio-card .num {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-deeper);
  font-family: var(--font-display);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.audio-card.done .num {
  background: var(--sand);
  color: var(--white);
}

.audio-card .meta { flex: 1; min-width: 0; }

.audio-card .meta .name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--text-dark);
  margin-bottom: 0.22rem;
  line-height: 1.25;
}

.audio-card .meta .desc {
  display: block;
  font-size: 0.82rem;
  color: var(--text-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-card .play-dot {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-card .play-dot svg { width: 13px; height: 13px; fill: var(--teal); }

.workbook-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--teal-deeper);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  color: var(--white);
}

.workbook-card .icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.workbook-card .icon svg { width: 19px; height: 19px; fill: var(--sand); }

.workbook-card .meta { flex: 1; }
.workbook-card .name { display: block; font-family: var(--font-display); font-size: 1.0rem; margin-bottom: 0.2rem; }
.workbook-card .desc { display: block; font-size: 0.8rem; opacity: 0.75; }

.workbook-card .chev { opacity: 0.6; flex-shrink: 0; }

/* ============================================================
   PLAYER SCREEN — signature breathing-wave element
   ============================================================ */

#screen-player .app-frame {
  background: var(--teal-deeper);
  color: var(--white);
  display: flex;
  flex-direction: column;
}

#screen-player .topbar .back { background: rgba(255,255,255,0.12); box-shadow: none; }
#screen-player .topbar .back svg { fill: var(--white); }
#screen-player .topbar .title { color: rgba(255,255,255,0.55); }

.player-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.75rem 2.5rem;
}

.player-heading {
  text-align: center;
  margin-top: 0.5rem;
}

.player-heading .eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand);
  font-weight: 700;
}

.player-heading h2 {
  font-size: 1.5rem;
  margin-top: 0.5rem;
  color: var(--white);
}

.player-heading .desc {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.62);
  max-width: 21rem;
}

/* the wave stage: a quiet breathing animation that runs while
   audio plays, and settles flat when paused — visualising the
   core reframe of the program ("Wellen statt Wehen"). */
.wave-stage {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  position: relative;
}

.wave-stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wave-path {
  fill: rgba(201, 168, 118, 0.85);
  transform-origin: center;
  animation: none;
}

.wave-path.alt {
  fill: rgba(255, 255, 255, 0.18);
  animation: none;
}

.wave-stage.playing .wave-path {
  animation: breathe 5.2s ease-in-out infinite;
}

.wave-stage.playing .wave-path.alt {
  animation: breathe-alt 5.2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.94) translateY(2%); }
  50% { transform: scale(1.05) translateY(-2%); }
}

@keyframes breathe-alt {
  0%, 100% { transform: scale(1.02) translateY(-1%); }
  50% { transform: scale(0.93) translateY(3%); }
}

@media (prefers-reduced-motion: reduce) {
  .wave-stage.playing .wave-path,
  .wave-stage.playing .wave-path.alt { animation: none; }
}

.play-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-btn svg { width: 26px; height: 26px; fill: var(--teal-deeper); margin-left: 2px; }

.wave-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 2;
}

.player-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.scrub-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
}

.scrub-row input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}

.scrub-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--sand);
}

.transport-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
}

.transport-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
}

.transport-btn svg { width: 17px; height: 17px; fill: rgba(255,255,255,0.85); }

.player-footnote {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  margin-top: 0.4rem;
}

.player-footnote svg { width: 13px; height: 13px; fill: rgba(255,255,255,0.55); }

.download-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  color: rgba(255,255,255,0.55);
}

.download-toggle.saved { color: var(--sand); }

/* ============================================================
   WORKBOOK SCREEN
   ============================================================ */

.workbook-body {
  padding: 0.5rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.workbook-cover {
  background: var(--teal-deeper);
  border-radius: 20px;
  padding: 1.8rem 1.6rem;
  color: var(--white);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.workbook-cover .pages {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand);
}

.workbook-cover h2 {
  font-size: 1.25rem;
  margin-top: 0.3rem;
}

.workbook-cover .sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  margin-top: 0.3rem;
}

.workbook-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-secondary {
  background: var(--white);
  color: var(--teal-deeper);
  border: 1.5px solid var(--teal-soft);
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.94rem;
}

.quote-block {
  background: var(--teal-soft);
  border-radius: 16px;
  padding: 1.2rem 1.3rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--teal-deeper);
  line-height: 1.5;
}

/* ============================================================
   APP FOOTER
   ============================================================ */

.app-footer {
  text-align: center;
  padding: 0.75rem 1.5rem 0.9rem;
  font-size: 0.72rem;
  color: var(--text-grey);
  opacity: 0.6;
  line-height: 1.5;
}

.app-footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(102, 102, 102, 0.35);
  text-underline-offset: 2px;
}

.app-footer a:hover {
  opacity: 1;
}

/* ============================================================
   BOTTOM TAB BAR
   ============================================================ */

.tabbar {
  display: flex;
  border-top: 1px solid rgba(27, 94, 94, 0.08);
  background: var(--white);
  padding: 0.55rem 0.5rem calc(0.55rem + env(safe-area-inset-bottom, 0));
}

.tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0;
  color: var(--text-grey);
  font-size: 0.68rem;
}

.tabbar button svg { width: 19px; height: 19px; fill: var(--text-grey); }

.tabbar button.active { color: var(--teal); }
.tabbar button.active svg { fill: var(--teal); }

/* ============================================================
   PDF VIEWER SCREEN
   ============================================================ */

.pdf-frame {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.pdf-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #525659;
  min-height: 0;
}

.pdf-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
}

.pdf-container canvas {
  display: block;
  max-width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.pdf-loading, .pdf-error {
  color: rgba(255, 255, 255, 0.75);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ============================================================
   OFFLINE TOAST
   ============================================================ */

.toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--teal-deeper);
  color: var(--white);
  padding: 0.65rem 1.1rem;
  border-radius: 12px;
  font-size: 0.84rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
  max-width: 88%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   FUNNEL PAGES (start.html, angebot.html, workbook.html, danke.html)
   ============================================================ */

html { scroll-behavior: smooth; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Eyebrow label (global — app's nested .home-header/.player-heading selectors take precedence) */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
  display: block;
}

/* Hero */
.hero {
  padding: 56px 0 8px;
  text-align: center;
}

.portrait-frame {
  width: 196px;
  height: 196px;
  margin: 0 auto 28px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 1px rgba(31,78,74,0.14), 0 18px 36px -18px rgba(31,78,74,0.45);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.wrap h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--teal);
  margin: 0 0 16px;
}

.hero p.sub {
  font-size: 17px;
  color: #3C6B66;
  max-width: 420px;
  margin: 0 auto;
}

/* Breath divider — renamed animation to avoid conflict with player's @keyframes breathe */
.breath-divider {
  width: 100%;
  height: 34px;
  margin: 44px 0;
  overflow: hidden;
}

.breath-divider svg {
  width: 140%;
  height: 100%;
  margin-left: -20%;
  display: block;
}

.breath-divider path {
  fill: none;
  stroke: var(--sand);
  stroke-width: 2;
  transform-origin: center;
  animation: breathe-divider 6.4s ease-in-out infinite;
}

@keyframes breathe-divider {
  0%, 100% { transform: scaleY(0.55); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .breath-divider path { animation: none; transform: scaleY(0.8); opacity: 0.8; }
}

/* Personal note */
.note {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.55;
  color: var(--charcoal);
  text-align: center;
  max-width: 460px;
  margin: 0 auto;
}

.signature {
  display: block;
  margin-top: 18px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: #3C6B66;
}

/* Section heading */
.section { padding: 8px 0 0; }

.section h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  color: var(--teal);
  margin: 0 0 24px;
  text-align: center;
}

/* Includes list */
.includes { display: flex; flex-direction: column; gap: 18px; }

.include-item {
  background: var(--white);
  border: 1px solid rgba(31,78,74,0.14);
  border-radius: 14px;
  padding: 20px 22px;
}

.include-item .label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--teal);
  margin: 0 0 6px;
}

.include-item p { margin: 0; font-size: 15px; color: var(--charcoal); }

/* Price card */
.price-card {
  background: var(--sand-soft);
  border: 1.5px solid var(--sand);
  border-radius: 20px;
  padding: 38px 28px 34px;
  text-align: center;
  color: var(--charcoal);
  margin-top: 8px;
}

.price-card .eyebrow { color: var(--gold); }

.price-old {
  font-family: var(--font-body);
  font-size: 16px;
  text-decoration: line-through;
  color: #3C6B66;
  opacity: 0.75;
  margin: 0 0 4px;
}

.price-new {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 10vw, 52px);
  line-height: 1;
  margin: 0 0 10px;
  color: var(--teal);
}

.price-new sup { font-size: 0.4em; font-weight: 500; margin-left: 2px; }
.price-note { font-size: 14.5px; color: #3C6B66; margin: 0; }

/* CTA zone */
.cta-zone { margin-top: 36px; text-align: center; }
.cta-lead { font-size: 14.5px; color: #3C6B66; margin: 0 0 18px; }

.widget-placeholder {
  border: 1.5px dashed var(--gold);
  border-radius: 14px;
  padding: 26px 20px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--gold);
  background: var(--sand-soft);
}

/* Opt-in form */
.optin-card {
  background: var(--white);
  border: 1.5px solid rgba(31,78,74,0.14);
  border-radius: 20px;
  padding: 32px 26px;
  text-align: center;
}

.optin-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 21px;
  color: var(--teal);
  margin: 0 0 18px;
}

.optin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}

.optin-form input[type="email"] {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 14px 16px;
  border: 1.5px solid rgba(31,78,74,0.14);
  border-radius: 10px;
  background: var(--cream);
  color: var(--charcoal);
}

.optin-form input[type="email"]::placeholder { color: #3C6B66; opacity: 0.6; }

.optin-form button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  padding: 14px 16px;
  border: none;
  border-radius: 10px;
  background: var(--teal);
  color: var(--cream);
  cursor: pointer;
}

.optin-form button:hover { background: var(--teal-deeper); }

/* Trust line */
.trust {
  text-align: center;
  font-size: 13.5px;
  color: #3C6B66;
  margin: 28px 0 0;
  letter-spacing: 0.01em;
}

/* Funnel footer */
footer {
  text-align: center;
  padding: 56px 0 48px;
  font-size: 13px;
  color: #3C6B66;
  opacity: 0.8;
}

/* Focus styles for funnel links */
.wrap a:focus-visible, .wrap button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (min-width: 600px) {
  .hero { padding-top: 72px; }
  .include-item { padding: 24px 26px; }
}
