:root {
  --color-bg: #faf6f1;
  --color-surface: #ffffff;
  --color-primary: #b8895f;
  --color-primary-dark: #96683f;
  --color-accent: #e8b4a0;
  --color-text: #3a322c;
  --color-muted: #8a7d70;
  --color-border: #ecdfd3;
  --color-danger: #c9564a;
  --color-danger-dark: #a8453a;
  --color-success-bg: #eaf5ea;
  --color-success-text: #2f6b2f;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(60, 40, 20, 0.08);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

a {
  color: var(--color-primary-dark);
}

.page {
  min-height: 100dvh;
  padding: 24px 16px 60px;
}

.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  margin-bottom: 28px;
}

.card-hero {
  max-width: 460px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.brand-icon {
  font-size: 2rem;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 6px;
  color: var(--color-primary-dark);
}

.lead {
  color: var(--color-muted);
  margin: 0 0 24px;
}

.muted {
  color: var(--color-muted);
}

.small {
  font-size: 0.85rem;
}

.footnote {
  margin-top: 18px;
  margin-bottom: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font-size: 0.9rem;
  color: var(--color-text);
}

input[type='text'],
input[type='password'],
select {
  font: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
}

input[type='text']:focus,
input[type='password']:focus,
select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: #f1e6da;
  color: var(--color-primary-dark);
}

.btn-danger {
  background: #fbeae8;
  color: var(--color-danger);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: #fff;
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error {
  color: var(--color-danger);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.banner {
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}

.banner-success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

code {
  background: #f1e6da;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

.link-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 18px 0;
}

.link-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.link-label {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: 600;
}

.copy-row {
  display: flex;
  gap: 8px;
}

.copy-row input {
  flex: 1;
  min-width: 0;
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 16px 0 8px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: 18px 0;
}

.qr-box img {
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 8px;
}

.qr-downloads {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.section-title {
  font-size: 1.05rem;
  color: var(--color-primary-dark);
  margin: 0 0 14px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  border: 2px dashed var(--color-accent);
  border-radius: var(--radius);
  padding: 32px 16px;
  cursor: pointer;
  background: #fff8f4;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  background: #fdeee5;
  border-color: var(--color-primary);
}

.dropzone-icon {
  font-size: 2rem;
}

.dropzone-text {
  font-weight: 600;
  color: var(--color-primary-dark);
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  transition: width 0.15s ease;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #eee;
  box-shadow: var(--shadow);
}

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

.uploader-tag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
}

.delete-photo {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-photo:hover {
  background: var(--color-danger);
}

.gallery-item {
  cursor: pointer;
}

.gallery-item form {
  margin: 0;
}

/* --- Besuchshinweis (Kamera/Galerie) -------------------------------------- */

.visit-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff8f4;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  color: var(--color-text);
}

.visit-hint span {
  flex: 1;
}

.visit-hint button {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}

.visit-hint button:hover {
  background: var(--color-accent);
}

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  text-align: center;
  padding: 24px 16px 36px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.footer-nav a {
  color: var(--color-muted);
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

/* --- Lightbox -------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px;
  z-index: 1000;
}

.lightbox-content {
  max-width: 100%;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.lightbox-actions {
  display: flex;
  gap: 10px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* --- Developer-Backend ----------------------------------------------------- */

.dev-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.dev-topbar h1 {
  margin: 0;
}

.dev-topbar form {
  margin: 0;
}

.dev-card {
  margin-bottom: 16px;
}

.dev-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.dev-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--color-primary-dark);
}

.admin-actions form {
  margin: 0;
}

@media (min-width: 560px) {
  .link-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #211c18;
    --color-surface: #2b241f;
    --color-text: #f1e9df;
    --color-muted: #b5a595;
    --color-border: #40352c;
  }

  input[type='text'],
  input[type='password'],
  select {
    background: #211c18;
    color: var(--color-text);
    border-color: var(--color-border);
  }

  .dropzone {
    background: #2b2119;
  }

  code {
    background: #40352c;
  }

  .visit-hint {
    background: #2b2119;
  }

  .visit-hint button {
    background: #40352c;
    color: var(--color-text);
  }
}
