:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --fg: #e7e9ee;
  --muted: #8a90a0;
  --accent: #4f8cff;
  --danger: #ff5c5c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.error { color: var(--danger); }

/* Layout */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.wrap { max-width: 900px; margin: 0 auto; padding: 1rem; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; background: var(--card); border-bottom: 1px solid #262a33;
}
.topbar h1 { font-size: 1.2rem; margin: 0; }
.topbar a { margin-left: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; }
.brand .logo { height: 32px; width: auto; }

/* Logo allgemein (login-card) */
.logo { max-width: 200px; height: auto; display: block; margin: 0 auto .5rem; }

/* Logo-overlay auf Diashow */
.logo-overlay {
  position: fixed; bottom: 18px; right: 18px;
  max-width: 160px; height: auto; opacity: .85;
  pointer-events: none; z-index: 10;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
}

.card {
  background: var(--card);
  border: 1px solid #262a33;
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1rem 0;
}
.card h1, .card h2 { margin-top: 0; }

.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.flash {
  background: #1e3a2a; border: 1px solid #2e6b45;
  padding: .6rem 1rem; border-radius: 8px;
}

/* Form */
input[type=text], input[type=password], input[type=file], select {
  background: #11141a; border: 1px solid #2a2f3a; color: var(--fg);
  padding: .55rem .7rem; border-radius: 8px; font-size: 1rem;
}
input[type=text], input[type=password] { flex: 1; min-width: 180px; }
button {
  background: var(--accent); color: #fff; border: 0;
  padding: .55rem 1rem; border-radius: 8px; font-size: 1rem; cursor: pointer;
}
button:disabled { opacity: .5; cursor: default; }
button:hover:not(:disabled) { filter: brightness(1.1); }
.btn-danger { background: var(--danger); }

/* Upload-Fortschritt */
.up-progress { margin-top: .75rem; width: 100%; }
.up-bar {
  height: 10px; background: #11141a; border: 1px solid #2a2f3a;
  border-radius: 6px; overflow: hidden;
}
.up-bar span {
  display: block; height: 100%; width: 0;
  background: var(--accent); transition: width .2s ease;
}
#upstatus { margin: .5rem 0 0; word-break: break-word; }

/* Login card */
body.center .card { width: 320px; text-align: center; }
body.center .card input { width: 100%; margin: .5rem 0; }
body.center .card button { width: 100%; }

/* Image grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
}
.grid figure {
  margin: 0; position: relative; border-radius: 8px; overflow: hidden;
  aspect-ratio: 1; background: #11141a;
}
.grid figure img { width: 100%; height: 100%; object-fit: contain; display: block; }
.grid .del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.6); padding: .2rem .5rem; border-radius: 6px;
  line-height: 1;
}
.grid .del:hover { background: var(--danger); }

/* Slideshow (public) */
body.show { background: #000; height: 100vh; overflow: hidden; }
/* schwarzer Hintergrund deckt im Fade-Moment alles ab (nichts scheint durch) */
#slideshow { position: fixed; inset: 0; background: #000; }
.layer {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity .8s ease;
}
.layer.show { opacity: 1; }
/* "Keine Diashow" nur sichtbar wenn wirklich kein Album – liegt über allem, solide schwarz */
#empty {
  position: fixed; inset: 0; z-index: 5; background: #000; margin: 0;
  display: flex; align-items: center; justify-content: center;
}
/* erzwingt, dass hidden greift (schlägt .center display:flex) */
#empty[hidden] { display: none; }
