/* PapaShift - shared.css */
/* Einbinden: <link rel="stylesheet" href="shared.css"> */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@400;500&display=swap');

/*  Design-Tokens  */
:root {
  --ink:         #1a1814;
  --ink-soft:    #4a4740;
  --ink-muted:   #8a8780;
  --paper:       #f7f4ef;
  --warm:        #ede9e2;
  --accent:      #c4521a;
  --accent-soft: #f0e8e0;
  --green:       #16a34a;
  --green-soft:  #f0fdf4;
  --gold:        #b45309;
  --gold-soft:   #fef9c3;
  --blue:        #2563eb;
  --blue-soft:   #eff6ff;
  --purple:      #7c3aed;
  --purple-soft: #f5f3ff;
  --red:         #dc2626;
  --red-soft:    #fef2f2;
  --success:     #16a34a;

  --sans:   'DM Sans', system-ui, sans-serif;
  --serif:  'DM Serif Display', Georgia, serif;

  --r:      14px;
  --r-sm:   8px;
  --nav:    64px;
  --sb:     env(safe-area-inset-bottom, 0px);
}

/*  Reset  */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/*  Buttons  */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  min-height: 50px;
  text-decoration: none;
  transition: opacity .15s;
  -webkit-appearance: none;
}
.btn:active { opacity: .8; }
.btn-primary { background: var(--ink);    color: white; }
.btn-accent  { background: var(--accent); color: white; }
.btn-ghost   { background: var(--warm);   color: var(--ink-soft); }
.btn-danger  { background: var(--red);    color: white; }
.btn-sm      { padding: 10px 14px; font-size: 13px; min-height: 40px; }
.btn-inline  { width: auto; display: inline-block; padding: 10px 20px; }
.btn-stack   { display: flex; flex-direction: column; gap: 8px; }

/*  Form-Elemente  */
.form-input, input[type="text"], input[type="email"],
input[type="password"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--warm);
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 16px;  /* min 16px verhindert iOS-Zoom */
  color: var(--ink);
  background: white;
  outline: none;
  -webkit-appearance: none;
  transition: border-color .15s;
}
.form-input:focus,
input:focus, textarea:focus { border-color: var(--ink); }
.form-hint { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

/*  Cards  */
.card {
  background: white;
  border: 1px solid var(--warm);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 10px;
}
.card-accent { border-color: var(--accent); background: #fffaf7; }

/*  Section-Labels  */
.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 18px 0 8px;
}
.section-label:first-child { margin-top: 0; }

/*  Login Overlay (alle Seiten)  */
.ps-login {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 32px);
}
.ps-login.hidden { display: none; }
.ps-login-logo {
  font-family: var(--serif);
  font-size: 36px;
  color: white;
  margin-bottom: 6px;
}
.ps-login-sub {
  font-size: 14px;
  color: rgba(255,255,255,.4);
  margin-bottom: 32px;
  text-align: center;
  line-height: 1.5;
}
.ps-login-form { width: 100%; max-width: 340px; }
.ps-login-err  {
  font-size: 13px;
  color: #fca5a5;
  text-align: center;
  min-height: 18px;
  margin-bottom: 10px;
}
.ps-login-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 16px;
  color: white;
  background: rgba(255,255,255,.08);
  outline: none;
  margin-bottom: 10px;
  -webkit-appearance: none;
  transition: border-color .15s;
}
.ps-login-input:focus { border-color: var(--accent); }
.ps-login-input::placeholder { color: rgba(255,255,255,.25); }
.ps-login-btn {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 10px;
  min-height: 52px;
}
.ps-login-ghost {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: rgba(255,255,255,.4);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
}
.ps-login-switch {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255,255,255,.35);
}
.ps-login-switch span {
  color: rgba(255,255,255,.65);
  cursor: pointer;
  text-decoration: underline;
}

/*  Top-Navigation (zurueck zu index)  */
.ps-topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid var(--warm);
  position: sticky;
  top: 0;
  z-index: 99;
}
.ps-topnav-back {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--paper);
  white-space: nowrap;
  flex-shrink: 0;
}
.ps-topnav-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  flex: 1;
  text-align: center;
}

/*  Toast  */
.ps-toast {
  position: fixed;
  bottom: 24px;
  left: 16px;
  right: 16px;
  max-width: 448px;
  margin: 0 auto;
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  transition: opacity .25s;
  z-index: 999;
  pointer-events: none;
}
.ps-toast.show { opacity: 1; }

/*  Modal / Sheet  */
.ps-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 20, .55);
  z-index: 200;
  display: none;
  align-items: flex-end;
}
.ps-modal.show { display: flex; }
.ps-sheet {
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + var(--sb));
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  animation: ps-slideup .25s ease;
}
@keyframes ps-slideup {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.ps-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--warm);
  border-radius: 2px;
  margin: 0 auto 18px;
}
.ps-sheet-title {
  font-family: var(--serif);
  font-size: 20px;
  margin-bottom: 14px;
}

/*  Spacer  */
.spacer    { height: 16px; }
.spacer-sm { height: 8px; }
.spacer-lg { height: 32px; }

/*  Grid  */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/*  Utility  */
.hidden   { display: none !important; }
.fade-in  { animation: ps-fadein .25s ease; }
@keyframes ps-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.text-muted   { color: var(--ink-muted); }
.text-accent  { color: var(--accent); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-center  { text-align: center; }
.fw-500       { font-weight: 500; }
.serif        { font-family: var(--serif); }

/*  AI-Loading Dots  */
.ai-loading {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  justify-content: center;
}
.ai-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: ps-dot .9s ease-in-out infinite;
}
.ai-dot:nth-child(2) { animation-delay: .2s; }
.ai-dot:nth-child(3) { animation-delay: .4s; }
@keyframes ps-dot {
  0%, 80%, 100% { opacity: .2; }
  40%           { opacity: 1; }
}

/*  Chips / Tags  */
.chip {
  padding: 8px 14px;
  border: 1.5px solid var(--warm);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: white;
  color: var(--ink-soft);
  font-family: var(--sans);
  min-height: 40px;
}
.chip.on { background: var(--ink); color: white; border-color: var(--ink); }
.chips   { display: flex; flex-wrap: wrap; gap: 6px; }

/*  Pill-Badge  */
.pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
}
.pill-accent  { background: var(--accent-soft);  color: var(--accent); }
.pill-green   { background: var(--green-soft);   color: var(--green);  }
.pill-gold    { background: var(--gold-soft);     color: var(--gold);   }
.pill-blue    { background: var(--blue-soft);     color: var(--blue);   }
.pill-red     { background: var(--red-soft);      color: var(--red);    }
.pill-muted   { background: var(--warm);          color: var(--ink-muted); }

/* ── REDUCED MOTION FALLBACK (Bug Fix: ältere Android-Geräte) ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Explizite Fallbacks für Onboarding-Animationen */
.ob-profil-item, .ob-cta, .ob-card, .ob-step {
  will-change: auto;
}
@supports not (animation-timeline: scroll()) {
  .ob-profil-item { opacity: 1 !important; transform: none !important; }
}
