/* Gemeinsame Bausteine aller App-Seiten: Farben, Knöpfe, Fenster, Hinweise, Leiste unten */
:root {
  --green: #265924;        /* Hopferl-Grün (Band, Titel, Preise) */
  --green-2: #377b30;      /* helleres Grün (Knöpfe, Datum-Pille) */
  --green-soft: #e7efe3;
  --bg: #f4efe2;           /* Creme-Hintergrund */
  --paper: #fefdf7;        /* Karten */
  --white: #ffffff;
  --ink: #1f2a1d;
  --muted: #6b7064;
  --line: #e4ddcc;
  --heart: #c0392b;
  --ok: #2f6b3a;
  --err: #a33a2a;
  --brown: var(--green);   /* Altname, wird noch in Teilen verwendet */
  --radius: 18px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); }
[hidden] { display: none !important; }

/* Knöpfe */
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 50px; padding: 12px 20px; border: 0; border-radius: 999px;
  background: var(--green-2); color: #fff; font-size: 17px; font-weight: 700;
  width: 100%;
}
.btn:disabled { opacity: .6; }
.btn-ghost {
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--green-2); background: #fff; color: var(--green); font-size: 16px; font-weight: 600;
}
.btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 8px 0; font-size: 15px; }

/* Bottom-Sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 40, 18, .45); z-index: 10; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11;
  display: flex; justify-content: center;
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-inner {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--paper); border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
}
.sheet h3 { font-family: var(--serif); color: var(--green); font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
.sheet p { margin: 0 0 14px; }
.sheet .actions { display: grid; gap: 8px; margin-top: 18px; }
.sheet .note { font-size: 14px; color: var(--muted); margin-top: 14px; }
.sheet ol { padding-left: 22px; margin: 8px 0 0; }
.sheet ol li { margin: 0 0 10px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.check input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--brown); flex: none; }
.ios-icon { display: inline-block; padding: 0 4px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--brown); color: #f5efe6; padding: 12px 18px; border-radius: 12px;
  font-size: 15px; z-index: 20; max-width: calc(100% - 32px); text-align: center;
}

/* Einrichtungs-Schritte */
.step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); opacity: .55; }
.step.active, .step.done { opacity: 1; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); font-weight: 700; font-size: 15px;
}
.step.active .step-dot { background: var(--brown); border-color: var(--brown); color: #f5efe6; }
.step.done .step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done strong { text-decoration: line-through; text-decoration-color: var(--muted); }
.step-body { display: grid; gap: 6px; align-content: start; padding-top: 4px; }
.step-text { color: var(--muted); font-size: 15px; }
.sheet .howto { margin: 4px 0 0; padding-left: 20px; }
.sheet .howto li { margin: 0 0 8px; font-size: 16px; }
.btn-danger { background: var(--err); }

/* Testhinweis oben */
.testbar { background: #1c3f1b; color: #e7efe3; text-align: center; font: 13px/1.4 var(--sans); padding: 6px 12px; }

/* Leiste unten (App-Navigation) */
body.has-appnav { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.appnav {
  position: fixed; z-index: 9000; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: var(--sans);
}
.appnav a {
  display: grid; justify-items: center; align-content: center; gap: 2px; min-width: 0; min-height: 56px;
  padding: 4px 2px; border-radius: 12px; color: var(--muted); text-decoration: none;
  font-size: 12px; font-weight: 600; line-height: 1.15; text-align: center;
}
.appnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.appnav a { position: relative; letter-spacing: .01em; }
.appnav a[aria-current="page"]::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--green); }
.appnav a[aria-current="page"] svg { stroke-width: 2.2; }
.appnav a[aria-current="page"] { color: var(--green); }
.appnav a:active { background: var(--green-soft); }
@media (min-width: 760px) {
  .appnav { left: 50%; right: auto; bottom: 14px; transform: translateX(-50%); width: 560px; border: 1px solid var(--line); border-radius: 20px; padding: 6px; box-shadow: 0 10px 30px rgba(20, 40, 18, .14); }
  body.has-appnav { padding-bottom: 100px; }
}
/* Desktop & breite Bildschirme: Leiste als ruhige Kopfzeile oben statt schwebend über dem Inhalt */
@media (min-width: 1024px) and (hover: hover) {
  .appnav {
    top: 0; bottom: auto; left: 0; right: 0; transform: none; width: auto;
    display: flex; justify-content: center; gap: 4px; padding: 6px 16px;
    border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none;
  }
  .appnav a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; font-size: 15px; }
  .appnav svg { width: 20px; height: 20px; }
  .appnav a[aria-current="page"]::before { top: auto; bottom: -6px; left: 18px; right: 18px; border-radius: 3px 3px 0 0; }
  .appnav a:hover { color: var(--green); }
  body.has-appnav { padding-bottom: 0; padding-top: 57px; }
}
/* Fenster und Hinweise über der Leiste */
.sheet-backdrop { z-index: 9500; }
.sheet { z-index: 9501; }
.toast { z-index: 9600; bottom: calc(88px + env(safe-area-inset-bottom)); }

/* iPhone: Pfeil zum Teilen-Knopf von Safari */
.ios-guide { position: fixed; inset: 0; z-index: 9700; background: rgba(20, 40, 18, .55); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 16px 14px calc(70px + env(safe-area-inset-bottom)); font-family: var(--sans); }
.ios-guide.top { justify-content: flex-start; padding-top: calc(70px + env(safe-area-inset-top)); padding-bottom: 16px; }
.ios-guide-card { width: 100%; max-width: 460px; background: var(--paper); color: var(--ink); border-radius: 20px; padding: 20px 20px 10px; }
.ios-guide-card h3 { margin: 0 0 6px; font-family: var(--serif); color: var(--green); font-size: 24px; }
.ios-guide-card p { margin: 0 0 8px; }
.ios-guide-card ol { margin: 8px 0 4px; padding-left: 22px; font-size: 17px; }
.ios-guide-card li { margin: 0 0 10px; }
.ios-guide-card small { color: var(--muted); font-size: 14px; }
.ios-guide-card .btn-link { display: block; margin: 0 auto; }
.ios-guide-arrow { position: absolute; left: 50%; bottom: calc(6px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: 52px; height: 52px; border-radius: 50%; background: var(--green); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.3); animation: nudge 1s ease-in-out infinite; }
.ios-guide-arrow svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ios-guide.top .ios-guide-arrow svg { transform: rotate(180deg); }
.ios-guide.top .ios-guide-arrow { left: auto; right: 18px; bottom: auto; top: calc(8px + env(safe-area-inset-top)); transform: none; animation-name: nudge-up; }
@keyframes nudge { 50% { transform: translate(-50%, 8px); } }
@keyframes nudge-up { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .ios-guide-arrow { animation: none; } }
body:has(.ios-guide) .appnav { display: none; }

/* Kleiner Link „Hopferl-App neu holen“ */
.reinstall:not(.big-btn) { display: block; margin: 2px auto 0; color: var(--green); font-size: 15px; }
a.btn { text-decoration: none; }

/* Einrichtung: Fortschritt und große Schritte */
.sheet .steps-check { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 6px; }
.sheet .steps-check li { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--muted); }
.sheet .steps-check li span { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 2px solid #cfc8b6; display: grid; place-items: center; font-weight: 800; color: #fff; }
.sheet .steps-check li.ok { color: var(--ink); }
.sheet .steps-check li.ok span { background: var(--green); border-color: var(--green); }
.sheet .howto.big { counter-reset: s; list-style: none; padding: 0; }
.sheet .howto.big li { counter-increment: s; position: relative; padding-left: 40px; min-height: 30px; font-size: 17px; margin-bottom: 12px; }
.sheet .howto.big li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 15px; }
.sheet .check-list { padding-left: 18px; font-size: 15px; }
.sheet .check-list li { margin-bottom: 6px; word-break: break-word; }

/* Impressum & Datenschutz unten auf jeder Seite */
.legal-links { margin: 18px 0 0; padding: 0 16px 12px; text-align: center; font-size: 14px; color: var(--muted); }
.legal-links a { color: inherit; }
