:root {
  --bg: #f5f3f0;
  --ink: #3a3236;
  --muted: #5a5054;
  --faint: #8a7f83;
  --wine: #7b1420;
  --rose: #c4626b;
  --paper: rgba(253, 252, 251, 0.92);
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Parisienne", cursive;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.corner {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}
.corner-top {
  top: 0; right: 0;
  width: min(30vw, 340px);
  transform: rotate(90deg) scaleX(-1);
  transform-origin: top right;
}
.corner-bottom { bottom: 0; left: 0; width: min(28vw, 320px); }

.wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px calc(56px + env(safe-area-inset-bottom));
}
.sheet { width: 100%; max-width: 720px; }

/* ------------------------------------------------------------- Kopfteil */

.intro { text-align: center; }
.date {
  font-size: 11px; letter-spacing: 0.34em;
  text-transform: uppercase; color: var(--rose);
}
.couple {
  margin-top: 18px; padding-bottom: 40px;
  font-family: var(--script);
  font-size: clamp(38px, 11vw, 52px);
  color: var(--wine); line-height: 1.15;
}
h1 {
  margin: 0; font-family: var(--serif); font-weight: 300;
  font-size: clamp(32px, 9vw, 48px); line-height: 1.08; color: var(--wine);
}
.lede {
  margin: 18px auto 0; max-width: 46ch;
  font-size: 16px; line-height: 1.7; color: var(--muted); text-wrap: pretty;
}

/* --------------------------------------------------------------- Karte */

.card {
  margin-top: 40px;
  padding: clamp(20px, 5vw, 34px);
  background: var(--paper);
  border: 1px solid rgba(123, 20, 32, 0.14);
  backdrop-filter: blur(2px);
}

.field { display: block; margin-bottom: 22px; }
.label {
  display: block; margin-bottom: 10px;
  font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--faint);
}
.field input {
  width: 100%; padding: 15px 18px;
  border: 1px solid rgba(123, 20, 32, 0.2); border-radius: 2px;
  background: var(--bg); font-family: var(--sans);
  font-size: 16px; /* < 16px loest auf iOS ungewolltes Zoomen aus */
  color: var(--ink); outline: none;
}
.field input:focus { border-color: var(--wine); }

/* ----------------------------------------------------------- Ablagefeld */

.drop {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px;
  padding: clamp(36px, 11vw, 58px) 20px;
  border: 1px dashed rgba(123, 20, 32, 0.28); border-radius: 3px;
  background: var(--bg); cursor: pointer; text-align: center;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.drop.over { border-color: var(--wine); background: rgba(196, 98, 107, 0.09); }
.plus {
  width: 52px; height: 52px; border-radius: 999px;
  border: 1px solid rgba(123, 20, 32, 0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--wine); font-size: 24px; font-family: var(--serif);
}
.drop-title { font-family: var(--serif); font-size: 25px; color: var(--wine); }
.drop-sub { font-size: 14px; color: var(--faint); }

/* -------------------------------------------------------------- Auswahl */

.pending-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 14px;
}
.linkbtn {
  border: none; background: none; padding: 0;
  font-family: var(--sans); font-size: 13px; color: var(--rose);
  cursor: pointer; text-decoration: underline;
}
.grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.tile {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border-radius: 2px; background: #e7e2dd center / cover no-repeat;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  padding: 8px; text-align: center;
  font-size: 10px; line-height: 1.3; color: var(--faint); word-break: break-all;
}
.tile .fallback .glyph { font-size: 22px; color: var(--wine); font-family: var(--serif); }
.tile .rm {
  position: absolute; top: 5px; right: 5px;
  width: 26px; height: 26px; border: none; border-radius: 999px;
  background: rgba(38, 28, 31, 0.62); color: #fdfcfb;
  font-family: var(--sans); font-size: 14px; line-height: 1; cursor: pointer;
}
.tile .badge {
  position: absolute; left: 5px; bottom: 5px;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(38, 28, 31, 0.62); color: #fdfcfb; font-size: 10px;
}
.tile .tprog {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(38, 28, 31, 0.25);
}
.tile .tprog i { display: block; height: 100%; width: 0; background: var(--rose); transition: width 0.25s; }
.tile.done { outline: 2px solid rgba(138, 156, 134, 0.8); outline-offset: -2px; }
.tile.done .tprog i { background: #8a9c86; }
.tile.error { outline: 2px solid var(--rose); outline-offset: -2px; }

/* ------------------------------------------------------------ Fortschritt */

#progressBox { margin-top: 22px; }
.bar { height: 4px; background: rgba(123, 20, 32, 0.12); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--wine); transition: width 0.3s; }
.progress-text {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 8px; font-size: 12px; color: var(--faint);
}

.progress-note {
  margin-top: 6px; min-height: 16px;
  font-size: 12px; line-height: 1.4; color: var(--rose);
}

.send {
  margin-top: 26px; width: 100%; padding: 18px; border: none;
  border-radius: 999px; background: var(--wine); color: #fdfcfb;
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.16em;
  text-transform: uppercase; cursor: pointer;
}
.send:disabled { background: rgba(123, 20, 32, 0.32); cursor: default; }

.note {
  margin-top: 20px; padding: 18px 22px;
  font-size: 15px; line-height: 1.5; text-align: center;
}
.note-ok {
  background: rgba(138, 156, 134, 0.14);
  border: 1px solid rgba(138, 156, 134, 0.5); color: #4a5647;
}
.note-warn {
  background: rgba(196, 98, 107, 0.1);
  border: 1px solid rgba(196, 98, 107, 0.45); color: #7b1420;
  text-align: left;
}
.note-warn ul { margin: 8px 0 0; padding-left: 18px; }

.hint { margin: 16px 0 0; font-size: 12px; line-height: 1.6; color: var(--faint); text-align: center; }

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