/* ============================================================
   dee-fit App — Kunden-Portal (Demo/Entwurf)
   dee-fit CI: primary #556F57 · secondary #FFEAB0 · heading-green #416645
   text #424242 · accent-dark #212121 · bg-warm #FCF5F0 · gray #757575
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", sans-serif;
  color: #424242;
  background: #FCF5F0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Abhaya Libre", Georgia, serif;
  color: #416645;
  font-weight: 800;
  margin: 0 0 10px;
}

a { color: #556F57; }
p { margin: 0 0 12px; line-height: 1.5; }

.btn {
  display: inline-block;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  padding: 11px 26px;
  border-radius: 8px;
  border: 2px solid #556F57;
  background: #556F57;
  color: #FFEAB0;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover { background: transparent; color: #556F57; }

.btn-outline {
  background: transparent;
  color: #556F57;
}
.btn-outline:hover { background: #556F57; color: #FFEAB0; }

.btn-sm { padding: 7px 16px; font-size: 12.5px; border-radius: 6px; }

/* ---------- Entwurf-Badge ---------- */

.draft-banner {
  background: #212121;
  color: #FFEAB0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 7px 12px;
}
.draft-banner strong { color: #fff; }

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

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #FCF5F0 0%, #F3E7D8 100%);
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(65, 102, 69, 0.15);
  padding: 44px 40px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.login-card img.login-logo { height: 52px; margin: 0 auto 22px; display: block; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card .sub { color: #757575; font-size: 13.5px; margin-bottom: 26px; }

.field { text-align: left; margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #757575;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1.5px solid #E5DACB;
  background: #FCF5F0;
  font-size: 14px;
  font-family: inherit;
  color: #424242;
}
.field input:focus { outline: none; border-color: #556F57; }

.login-card .btn { width: 100%; margin-top: 6px; }
.login-hint { margin-top: 18px; font-size: 11.5px; color: #757575; }

/* ============================================================
   APP SHELL — native-app-Gefühl: Topbar oben, Content mittig
   scrollbar, feste Bottom-Nav (Tab-Bar) unten
   ============================================================ */

#app-shell { display: none; min-height: 100vh; flex-direction: column; }
#app-shell.active { display: flex; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #EFE7DE;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-logo { height: 30px; }
.topbar-user {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.user-avatar-sm {
  width: 36px; height: 36px; border-radius: 50%;
  background: #A86030; color: #FFEAB0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13.5px;
}
.user-avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: #A86030; color: #FFEAB0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px;
  margin: 0 auto;
}

.app-content {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 18px calc(96px + env(safe-area-inset-bottom, 0px));
}

.tab-section { display: none; }
.tab-section.active { display: block; }

.page-header { margin-bottom: 18px; }
.page-header .eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: #556F57; display: block; margin-bottom: 6px;
}

/* ---------- Segmented control (Sub-Navigation innerhalb eines Tabs) ---------- */

.segmented-control {
  display: flex;
  gap: 6px;
  background: #EFE7DE;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.segment {
  flex: 1;
  min-width: max-content;
  white-space: nowrap;
  border: none;
  background: transparent;
  padding: 10px 14px;
  border-radius: 9px;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  color: #757575;
  cursor: pointer;
  transition: all 0.18s ease;
}
.segment.active {
  background: #fff;
  color: #A86030;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sub-panel { display: none; }
.sub-panel.active { display: block; }

/* ---------- Cards / grids ---------- */

.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(65, 102, 69, 0.08);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card h3 { font-size: 17px; margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.logout-link {
  background: none; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: #757575;
  padding: 10px 0; text-align: left; width: 100%; font-family: inherit;
}
.logout-link:hover { color: #A86030; }

/* ---------- Fixed bottom navigation (Tab-Bar) ---------- */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  background: #fff;
  border-top: 1px solid #EFE7DE;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.06);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav-item {
  flex: 1;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 12px;
  color: #757575;
  font-family: "Nunito", sans-serif;
  transition: color 0.15s ease, background 0.15s ease;
}
.bottom-nav-item .bn-ic { font-size: 21px; line-height: 1; }
.bottom-nav-item .bn-label { font-size: 10.5px; font-weight: 700; }
.bottom-nav-item.active { color: #A86030; }
.bottom-nav-item.active .bn-ic { transform: translateY(-1px); }
.bottom-nav-item:active { background: #FCF5F0; }

@media (max-width: 880px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .app-content { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Dashboard ---------- */

.welcome-banner {
  background: linear-gradient(120deg, #416645, #556F57);
  color: #fff;
  border-radius: 16px;
  padding: 28px 30px;
  margin-bottom: 22px;
}
.welcome-banner h2 { color: #fff; font-size: 24px; margin-bottom: 6px; }
.welcome-banner p { color: #EAF0E7; margin-bottom: 0; }

.progress-track {
  background: #EFE7DE;
  border-radius: 20px;
  height: 14px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.progress-fill {
  background: #FFEAB0;
  height: 100%;
  border-radius: 20px;
  transition: width 0.4s ease;
}
.progress-label { font-size: 12.5px; color: #EAF0E7; }

.stat-card { text-align: center; }
.stat-card .num { font-family: "Abhaya Libre", serif; font-size: 30px; color: #416645; font-weight: 800; }
.stat-card .label { font-size: 12px; color: #757575; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Trainingsplan ---------- */

.plan-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid #EFE7DE;
}
.plan-day:last-child { border-bottom: none; }
.plan-day .day-name { font-weight: 800; color: #416645; width: 90px; flex: none; }
.plan-day .exercise { flex: 1; font-size: 13.5px; }
.plan-check { width: 20px; height: 20px; accent-color: #556F57; cursor: pointer; }

/* ---------- Ernährungsplan / Upsell ---------- */

.meal-row { padding: 10px 0; border-bottom: 1px dashed #EFE7DE; font-size: 13.5px; }
.meal-row:last-child { border-bottom: none; }
.meal-row .meal-time { font-weight: 800; color: #556F57; display: inline-block; width: 90px; }

.upsell-lock {
  position: relative;
  background: #FCF5F0;
  border: 1.5px dashed #556F57;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-top: 10px;
}
.upsell-lock .lock-ic { font-size: 26px; margin-bottom: 8px; }
.upsell-lock h4 { margin-bottom: 6px; }
.upsell-lock p { color: #757575; font-size: 13px; }
.upsell-price { font-family: "Abhaya Libre", serif; color: #416645; font-size: 20px; font-weight: 800; margin: 8px 0 14px; }

/* ---------- Fortschritt / Charts ---------- */

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; margin: 16px 0 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 100%; background: #556F57; border-radius: 6px 6px 0 0; transition: height 0.5s ease; }
.bar-col .bar-label { font-size: 11px; color: #757575; margin-top: 6px; }
.bar-col.today .bar { background: #FFBC7D; }

.weight-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #EFE7DE; font-size: 13.5px; }
.weight-row:last-child { border-bottom: none; }

/* ---------- Life-Coaching Tools ---------- */

.script-quote {
  font-family: "Mrs Saint Delafield", cursive;
  color: #FFBC7D;
  font-size: 26px;
  text-align: center;
  margin: 6px 0 20px;
}

textarea.journal-input {
  width: 100%;
  min-height: 110px;
  border-radius: 10px;
  border: 1.5px solid #E5DACB;
  background: #FCF5F0;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: #424242;
  resize: vertical;
}
textarea.journal-input:focus { outline: none; border-color: #556F57; }

.journal-entry {
  background: #FCF5F0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 13px;
}
.journal-entry .entry-date { font-size: 11px; color: #757575; margin-bottom: 4px; display: block; }

.meditation-player {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #FCF5F0;
  border-radius: 12px;
  padding: 18px 20px;
}
.play-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: #556F57; color: #FFEAB0;
  border: none; font-size: 18px; cursor: pointer;
  flex: none;
  display: flex; align-items: center; justify-content: center;
}
.med-track-name { font-weight: 800; color: #416645; }
.med-track-sub { font-size: 12px; color: #757575; }
.med-timer { font-family: "Abhaya Libre", serif; font-size: 20px; color: #416645; margin-left: auto; }

.goal-form .field { margin-bottom: 14px; }
.goal-card {
  background: #FCF5F0;
  border-left: 4px solid #556F57;
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 14px;
}
.goal-card .goal-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #757575; }

/* ---------- Termine ---------- */

.appointment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.appointment-card .when { font-family: "Abhaya Libre", serif; font-size: 18px; color: #416645; font-weight: 800; }

/* ---------- Challenge ---------- */

.challenge-card { text-align: center; }
.challenge-card .challenge-text { font-size: 17px; color: #212121; margin: 10px 0 18px; }
.streak-badge {
  display: inline-block;
  background: #FFEAB0;
  color: #212121;
  font-weight: 800;
  font-size: 12.5px;
  padding: 6px 16px;
  border-radius: 20px;
  margin-top: 12px;
}

/* ---------- Value Ladder / Pricing ---------- */

.tier-card {
  border: 2px solid #EFE7DE;
  border-radius: 14px;
  padding: 22px 18px;
  text-align: center;
  background: #fff;
}
.tier-card.current { border-color: #556F57; background: #FCF5F0; }
.tier-card .tier-name { font-family: "Abhaya Libre", serif; font-weight: 800; color: #416645; font-size: 17px; }
.tier-card .tier-price { font-size: 26px; font-weight: 800; color: #212121; margin: 8px 0; }
.tier-card .tier-price span { font-size: 13px; color: #757575; font-weight: 600; }
.tier-badge {
  display: inline-block; background: #556F57; color: #FFEAB0;
  font-size: 10.5px; font-weight: 800; padding: 3px 10px; border-radius: 10px;
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em;
}

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #212121;
  color: #FFEAB0;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
