:root {
  --bg: #f7f4f1;
  --card: rgba(255, 255, 255, 0.94);
  --text: #24211f;
  --muted: #746d68;
  --accent: #9a6d58;
  --accent-dark: #78503f;
  --ok: #2d7a55;
  --danger: #a63d40;
  --border: #e8dfda;
  --shadow: 0 18px 50px rgba(64, 45, 36, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #f2e3dc 0, transparent 35%),
    radial-gradient(circle at bottom right, #e4edf0 0, transparent 34%),
    var(--bg);
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }

.shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 70px; }
.hero { text-align: center; padding: 36px 12px 30px; }
.hero h1 { font-size: clamp(2.35rem, 7vw, 5rem); margin: 0 0 14px; letter-spacing: -0.06em; line-height: .98; }
.hero p { margin: 0 auto; max-width: 720px; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.admin-hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; letter-spacing: .02em; margin-bottom: 22px; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--text); color: white; }
.light-brand { color: white; }
.light-brand .brand-mark { background: rgba(255,255,255,.17); backdrop-filter: blur(12px); }

.card { background: var(--card); border: 1px solid rgba(255,255,255,.9); border-radius: 24px; box-shadow: var(--shadow); padding: 24px; backdrop-filter: blur(12px); }
.auth-card { max-width: 540px; margin: 0 auto; }
.auth-card h2 { margin-top: 0; }
.hidden { display: none !important; }
.top-gap { margin-top: 14px; }
.status-icon { font-size: 3rem; margin-bottom: 8px; }
.small { font-size: .9rem; color: var(--muted); line-height: 1.45; }
.eyebrow { display: block; font-size: .76rem; font-weight: 900; letter-spacing: .14em; color: var(--accent-dark); margin-bottom: 7px; }

.btn { border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 780; cursor: pointer; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 8px; transition: transform .16s ease, opacity .16s ease, background .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--text); color: white; }
.btn-primary:hover { background: #000; }
.btn-soft { background: #efe8e4; color: var(--text); }
.btn-danger { background: #f7dddd; color: var(--danger); }
.btn-ok { background: #daf0e4; color: var(--ok); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.centered-actions { justify-content: center; margin-top: 16px; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 7px; font-weight: 720; }
.input { width: 100%; border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; background: white; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(154,109,88,.12); }
textarea.input { resize: vertical; }
.notice { border-radius: 14px; padding: 13px 15px; background: #eee9e6; color: var(--muted); line-height: 1.5; }
.notice.ok { background: #dbf1e5; color: var(--ok); }
.notice.error { background: #f7dddd; color: var(--danger); }

.account-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 26px; padding: 16px 20px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; margin: 20px 4px 18px; }
.dashboard-heading h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.045em; margin: 0 0 5px; }
.dashboard-heading p { margin: 0; color: var(--muted); }

.event-owner-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.owner-event-card { overflow: hidden; border-radius: 26px; background: white; border: 1px solid var(--border); box-shadow: var(--shadow); }
.owner-event-cover { position: relative; height: 250px; background: linear-gradient(135deg, #d9c3b8, #93a5ad); overflow: hidden; }
.owner-event-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.owner-event-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.36), transparent 48%); pointer-events: none; }
.cover-placeholder { display: grid; place-items: center; }
.cover-placeholder > span { font-size: 5rem; filter: drop-shadow(0 10px 20px rgba(0,0,0,.14)); }
.event-type-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 11px; background: rgba(255,255,255,.9); color: var(--text); font-size: .82rem; font-weight: 850; }
.owner-event-cover .event-type-pill { position: absolute; left: 16px; bottom: 16px; z-index: 2; }
.owner-event-body { padding: 20px; }
.owner-event-body h3 { margin: 0 0 7px; font-size: 1.65rem; letter-spacing: -.03em; }
.owner-event-body p { margin: 0; color: var(--muted); line-height: 1.55; min-height: 48px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 9px; margin: 17px 0; }
.mini-stats span { padding: 7px 10px; border-radius: 999px; background: #f3efec; font-size: .85rem; color: var(--muted); }
.mini-stats strong { color: var(--text); }
.event-actions { align-items: stretch; }
.event-actions .btn { flex-grow: 1; }
.event-photo-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 48px 24px; }
.empty-state h2 { margin: 8px 0; font-size: 2rem; }
.empty-state p { max-width: 590px; margin: 0 auto 20px; color: var(--muted); line-height: 1.6; }
.empty-icon { font-size: 4rem; }

.editor-card { margin-top: 24px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.section-head h2, .section-head h3 { margin: 0; }
.two-column-form { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.wide-field { grid-column: 1 / -1; }
.checkbox-row { display: flex !important; flex-direction: row; align-items: flex-start; gap: 11px !important; border: 1px solid var(--border); padding: 14px; border-radius: 16px; background: white; }
.checkbox-row input { margin-top: 4px; }
.checkbox-row span { display: grid; gap: 2px; }
.cover-preview { max-width: 520px; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); }
.cover-preview img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.form-actions { justify-content: flex-start; }

.event-shell { width: min(780px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 70px; }
.guest-event-hero { position: relative; min-height: 430px; border-radius: 28px; overflow: hidden; background: linear-gradient(135deg, #9b735f, #465a63); background-size: cover; background-position: center; box-shadow: var(--shadow); display: flex; align-items: end; }
.guest-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.76), rgba(0,0,0,.12) 68%); }
.guest-hero-content { position: relative; z-index: 1; color: white; padding: 30px; width: 100%; }
.guest-hero-content h1 { margin: 6px 0 8px; font-size: clamp(2.4rem, 9vw, 4.6rem); letter-spacing: -.055em; line-height: 1; }
.guest-hero-content p { margin: 0; color: rgba(255,255,255,.84); line-height: 1.55; }
.guest-category { font-size: .78rem; font-weight: 900; letter-spacing: .14em; color: rgba(255,255,255,.78); }
.guest-card { margin-top: 18px; }
.guest-card h2 { margin-top: 0; }
.upload-drop { border: 2px dashed #cdbdb4; border-radius: 20px; padding: 30px; text-align: center; background: rgba(255,255,255,.6); }
.upload-drop input { max-width: 100%; }



.admin-layout { display: grid; grid-template-columns: 330px 1fr; gap: 18px; align-items: start; }
.stack { display: grid; gap: 12px; }
.stat { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 10px 0; }
.guest-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: white; }
.event-admin-card { border: 1px solid var(--border); border-radius: 18px; padding: 16px; background: white; }
.event-admin-card h3 { margin: 0 0 6px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
.photo-card { border-radius: 16px; overflow: hidden; background: white; border: 1px solid var(--border); }
.photo-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-meta { padding: 10px; }
.photo-actions { margin-top: 8px; }
.photo-actions .btn { padding: 9px 11px; font-size: .86rem; }

@media (max-width: 900px) {
  .event-owner-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
  .shell { width: min(100% - 20px, 1160px); padding-top: 18px; }
  .hero { padding-top: 26px; }
  .account-bar { align-items: stretch; flex-direction: column; }
  .account-bar .actions .btn { flex: 1; }
  .two-column-form { grid-template-columns: 1fr; }
  .wide-field { grid-column: auto; }
  .owner-event-cover { height: 215px; }
  .guest-event-hero { min-height: 390px; border-radius: 22px; }
  .guest-hero-content { padding: 22px; }
  .section-head { align-items: stretch; flex-direction: column; }
  .event-actions .btn { width: 100%; }
}


/* EventPix Logo */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 auto 26px;
}

.brand-logo {
  width: 92px;
  height: 92px;
  display: block;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 14px 35px rgba(72, 40, 190, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.brand-text strong {
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand-text span {
  margin-top: 7px;
  font-size: 0.95rem;
  opacity: 0.7;
}

@media (max-width: 520px) {
  .brand {
    flex-direction: column;
    gap: 10px;
  }

  .brand-logo {
    width: 105px;
    height: 105px;
  }

  .brand-text {
    text-align: center;
  }
}


/* EventPix Logo v2 */
.hero .eventpix-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0 auto 30px;
}

.hero .eventpix-brand .brand-logo {
  display: block;
  width: min(175px, 42vw);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hero .eventpix-brand .brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero .eventpix-brand .brand-text strong {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.hero .eventpix-brand .brand-text span {
  margin-top: 7px;
  font-size: 1rem;
  color: var(--muted);
}

@media (max-width: 520px) {
  .hero .eventpix-brand {
    margin-bottom: 24px;
  }

  .hero .eventpix-brand .brand-logo {
    width: 145px;
  }
}


/* Niknil Upload-Fortschritt */
.upload-progress {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 17px;
  border: 1px solid rgba(238, 128, 139, .22);
  border-radius: 20px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 82, 145, .08),
      rgba(255, 166, 84, .11)
    );
  box-shadow: 0 10px 30px rgba(70, 36, 42, .06);
}

.upload-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}

.upload-progress-head span {
  min-width: 0;
  font-weight: 750;
  line-height: 1.35;
}

.upload-progress-head strong {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  font-size: .9rem;
  white-space: nowrap;
}

.upload-progress-track {
  width: 100%;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(215, 201, 194, .55);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
}

.upload-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      #f64f91 0%,
      #ff7476 48%,
      #ff9d4d 100%
    );
  transition: width .28s ease;
  box-shadow: 0 2px 8px rgba(246, 79, 145, .25);
}

.upload-progress-sub {
  margin-top: 9px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .upload-progress {
    padding: 14px;
    border-radius: 17px;
  }

  .upload-progress-head {
    gap: 10px;
  }

  .upload-progress-head span {
    font-size: .92rem;
  }

  .upload-progress-track {
    height: 14px;
  }

  .upload-progress-sub {
    font-size: .82rem;
  }
}

/* Niknil – Mobile Upload Fix */
.guest-card,
.guest-card *,
.upload-drop,
.upload-drop *,
#uploadForm,
#uploadForm .btn {
  box-sizing: border-box;
}

.guest-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

#uploadForm {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.upload-drop {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.upload-drop strong,
.upload-drop span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.upload-drop input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 14px;
  font-size: 16px;
  overflow: hidden;
}

#uploadForm > .btn {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 600px) {
  .guest-card {
    padding-left: 22px;
    padding-right: 22px;
  }

  .upload-drop {
    padding: 25px 16px;
  }

  .upload-drop input[type="file"] {
    font-size: 14px;
  }
}


/* Niknil Gast Zurück */
.guest-back-button {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 1000;

  display: inline-flex;
  align-items: center;
  gap: 7px;

  min-height: 44px;
  padding: 10px 16px;

  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;

  background: rgba(20, 15, 20, .58);
  color: white;

  font: inherit;
  font-weight: 750;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow: 0 8px 24px rgba(0,0,0,.18);

  cursor: pointer;
}

.guest-back-button:active {
  transform: scale(.96);
}

@media (max-width: 520px) {
  .guest-back-button {
    min-height: 42px;
    padding: 9px 14px;
    font-size: .9rem;
  }
}


/* Niknil – öffentliche Fotogalerie */
.share-shell {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.share-hero {
  text-align: center;
  padding: 28px 18px 20px;
}

.share-logo {
  width: 105px;
  max-width: 32vw;
  height: auto;
  margin: 0 auto 12px;
  display: block;
}

.share-hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 7vw, 3.8rem);
  letter-spacing: -.05em;
}

.share-hero p {
  max-width: 650px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.55;
}

.share-info {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.share-pill {
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: .9rem;
}

.share-photo-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.share-photo {
  overflow: hidden;
  border-radius: 22px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: 0 10px 35px rgba(30, 20, 25, .07);
}

.share-photo-image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #eee;
}

.share-photo-bottom {
  padding: 12px;
}

.share-photo-name {
  margin-bottom: 9px;
  font-size: .82rem;
  color: var(--muted);
}

.share-download {
  width: 100%;
  text-align: center;
  text-decoration: none;
}

.share-empty {
  margin-top: 30px;
  text-align: center;
}

@media (max-width: 560px) {
  .share-shell {
    width: min(100% - 18px, 1100px);
    padding-top: 10px;
  }

  .share-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .share-photo {
    border-radius: 15px;
  }

  .share-photo-bottom {
    padding: 9px;
  }

  .share-photo-name {
    font-size: .74rem;
  }

  .share-download {
    padding-left: 8px;
    padding-right: 8px;
    font-size: .82rem;
  }
}


/* Niknil – Gastgeber Foto-Upload */

.owner-upload-input {
  display: none !important;
}

.owner-upload-progress {
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
  padding: 15px 16px;

  border: 1px solid rgba(238, 128, 139, .22);
  border-radius: 18px;

  background:
    linear-gradient(
      135deg,
      rgba(255, 82, 145, .08),
      rgba(255, 166, 84, .11)
    );
}

.owner-upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin-bottom: 10px;
}

.owner-upload-progress-head span {
  min-width: 0;
  font-weight: 750;
}

.owner-upload-progress-head strong {
  flex: 0 0 auto;

  padding: 4px 9px;

  border-radius: 999px;
  background: rgba(255,255,255,.85);

  font-size: .86rem;
}

.owner-upload-progress-track {
  width: 100%;
  height: 14px;

  overflow: hidden;

  border-radius: 999px;
  background: rgba(210, 197, 190, .55);
}

.owner-upload-progress-track span {
  display: block;

  width: 0%;
  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(
      90deg,
      #f64f91 0%,
      #ff7476 48%,
      #ff9d4d 100%
    );

  transition: width .25s ease;
}

.owner-upload-progress-sub {
  margin-top: 8px;

  color: var(--muted);
  font-size: .84rem;
}


@media (max-width: 600px) {

  .event-actions .btn,
  .event-actions a.btn {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }

  .owner-upload-progress {
    padding: 13px;
  }

  .owner-upload-progress-head {
    align-items: flex-start;
  }

}
