/* =========================================================
   Hochzeitsfotos – romantisch, Foto-Hintergrund
   Palette: Hortensienblau · Gold · Elfenbein
   ========================================================= */

:root {
  --bg: #f4f1ea;          /* warmes Elfenbein (Kleid) */
  --bg-soft: #ece7db;
  --card: #ffffff;
  --ink: #2b2f4a;         /* tiefes Marineblau (Anzug) */
  --muted: #7c7f96;
  --line: #e4dfd2;
  --field: #f3f0e8;

  --accent: #3f49b8;      /* Hortensienblau – Buttons */
  --accent-deep: #2c3178; /* Marineblau – Überschriften */
  --accent-tint: #e6e7f7; /* Chip-Hintergrund */

  --gold: #c9a24e;
  --gold-deep: #9c7a30;

  --delete: #c05c7e;      /* Entfernen-Aktionen */
  --danger: #b23b2e;      /* Fehlermeldungen */

  --radius-card: 26px;
  --shadow-card: 0 16px 38px rgba(20, 22, 44, 0.12);
  --shadow-pop: 0 22px 55px rgba(20, 22, 44, 0.22);

  --font-script: 'Parisienne', 'Segoe Script', 'Brush Script MT', cursive;
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: hidden; background: var(--bg); }

body {
  margin: 0;
  font-family: var(--font-body);
  background: transparent;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Foto-Hintergrund ---------- */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('../img/hero.jpg');
  background-size: cover;
  background-position: 50% 38%;
  background-repeat: no-repeat;
}
.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
}
/* Schleier über dem Foto. Die letzte Zahl (0 bis 1) = Deckkraft:
   kleiner = Foto scheint stärker durch, größer = Foto verblasst. */
.login-page .site-bg::after {
  background: rgba(20, 23, 44, 0.42);   /* Login: dunkelblauer Schleier */
}
.app-page .site-bg::after {
  background: rgba(244, 241, 234, 0.2); /* Hauptseite: heller Schleier */
}

.app-page { position: relative; overflow-x: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(63, 73, 184, 0.35);
}
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: var(--card);
  color: var(--gold-deep);
  border: 1.5px solid var(--gold);
}
.btn-secondary:active { background: var(--bg-soft); }

.btn-ghost {
  background: var(--card);
  color: var(--accent-deep);
  border: 1.5px solid #d6d8ef;
}
.btn-ghost:active { background: var(--accent-tint); }

.btn-danger {
  background: var(--delete);
  color: #fff;
  box-shadow: 0 12px 24px rgba(192, 92, 126, 0.4);
}

.link-muted { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.link-muted:hover { color: var(--accent-deep); }

/* =========================================================
   Login
   ========================================================= */
.login-page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 24px;
  overflow: hidden;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  background: rgba(255, 255, 255, 0.93);
  -webkit-backdrop-filter: blur(9px) saturate(1.08);
  backdrop-filter: blur(9px) saturate(1.08);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 28px;
  padding: 36px 26px 30px;
  text-align: center;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.login-rings { display: block; }

.login-card h1 {
  margin: 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.1;
  color: var(--accent-deep);
}

.login-couple {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.login-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted);
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: 0;
}

.login-card input {
  width: 100%;
  padding: 15px 16px;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.32em;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 16px;
}
.login-card input::placeholder { letter-spacing: 0.32em; color: #b9b6c4; }
.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.login-card button {
  width: 100%;
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(63, 73, 184, 0.35);
}
.login-card button:active { transform: translateY(1px); }

.login-foot {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.login-foot svg { width: 13px; height: 13px; }

.error {
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 700;
}

/* =========================================================
   App-Shell
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  background: rgba(244, 241, 234, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(43, 47, 74, 0.06);
}

.topbar h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--accent-deep);
}

.topbar-actions { display: flex; align-items: center; gap: 14px; }

.admin-badge {
  font-family: var(--font-body);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent-deep);
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
}

.admin-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px 0;
  margin: 0 auto 4px;
  max-width: 720px;
  font-size: 0.78rem;
  color: var(--muted);
}
.admin-hint svg { width: 13px; height: 13px; }

main {
  position: relative;
  z-index: 1;
  padding: 12px 20px 36px;
  max-width: 720px;
  margin: 0 auto;
}

/* ---------- Upload-Panel ---------- */
.upload-panel {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 22px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.upload-panel h2 {
  margin: 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.25;
  color: var(--accent-deep);
}

.upload-sub {
  margin: 3px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.upload-panel form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 0;
}

.upload-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-fields input {
  width: 100%;
  padding: 13px 15px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 14px;
}
.upload-fields input:focus { outline: none; border-color: var(--accent); background: #fff; }

.file-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  padding: 24px 16px;
  border: 2px dashed var(--gold);
  border-radius: 18px;
  background: #f7f3e9;
  cursor: pointer;
}
.file-picker svg { width: 32px; height: 32px; }
.file-picker .fp-title { font-size: 0.9rem; font-weight: 800; color: var(--ink); }
.file-picker .fp-hint { font-size: 0.72rem; color: var(--muted); }
.file-picker input { display: none; }

.upload-progress {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.upload-status {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: pre-line;
  text-align: center;
}

.download-all {
  width: 100%;
  margin-bottom: 26px;
}

/* ---------- Galerie ---------- */
.gallery-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.gallery-head h2 {
  margin: 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 1.7rem;
  color: var(--accent-deep);
}
.count-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-tint);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-deep);
}
.count-chip:empty { display: none; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 6px 16px rgba(20, 22, 44, 0.08);
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: block;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-delete {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 0;
  border: none;
  background: var(--delete);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}
.gallery-delete svg { width: 12px; height: 12px; }
.gallery-delete:hover { filter: brightness(0.93); }

.gallery-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
}

#load-more { margin: 16px auto 0; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 64px 16px;
  background: rgba(18, 20, 40, 0.94);
}

.lightbox img {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-nav {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  font-size: 1.7rem;
}
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-caption {
  width: 100%;
  max-width: 340px;
  background: #fdfbf6;
  color: var(--ink);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}
.lb-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-deep);
}
.lb-name:empty { display: none; }
.lb-msg {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #5b5d73;
  font-style: italic;
}
.lb-msg:empty { display: none; }
.lb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 3px;
}
.lb-actions .btn { padding: 12px 20px; }

/* ---------- Bestätigungs-Sheet (Admin: löschen) ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(18, 20, 40, 0.5);
}
.sheet {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 26px 26px 0 0;
  padding: 20px 22px 26px;
  box-shadow: 0 -16px 44px rgba(20, 22, 44, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}
.sheet h2 {
  margin: 6px 0 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--accent-deep);
}
.sheet p {
  margin: 0;
  max-width: 280px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
}
.sheet-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}
.sheet-actions .btn { flex: 1; padding: 14px 0; }

/* ---------- größere Bildschirme ---------- */
@media (min-width: 640px) {
  .upload-fields { flex-direction: row; }
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  main { padding-left: 24px; padding-right: 24px; }
}

@media (min-width: 960px) {
  .gallery { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .topbar { padding: 14px 16px 10px; }
  .topbar h1 { font-size: 1.55rem; }
  main { padding-left: 16px; padding-right: 16px; }
  .admin-hint { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
