/* ============================================================
   Wedding – Melis & Tugay · Mediterranes Design in Erdtönen
   ============================================================ */
@import url('../fonts/fonts.css');

:root {
  --matcha:       #8A9A5B;
  --matcha-dark:  #71804A;
  --sage:         #A3B18A;
  --sage-soft:    #C3CDB0;
  --olive-leaf:   #93A385;   /* gedecktes, leicht gräuliches Blattgrün */
  --cream:        #F5F0E8;
  --linen:        #FAF7F0;
  --taupe:        #B8A88F;
  --taupe-soft:   #D9CDBB;
  --ink:          #4A4A3A;
  --ink-soft:     #7A7A66;
  --brass:        #B3A272;   /* mattes Messing/Champagner */
  --danger:       #A6543F;   /* gedecktes Terrakotta statt grelles Rot */
  --card-shadow:  0 2px 10px rgba(74, 74, 58, 0.08);
  --radius:       16px;
  --serif:        'Playfair Display', Georgia, serif;
  --serif-soft:   'Cormorant Garamond', Georgia, serif;
  --sans:         'Inter', -apple-system, 'Segoe UI', sans-serif;
  --tabbar-h:     calc(64px + env(safe-area-inset-bottom, 0px));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* --------------- Grund-Elemente --------------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); }
a { color: var(--matcha-dark); }
button { font-family: var(--sans); }

.hidden { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--matcha); color: #fff; border: 0;
  border-radius: 999px; padding: 13px 26px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:hover { background: var(--matcha-dark); }
.btn.secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--taupe); }
.btn.secondary:hover { background: var(--linen); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 8px 16px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

.icon-btn {
  background: none; border: 0; cursor: pointer; padding: 8px;
  color: var(--ink-soft); border-radius: 10px; line-height: 0;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: rgba(138,154,91,.1); color: var(--matcha-dark); }

/* Formulare */
label.field { display: block; margin-bottom: 14px; }
label.field > span {
  display: block; font-size: 13.5px; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 5px; letter-spacing: .02em;
}
input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=url], input[type=number], input[type=date], textarea, select {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--taupe-soft); border-radius: 12px;
  background: var(--linen); color: var(--ink);
  font-family: var(--sans); font-size: 16px;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--matcha);
}
textarea { resize: vertical; min-height: 74px; }

.checkbox-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; cursor: pointer; }
.checkbox-row input { width: 20px; height: 20px; accent-color: var(--matcha); }

/* Segment-Schalter (Filter Alle/Mr./Mrs., Offen/Erledigt) */
.segment {
  display: flex; background: rgba(184,168,143,.18);
  border-radius: 999px; padding: 4px; gap: 2px; margin-bottom: 16px;
}
.segment button {
  flex: 1; border: 0; background: transparent; color: var(--ink-soft);
  padding: 9px 10px; border-radius: 999px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.segment button.active { background: #fff; color: var(--matcha-dark); box-shadow: var(--card-shadow); }

/* Karten */
.card {
  background: var(--linen); border: 1px solid rgba(184,168,143,.35);
  border-radius: var(--radius); box-shadow: var(--card-shadow);
  padding: 16px; margin-bottom: 12px; position: relative;
}
.card .meta { font-size: 12.5px; color: var(--ink-soft); }

/* Badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.badge.fix       { background: rgba(138,154,91,.16); color: var(--matcha-dark); }
.badge.estimate  { background: rgba(184,168,143,.22); color: #8a7a5e; }
.badge.mr        { background: rgba(138,154,91,.16); color: var(--matcha-dark); }
.badge.mrs       { background: rgba(179,162,114,.2); color: #8f7f52; }
.badge.st-neu          { background: rgba(122,122,102,.14); color: var(--ink-soft); }
.badge.st-angefragt    { background: rgba(179,162,114,.2); color: #8f7f52; }
.badge.st-rueckmeldung { background: rgba(163,177,138,.28); color: var(--matcha-dark); }
.badge.st-zusage       { background: var(--matcha); color: #fff; }
.badge.st-absage       { background: rgba(166,84,63,.15); color: var(--danger); }

/* ---------------- Layout ---------------- */
#app-header {
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
#app-header .title { font-family: var(--serif); font-size: 24px; font-weight: 600; }
#app-header .subtitle { font-family: var(--serif-soft); font-size: 15px; color: var(--ink-soft); font-style: italic; }

main {
  padding: 4px 16px calc(var(--tabbar-h) + 24px);
  max-width: 640px; margin: 0 auto;
}
@media (min-width: 720px) {
  main { max-width: 680px; padding-top: 8px; }
}

.page-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 14px; }
.page-head h2 { font-size: 22px; }
.page-head .count { font-size: 13.5px; color: var(--ink-soft); }

.empty-state {
  text-align: center; color: var(--ink-soft); padding: 44px 20px;
  font-size: 15px;
}
.empty-state svg { opacity: .55; margin-bottom: 10px; }

/* Trennlinie mit Olivenzweig */
.olive-divider {
  display: flex; align-items: center; justify-content: center;
  margin: 18px 0; color: var(--olive-leaf); opacity: .8;
}

/* ---------------- Tab-Bar ---------------- */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: rgba(250,247,240,.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(184,168,143,.4);
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
#tabbar button {
  flex: 1; max-width: 96px; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-soft); font-size: 10.5px; font-weight: 600;
  padding: 4px 0; border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
#tabbar button.active { color: var(--matcha-dark); }
#tabbar button.active .tab-ic { background: rgba(138,154,91,.15); }
#tabbar .tab-ic {
  width: 46px; height: 28px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}

/* ---------------- Login ---------------- */
#view-login {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
}
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card h1 { font-size: 34px; margin: 10px 0 2px; }
.login-card .date { font-family: var(--serif-soft); font-style: italic; color: var(--ink-soft); margin-bottom: 26px; font-size: 17px; }
.login-card form { text-align: left; }
.user-pick { display: flex; gap: 10px; margin-bottom: 16px; }
.user-pick button {
  flex: 1; padding: 14px 8px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--taupe-soft); background: var(--linen);
  font-family: var(--serif); font-size: 18px; color: var(--ink-soft);
}
.user-pick button.active { border-color: var(--matcha); color: var(--matcha-dark); background: rgba(138,154,91,.08); }

/* ---------------- Intro ---------------- */
#intro {
  position: fixed; inset: 0; z-index: 100; background: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity .8s ease;
}
#intro.fade-out { opacity: 0; pointer-events: none; }
#intro .frame {
  position: relative; width: min(78vw, 340px); aspect-ratio: 3/4;
  border-radius: 170px 170px 18px 18px; overflow: hidden;
  border: 3px solid var(--brass); box-shadow: 0 10px 40px rgba(74,74,58,.18);
  background: var(--taupe-soft);
}
#intro .frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s ease;
}
#intro .frame img.show { opacity: 1; }
#intro h1 { font-size: 38px; margin-top: 26px; font-weight: 600; }
#intro .date { font-family: var(--serif-soft); font-style: italic; font-size: 19px; color: var(--ink-soft); margin-top: 2px; }
#intro .skip { margin-top: 30px; font-size: 13px; color: var(--ink-soft); opacity: .8; }
#intro .olive-tl, #intro .olive-br { position: absolute; color: var(--olive-leaf); opacity: .5; }
#intro .olive-tl { top: 18px; left: 10px; }
#intro .olive-br { bottom: 18px; right: 10px; transform: rotate(180deg); }

/* ---------------- Dashboard ---------------- */
.bunting { display: block; margin: -4px auto 4px; color: var(--olive-leaf); width: 100%; max-width: 400px; }
.countdown-card {
  text-align: center; padding: 26px 16px 22px;
  background: var(--linen);
  border: 1px solid rgba(179,162,114,.4);
}
.countdown-card .branch { color: var(--olive-leaf); }
.countdown-card .num {
  font-family: var(--serif); font-size: 58px; font-weight: 700; line-height: 1.05;
  color: var(--matcha-dark);
}
.countdown-card .lbl { font-size: 15px; color: var(--ink-soft); }
.countdown-card .datum { font-family: var(--serif-soft); font-style: italic; font-size: 16px; color: var(--brass); margin-top: 8px; }

.stat-row { display: flex; gap: 12px; }
.stat-card { flex: 1; text-align: center; padding: 18px 10px 14px; }
.stat-card .num { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--ink); }
.stat-card .lbl { font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }
.stat-card .sub { font-size: 11.5px; color: var(--taupe); margin-top: 5px; }

.feed-item {
  display: flex; gap: 12px; padding: 11px 2px; align-items: flex-start;
  border-bottom: 1px solid rgba(184,168,143,.22);
  font-size: 14.5px;
}
.feed-item:last-child { border-bottom: 0; }
.feed-item .dot {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 13px;
  background: rgba(138,154,91,.14); color: var(--matcha-dark);
}
.feed-item .dot.mrs { background: rgba(179,162,114,.2); color: #8f7f52; }
.feed-item time { display: block; font-size: 12px; color: var(--taupe); margin-top: 1px; }

/* ---------------- Listen ---------------- */
.list-item-title { font-weight: 600; font-size: 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.money { font-family: var(--serif); font-weight: 700; font-size: 18px; white-space: nowrap; }

.group-card .members { margin-top: 8px; padding-left: 2px; }
.group-card .member {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0 7px 12px; border-left: 2px solid var(--sage-soft);
  margin-left: 6px; font-size: 15px;
}

.cat-row { cursor: pointer; }
.cat-row .chev { color: var(--taupe); }

/* Fotos */
.photo-strip { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.photo-strip img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--taupe-soft); cursor: pointer;
}
.photo-strip .add-photo {
  width: 64px; height: 64px; border-radius: 10px; border: 1.5px dashed var(--taupe);
  background: none; color: var(--taupe); font-size: 24px; cursor: pointer;
}

#lightbox {
  position: fixed; inset: 0; z-index: 90; background: rgba(42,42,32,.93);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
}
#lightbox img { max-width: 96vw; max-height: 82vh; border-radius: 8px; }

/* Links */
.link-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.link-chips a {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(138,154,91,.1); color: var(--matcha-dark);
  padding: 5px 12px; border-radius: 999px; font-size: 13px; text-decoration: none;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Angebots-Stepper */
.stepper { display: flex; align-items: center; margin: 12px 0 4px; }
.stepper .step { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; width: 76px; }
.stepper .bullet {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--taupe-soft); background: var(--linen); color: var(--taupe);
  font-size: 13px; font-weight: 700;
}
.stepper .step.on .bullet { border-color: var(--matcha); background: var(--matcha); color: #fff; }
.stepper .step.no .bullet { border-color: var(--danger); background: var(--danger); color: #fff; }
.stepper .step span { font-size: 10.5px; color: var(--ink-soft); margin-top: 4px; text-align: center; }
.stepper .bar { flex: 1; height: 2px; background: var(--taupe-soft); margin: 0 -14px; margin-bottom: 16px; min-width: 8px; }
.stepper .bar.on { background: var(--matcha); }

/* To-dos */
.todo-card.done .list-item-title { text-decoration: line-through; color: var(--ink-soft); }
.todo-card.done { opacity: .72; }
.todo-check {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  border: 2px solid var(--taupe); background: none; cursor: pointer; color: transparent;
  display: flex; align-items: center; justify-content: center;
}
.todo-card.done .todo-check { background: var(--matcha); border-color: var(--matcha); color: #fff; }

.comment { display: flex; gap: 10px; margin-top: 12px; }
.comment .dot {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 12px;
  background: rgba(138,154,91,.14); color: var(--matcha-dark);
}
.comment .dot.mrs { background: rgba(179,162,114,.2); color: #8f7f52; }
.comment .bubble {
  background: rgba(184,168,143,.14); border-radius: 4px 14px 14px 14px;
  padding: 9px 13px; font-size: 14.5px; flex: 1;
}
.comment .bubble .who { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 2px; }
.comment .bubble time { font-size: 11px; color: var(--taupe); display: block; margin-top: 3px; }

/* ---------------- Modal / Bottom-Sheet ---------------- */
#modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(74,74,58,.4);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  background: var(--cream); width: 100%; max-width: 560px;
  border-radius: 22px 22px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  max-height: 88vh; overflow-y: auto;
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } }
@media (min-width: 720px) {
  #modal-backdrop { align-items: center; }
  .sheet { border-radius: 22px; padding-bottom: 24px; }
}
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--taupe-soft); margin: 4px auto 12px; }
.sheet h3 { font-size: 20px; margin-bottom: 16px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet .actions .btn { flex: 1; }

/* Toast */
#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 14px); z-index: 80;
  background: var(--ink); color: var(--cream);
  padding: 11px 20px; border-radius: 999px; font-size: 14.5px;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .25s;
  max-width: 88vw; text-align: center;
}
#toast.show { opacity: 1; }

/* Onboarding-Banner */
.notify-banner {
  display: flex; gap: 12px; align-items: center;
  background: rgba(138,154,91,.1); border: 1px solid rgba(138,154,91,.35);
  border-radius: var(--radius); padding: 13px 15px; margin-bottom: 14px;
  font-size: 14px; cursor: pointer;
}
.notify-banner svg { flex: 0 0 auto; color: var(--matcha-dark); }
.notify-banner .close { margin-left: auto; }

.step-list { margin: 10px 0 0 2px; padding-left: 18px; font-size: 14.5px; }
.step-list li { margin-bottom: 8px; }

/* FAB für "Hinzufügen" innerhalb der Seiten */
.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + 16px); z-index: 30;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--matcha); color: #fff; border: 0; cursor: pointer;
  box-shadow: 0 6px 18px rgba(113,128,74,.4);
  font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s, background .15s;
}
.fab:active { transform: scale(.94); }
.fab:hover { background: var(--matcha-dark); }
@media (min-width: 720px) { .fab { right: calc(50% - 340px + 18px); } }
