:root {
  --bg: #f6e7df;
  --bg-2: #fffaf7;
  --text: #37251f;
  --muted: #765e55;
  --accent: #9f644f;
  --accent-dark: #7f4a3a;
  --line: rgba(95, 60, 48, .18);
  --card: rgba(255, 255, 255, .64);
  --card-strong: rgba(255, 255, 255, .70);
  --shadow: 0 24px 70px rgba(22, 20, 18, .28);
  --script-font: "Brittany Signature", "Brush Script MT", "Segoe Script", "Apple Chancery", cursive;
}

/*
 * Brittany Signature als lokale Webfont-Datei einbinden.
 * Lege die Datei BrittanySignature.ttf in den Ordner assets/fonts/.
 */
@font-face {
  font-family: "Brittany Signature";
  src:
    url("fonts/BrittanySignature.woff2") format("woff2"),
    url("fonts/BrittanySignature.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: transparent;
  overflow-x: hidden;
}

/*
 * Originalfoto als Hintergrundbild.
 * Die Datei selbst bleibt unverändert; Blur, Abdunklung und Maske passieren nur per CSS.
 * Wichtig: keine negative z-index-Ebene, damit nicht der Body-Hintergrund darüberliegt.
 */
body::before {
  content: "";
  position: fixed;
  inset: -28px;
  z-index: 0;
  pointer-events: none;
  background-image: url("katharina-max-background.jpg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(7px) saturate(1.02) brightness(.88);
  transform: scale(1.04);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at center 18%, rgba(255, 255, 255, .16), transparent 34rem),
    radial-gradient(circle at center, rgba(255, 248, 244, .12), rgba(32, 23, 18, .18) 76%),
    linear-gradient(180deg, rgba(23, 18, 15, .07), rgba(23, 18, 15, .20));
}

.page {
  position: relative;
  z-index: 2;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.hero-card,
.card {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 265px;
  padding: 34px 24px 30px;
  border-radius: 34px;
  text-align: center;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, .04)),
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, .28), transparent 22rem);
  pointer-events: none;
}

.rings {
  position: absolute;
  inset: auto -54px -72px auto;
  width: 210px;
  height: 210px;
  border: 12px double rgba(159, 100, 79, .24);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.rings::after {
  content: "";
  position: absolute;
  left: -68px;
  top: 28px;
  width: 145px;
  height: 145px;
  border: 10px double rgba(159, 100, 79, .16);
  border-radius: 50%;
}

.eyebrow {
  position: relative;
  margin: 0 0 12px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  position: relative;
  margin: 0;
  font-family: var(--script-font);
  font-size: clamp(3.2rem, 14vw, 3.8rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .01em;
  text-shadow: 0 2px 18px rgba(255, 255, 255, .35);
}

.date {
  position: relative;
  margin: 10px 0 0;
  font-family: var(--script-font);
  font-size: clamp(2.15rem, 9vw, 3.55rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .02em;
  color: var(--accent-dark);
  text-shadow: 0 2px 16px rgba(255, 255, 255, .35);
}

.subtitle {
  position: relative;
  margin: 18px auto 0;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.55;
}

.card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 26px;
}

.upload-card {
  background: var(--card-strong);
}

.field-label {
  display: flex;
  justify-content: space-between;
  margin: 2px 4px 8px;
  font-weight: 800;
}

.field-label span {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
}

.text-input {
  display: block;
  width: 100%;
  min-height: 54px;
  margin-bottom: 16px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .68);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
}

.text-input:focus {
  border-color: rgba(159, 100, 79, .55);
  box-shadow: 0 0 0 4px rgba(159, 100, 79, .12);
}

.file-drop {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 192px;
  padding: 22px;
  border: 2px dashed rgba(159, 100, 79, .42);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .58), rgba(255, 248, 244, .64));
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 22px;
  background: rgba(159, 100, 79, .12);
  color: var(--accent-dark);
  font-size: 2.4rem;
  line-height: 1;
}

.file-drop strong {
  font-size: 1.2rem;
}

.file-drop small,
.selection small,
.current-file,
.footer {
  color: var(--muted);
}

.file-drop small {
  max-width: 310px;
  line-height: 1.45;
}

.selection {
  margin: 14px 0;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .52);
  border: 1px solid var(--line);
}

.selection strong,
.selection small {
  display: block;
}

.selection ul,
.failed ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.selection li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid rgba(95, 60, 48, .08);
  color: var(--muted);
  font-size: .92rem;
}

.selection li span {
  white-space: nowrap;
}

.primary-button,
.secondary-button {
  appearance: none;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
}

.primary-button {
  margin-top: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 14px 26px rgba(127, 74, 58, .24);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: .45;
  box-shadow: none;
}

.secondary-button {
  margin-top: 12px;
  background: rgba(159, 100, 79, .12);
  color: var(--accent-dark);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 850;
}

.progress-track {
  height: 12px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(159, 100, 79, .14);
}

#progressBar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transition: width .18s ease;
}

.current-file {
  min-height: 1.4em;
  margin: 12px 0 0;
  word-break: break-word;
  font-size: .92rem;
}

.result-card {
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 10px;
  border-radius: 21px;
  background: rgba(73, 140, 91, .14);
  color: #2f7643;
  font-size: 2.2rem;
  font-weight: 900;
}

.result-card h2,
.notice h2 {
  margin: 0 0 8px;
}

.result-card p,
.notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.failed {
  margin-top: 12px;
  text-align: left;
  color: var(--muted);
}

.failed li {
  padding: 9px 0;
  border-top: 1px solid rgba(95, 60, 48, .10);
}

.notice.error {
  background: rgba(255, 244, 244, .72);
}

.footer {
  padding: 18px 8px 0;
  text-align: center;
  font-size: .86rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, .86);
  text-shadow: 0 1px 10px rgba(0, 0, 0, .35);
}

@media (min-width: 560px) {
  .page { padding-top: 34px; }
  .card { padding: 22px; }
  .hero-card { padding: 42px 34px 36px; }
}

@media (max-width: 420px) {
  body::before {
    background-position: center top;
  }

  .hero-card {
    min-height: 248px;
  }
}

/* Private Fotogalerie */
.gallery-page {
  width: min(100%, 980px);
}

.gallery-hero {
  min-height: 230px;
}

.gallery-login-card h2,
.notice h2 {
  margin: 0 0 8px;
}

.gallery-login-card p,
.notice p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.gallery-key-form {
  margin-top: 16px;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.gallery-toolbar strong,
.gallery-toolbar small {
  display: block;
}

.gallery-toolbar small {
  margin-top: 3px;
  color: var(--muted);
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 999px;
  background: rgba(159, 100, 79, .12);
  color: var(--accent-dark);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

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

.gallery-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .50);
  box-shadow: 0 12px 28px rgba(22, 20, 18, .16);
  backdrop-filter: blur(12px) saturate(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
}

.gallery-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, .30);
  cursor: zoom-in;
}

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

.gallery-video-thumb {
  position: relative;
  overflow: hidden;
}

.gallery-video-thumb video {
  background: rgba(30, 22, 18, .28);
}

.video-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  line-height: 1;
}

.gallery-file-tile {
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  aspect-ratio: 1;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.52), rgba(255,248,244,.62));
  text-align: center;
}

.gallery-file-tile span {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: rgba(159, 100, 79, .14);
  color: var(--accent-dark);
  font-weight: 900;
  letter-spacing: .04em;
}

.gallery-file-tile small {
  max-width: 160px;
  color: var(--muted);
  line-height: 1.35;
}

.gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  color: var(--muted);
  font-size: .78rem;
}

.gallery-meta a {
  color: var(--accent-dark);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  background: rgba(18, 14, 12, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  display: grid;
  place-items: center;
  gap: 12px;
  width: min(100%, 1080px);
  margin: 0;
}

.lightbox-figure img,
.lightbox-figure video {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 126px);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .48);
  object-fit: contain;
  background: rgba(255, 255, 255, .08);
}

.lightbox-figure video {
  width: min(100%, 1080px);
}

.lightbox-figure img[hidden],
.lightbox-figure video[hidden] {
  display: none;
}

.lightbox-figure figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: min(100%, 620px);
  color: rgba(255, 255, 255, .86);
  font-weight: 800;
}

.lightbox-figure figcaption a {
  color: #fff;
  text-decoration: none;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
  cursor: pointer;
  touch-action: manipulation;
}

.lightbox-close {
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  width: 52px;
  height: 72px;
  transform: translateY(-50%);
  border-radius: 999px;
  font-size: 3.1rem;
  line-height: 1;
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

@media (min-width: 720px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 12px;
  }
}

@media (min-width: 1040px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  }
}

@media (max-width: 520px) {
  .gallery-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .secondary-link {
    width: 100%;
  }

  .lightbox-nav {
    top: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
    width: 58px;
    height: 50px;
    transform: none;
    font-size: 2.6rem;
  }

  .lightbox-prev {
    left: 18px;
  }

  .lightbox-next {
    right: 18px;
  }

  .lightbox-figure img,
  .lightbox-figure video {
    max-height: calc(100dvh - 150px);
  }

  .lightbox-figure figcaption {
    padding-bottom: 62px;
  }
}
