/* ScanPhoto – Gastseite. Warmes Beige, ruhig, mobil zuerst. */

:root {
  --sand-50:  #faf7f1;
  --sand-100: #f6f1e7;
  --sand-200: #ece4d5;
  --sand-300: #ddd1bc;
  --sand-400: #c4b49a;
  --ink:      #3d3427;
  --ink-soft: #6b5f4d;
  --ink-mute: #948972;
  --accent:   #9a7b4f;
  --danger:   #a4503c;
  --white:    #fffdf9;

  --radius:   18px;
  --radius-s: 12px;
  --shadow:   0 1px 2px rgba(61,52,39,.05), 0 12px 32px -12px rgba(61,52,39,.16);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sand-100);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Sanfter Verlauf am oberen Rand – gibt Tiefe ohne Bild */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 320px;
  background: linear-gradient(180deg, var(--sand-200), transparent);
  pointer-events: none;
  z-index: -1;
}

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 20px calc(48px + env(safe-area-inset-bottom));
}

/* ---------------- Kopfbereich ---------------- */

.hero { text-align: center; }

.hero__img {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 62vh;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sand-200);
  box-shadow: var(--shadow);
}

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

.hero__text { padding: 26px 4px 4px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.names {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 9vw, 46px);
  line-height: 1.12;
  letter-spacing: -.01em;
}

.amp {
  display: block;
  font-size: .52em;
  font-style: italic;
  color: var(--accent);
  margin: 4px 0;
}

.meta {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.welcome {
  margin: 26px 0 30px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 15.5px;
}

/* ---------------- Karten ---------------- */

.card {
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card--muted {
  background: var(--sand-50);
  box-shadow: none;
  text-align: center;
}

.card h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
}

.hint {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--ink-mute);
}

.err {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--danger);
}

/* ---------------- Formulare ---------------- */

.field { display: block; margin-bottom: 16px; }

.field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

input[type="text"] {
  width: 100%;
  padding: 13px 15px;
  font: inherit;
  font-size: 16px;                 /* verhindert Zoom auf iOS */
  color: var(--ink);
  background: var(--sand-50);
  border: 1px solid var(--sand-300);
  border-radius: var(--radius-s);
  transition: border-color .15s, box-shadow .15s;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(154, 123, 79, .16);
}

.btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: transform .12s, background .15s, opacity .15s;
}

.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: default; }

.btn--primary { background: var(--ink); color: var(--sand-50); }
.btn--primary:hover:not(:disabled) { background: #4c4132; }

.btn--ghost {
  background: transparent;
  border-color: var(--sand-300);
  color: var(--ink-soft);
  margin-top: 18px;
}

/* ---------------- Auswahlfläche ---------------- */

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 34px 20px;
  text-align: center;
  background: var(--sand-50);
  border: 1.5px dashed var(--sand-300);
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.drop:hover, .drop.is-over {
  border-color: var(--accent);
  background: #f3ece0;
}

.drop input { display: none; }

.drop__icon {
  font-size: 26px;
  line-height: 1;
  color: var(--accent);
  font-weight: 300;
}

.drop__label { font-size: 15px; font-weight: 500; }
.drop__hint  { font-size: 12.5px; color: var(--ink-mute); }

/* ---------------- Upload-Liste ---------------- */

.queue { list-style: none; margin: 18px 0 0; padding: 0; }

.queue:empty { margin: 0; }

.queue li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--sand-200);
  font-size: 14px;
}

.queue__thumb {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
  background: var(--sand-200);
}

.queue__body { flex: 1; min-width: 0; }

.queue__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
}

.bar {
  height: 3px;
  margin-top: 6px;
  background: var(--sand-200);
  border-radius: 2px;
  overflow: hidden;
}

/* Fortschritt über scaleX statt width – läuft im Compositor, kein Layout-Reflow.
   Das JS setzt --p auf 0…1. */
.bar > i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  transition: transform .25s ease-out;
}

.queue__state { flex: none; font-size: 12.5px; color: var(--ink-mute); }
.queue li.is-done  .queue__state { color: #5d7a52; }
.queue li.is-error .queue__state { color: var(--danger); }
.queue li.is-done  .bar > i { background: #7b9a6e; }
.queue li.is-error .bar > i { background: var(--danger); }

/* ---------------- Galerie ---------------- */

.gallery-wrap { margin-top: 34px; }

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.gallery-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
}

.seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--sand-200);
  border-radius: 9px;
}

.seg__btn {
  padding: 6px 13px;
  font: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.seg__btn.is-on {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(61,52,39,.12);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

@media (min-width: 520px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

.tile {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sand-200);
  cursor: pointer;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}

.tile:hover img { transform: scale(1.045); }

.tile__vid {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 9px;
  color: #fff;
  background: rgba(0,0,0,.5);
  border-radius: 50%;
  backdrop-filter: blur(4px);
}

.empty {
  padding: 34px 0;
  text-align: center;
  color: var(--ink-mute);
  font-size: 14px;
}

/* ---------------- Vollbild ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(38, 32, 23, .93);
  backdrop-filter: blur(6px);
}

.lightbox[hidden] { display: none; }

.lightbox__body img,
.lightbox__body video {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 10px;
  display: block;
}

.lightbox__close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 16px;
  width: 40px;
  height: 40px;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,.14);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox__dl {
  display: block;
  margin: 16px auto 0;
  padding: 10px 22px;
  font-size: 14px;
  color: var(--ink);
  background: var(--sand-100);
  border-radius: 999px;
  text-decoration: none;
  width: max-content;
}

/* ---------------- Fuß ---------------- */

.foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--sand-200);
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-mute);
}

.foot p { margin: 0; }

/* ---------------- Auswahlseite ---------------- */

.page--pick { padding-top: 44px; }

.pick-head { text-align: center; margin-bottom: 26px; }

.pick-title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
}

.pick-head .hint { margin: 0; }

.pick-list { margin-bottom: 22px; }

.pick-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, border-color .15s;
}

.pick-item:active { transform: scale(.99); }
.pick-item:hover  { border-color: var(--sand-400); }

.pick-item__img {
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: var(--sand-200);
}

.pick-item__couple {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
}

.pick-item__meta {
  display: block;
  font-size: 13px;
  color: var(--ink-mute);
}

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