/* Mädelsabend – mobiles Layout. Große Schrift, große Tippflächen. */

:root {
  --bg: #FAF7F5;
  --surface: #FFFFFF;
  --ink: #231B1F;
  --ink-2: #4A3F44;
  --muted: #6B5E64;
  --line: #EDE5E8;
  --field: #D9CFD3;
  --accent: #A8435C;
  --accent-ink: #FFFFFF;
  --accent-soft: #F8E8ED;
  --warn-bg: #FFF4E3;
  --warn-line: #F0D3A6;
  --warn-ink: #5E3800;
  --neutral-bg: #EFE9EC;
  --ok-bg: #E8F3EC;
  --ok-ink: #1D5233;
  --error-bg: #FBE9E9;
  --error-ink: #8A1F1F;
  --radius: 18px;
  --tap: 56px;
  font-size: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

a { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; }
p { margin: 0 0 0.75rem; }

.icon { flex: none; }

/* ---------- Grundgerüst ---------- */

.app {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.topbar h1 { margin: 0; font-size: 1.75rem; font-weight: 800; }
.subtitle { margin: 0 0 2px; color: var(--muted); font-size: 0.9rem; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -6px 0 4px -6px;
  padding: 0 6px;
  font-weight: 600;
  text-decoration: none;
}

.content {
  flex: 1;
  padding: 20px 20px calc(110px + env(safe-area-inset-bottom));
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 720px;
  margin: 0 auto;
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 60px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
}

.tabbar a.active { color: var(--accent); font-weight: 700; }

/* Seiten ohne Navigation (Login usw.): Hintergrundbild, Logo, weiße Karte */
.plain-body { background: #1E5468; }
.plain-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #1E5468 url("brand/hintergrund.jpg") center / cover no-repeat;
}
.plain {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(32px + env(safe-area-inset-top)) 16px 40px;
}
.plain-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 12px 40px rgba(20, 40, 50, 0.25);
}

.brand { text-align: center; margin-bottom: 24px; }
.brand-logo {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0 auto;
  border-radius: 32px;
  box-shadow: 0 10px 30px rgba(20, 40, 50, 0.3);
}

/* ---------- Bausteine ---------- */

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.row { display: flex; align-items: center; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.ink-2 { color: var(--ink-2); }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 0 0 12px; font-size: 1.25rem; font-weight: 700;
}
.section-title a { font-size: 1rem; font-weight: 600; text-decoration: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 16px; }
.list-item {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 10px 0;
  color: inherit; text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }
.list-item .chev { color: var(--muted); }
.list-item strong { display: block; }

.tile-link {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; color: inherit; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}

.avatar {
  flex: none; border-radius: 50%; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #3A2E33; background: var(--neutral-bg);
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; white-space: nowrap;
}
.chip-yes { background: var(--accent-soft); color: var(--accent); }
.chip-no { background: var(--neutral-bg); color: #4F464A; }
.chip-open { background: #FFF0D9; color: #6E4100; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 18px; border-radius: 14px;
}
.notice-success { background: var(--ok-bg); color: var(--ok-ink); }
.notice-error { background: var(--error-bg); color: var(--error-ink); }
.notice-info { background: var(--accent-soft); color: var(--ink); }

.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: 16px;
  background: var(--warn-bg); border: 1.5px solid var(--warn-line); color: var(--warn-ink);
  text-decoration: none;
}
.banner strong { display: block; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px;
  border: 2px solid transparent; border-radius: 14px;
  font: inherit; font-weight: 700; text-decoration: none; text-align: center;
  cursor: pointer;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-outline { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-soft { background: var(--neutral-bg); color: var(--ink); }
.btn-dashed { background: var(--accent-soft); color: var(--accent); border: 2px dashed var(--accent); }
.btn-danger { background: var(--surface); color: var(--error-ink); border-color: #E2B4B4; }
.btn:disabled { opacity: 0.6; cursor: default; }
.link-btn { background: none; border: none; padding: 0; min-height: 44px; font: inherit; color: var(--accent); font-weight: 600; cursor: pointer; }

.btn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.choice {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 60px; border: 2px solid var(--field); border-radius: 14px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; cursor: pointer;
}
.choice.is-yes { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice.is-no { background: #3B3236; border-color: #3B3236; color: #fff; }

/* ---------- Formulare ---------- */

.field { display: block; }
.field > span { display: block; margin-bottom: 6px; font-size: 0.95rem; font-weight: 600; }
.field .hint { display: block; margin-top: 4px; font-size: 0.85rem; font-weight: 400; color: var(--muted); }

.input, select.input, textarea.input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1.5px solid var(--field);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea.input { min-height: 120px; resize: vertical; }
.input:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }

fieldset.card { margin: 0; display: flex; flex-direction: column; gap: 16px; }
fieldset.card legend { padding: 0 6px; font-size: 1.1rem; font-weight: 700; }

.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.check input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--accent); flex: none; }

.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 16px; color: var(--muted); }
.search .input { padding-left: 46px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Events ---------- */

.event-card {
  display: flex; gap: 14px; align-items: stretch;
  padding: 14px; color: inherit; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.datebox {
  flex: none; width: 64px; padding: 8px 0; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); line-height: 1.1;
}
.datebox .wd, .datebox .mon { font-size: 0.8rem; font-weight: 700; }
.datebox .day { font-size: 1.7rem; font-weight: 800; }
.datebox.past { background: var(--neutral-bg); color: var(--ink-2); }
.event-card .name { font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.event-card .meta { font-size: 0.95rem; color: var(--ink-2); }

.hero {
  display: block; overflow: hidden; color: inherit; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
}
.hero-top { display: flex; gap: 16px; align-items: center; padding: 18px; background: var(--accent); color: var(--accent-ink); }
.hero-date { flex: none; width: 64px; text-align: center; line-height: 1.1; }
.hero-date .day { display: block; font-size: 2.1rem; font-weight: 800; }
.hero-date .wd, .hero-date .mon { display: block; font-size: 0.9rem; font-weight: 600; }
.hero-name { font-size: 1.3rem; font-weight: 800; line-height: 1.25; }
.hero-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; color: var(--ink-2); }

.facts { display: flex; flex-direction: column; gap: 10px; }
.fact { display: flex; gap: 12px; align-items: flex-start; }
.fact .icon { color: var(--accent); margin-top: 2px; }

.avatars { display: flex; flex-wrap: wrap; gap: 14px; }
.person { width: 72px; text-align: center; font-size: 0.8rem; line-height: 1.25; color: var(--ink-2); text-decoration: none; }
.person .avatar { margin: 0 auto 4px; }

details.more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--accent); }

.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--neutral-bg); border-radius: 14px; }
.tabs a {
  display: flex; align-items: center; justify-content: center; min-height: 48px;
  border-radius: 11px; color: var(--ink-2); font-weight: 700; text-decoration: none;
}
.tabs a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(35, 27, 31, 0.12); }

.years { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.years a {
  flex: none; display: flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1.5px solid var(--field); color: var(--ink-2);
  font-weight: 600; text-decoration: none;
}
.years a.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Profil ---------- */

.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.profile-head h2 { margin: 6px 0 0; font-size: 1.6rem; }

dl.details { margin: 0; }
dl.details > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
dl.details > div:last-child { border-bottom: none; }
dl.details dt { font-size: 0.85rem; color: var(--muted); }
dl.details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.photo-edit { display: flex; align-items: center; gap: 16px; }
.photo-edit input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-edit .btn { white-space: nowrap; padding: 0 16px; }
/* ---------- Dialog & Toast ---------- */

dialog {
  width: min(92vw, 460px);
  border: none; border-radius: 22px; padding: 24px;
  color: var(--ink); background: var(--surface);
}
dialog::backdrop { background: rgba(35, 27, 31, 0.5); }
dialog h2 { margin: 0 0 12px; font-size: 1.3rem; }
dialog .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

.toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); z-index: 50;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 14px 20px; border-radius: 14px;
  background: var(--ink); color: #fff; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

@media (min-width: 720px) {
  .content { padding-left: 28px; padding-right: 28px; }
}
