:root {
  --accent: #7c5cbf;
  --accent-dark: #5e3fa3;
  --bg: #faf8fd;
  --card: #ffffff;
  --ink: #1e1a2e;
  --muted: #7a7490;
  --border: #e4dff0;
  --danger: #c0503f;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(30, 26, 46, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.wrap.wide { max-width: 900px; }

.brand {
  text-align: center;
  margin: 20px 0 32px;
}
.brand .heart { font-size: 28px; }
.brand h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 6px 0 4px;
  letter-spacing: 0.3px;
}
.brand p { color: var(--muted); font-size: 14px; margin: 0; }

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

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--ink);
}
label:first-child { margin-top: 0; }

input[type=text], input[type=password], input[type=date], input[type=email], input[type=number], textarea, input[type=color] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
small.hint { color: var(--muted); font-size: 12px; display: block; margin-top: 4px; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
button:active, .btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: #f2ede1; color: var(--ink); }
.btn-danger { background: #fbeae6; color: var(--danger); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--ink); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }

.error-box {
  background: #fbeae6;
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  margin: 12px 0;
  display: none;
}
.error-box.show { display: block; }

.success-box {
  background: #eaf5ea;
  color: #3c7a3c;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  margin: 12px 0;
  display: none;
}
.success-box.show { display: block; }

.qr-box {
  text-align: center;
  padding: 20px;
}
.qr-box img { width: 220px; height: 220px; border-radius: 12px; border: 8px solid #fff; box-shadow: var(--shadow); }

.link-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.link-row input { flex: 1; font-size: 13px; background: #f9f6ef; color: var(--muted); }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 34px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.dropzone.drag { border-color: var(--accent); background: #fbf6ec; }
.dropzone .icon { font-size: 34px; margin-bottom: 8px; }
.dropzone p { margin: 4px 0; color: var(--muted); font-size: 14px; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f2ede1;
}
.preview-item img, .preview-item video { width: 100%; height: 100%; object-fit: cover; }
.preview-item .remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer; border: none; padding: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f2ede1;
  cursor: pointer;
}
.gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; }
.gallery-item .video-badge {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 11px;
  padding: 2px 6px; border-radius: 6px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.top-bar h1 { font-size: 19px; margin: 0; }
.top-bar .sub { color: var(--muted); font-size: 13px; }

.lightbox {
  position: fixed; inset: 0; background: rgba(20,17,14,0.92);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px; flex-direction: column;
}
.lightbox.show { display: flex; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 78vh; border-radius: 8px; }
.lightbox .lb-actions { margin-top: 16px; display: flex; gap: 10px; }
.lightbox .lb-close {
  position: absolute; top: 18px; right: 18px;
  background: rgba(255,255,255,0.15); color: #fff; border: none;
  width: 38px; height: 38px; border-radius: 50%; font-size: 18px; cursor: pointer;
}

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.photo-list { list-style: none; padding: 0; margin: 0; }
.photo-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.photo-list img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.photo-list .meta { flex: 1; overflow: hidden; }
.photo-list .meta .name { font-weight: 600; }
.photo-list .meta .sub { color: var(--muted); font-size: 12px; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button {
  flex: 1; background: #f2ede1; color: var(--ink); padding: 10px;
}
.tabs button.active { background: var(--accent); color: #fff; }

footer.credit {
  text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px;
}

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #2b2620; color: #fff;
  padding: 14px 20px; border-radius: 14px;
  font-size: 14px; line-height: 1.5; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 200; max-width: 320px; width: calc(100% - 40px);
  opacity: 0; transition: opacity 0.25s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
