:root {
  color-scheme: dark;
  --bg: #090a10;
  --panel: rgba(22, 24, 36, .92);
  --panel-2: #1c1f2d;
  --text: #f4f5fb;
  --muted: #a5a9ba;
  --accent: #8b6f5b;
  --accent-2: #d8b8aa;
  --danger: #ff5570;
  --success: #3ddc97;
  --border: rgba(255,255,255,.10);
  --shadow: 0 24px 80px rgba(0,0,0,.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

/* Публічна весільна сторінка */
.public-page {
  color-scheme: light;
  --wedding-bg: #f8f1eb;
  --wedding-paper: rgba(255, 252, 248, .95);
  --wedding-ink: #4f4038;
  --wedding-muted: #786b64;
  --wedding-rose: #b98283;
  --wedding-rose-dark: #936667;
  --wedding-sage: #8b9a84;
  --wedding-line: #e7d7cd;
  position: relative;
  overflow-x: hidden;
  color: var(--wedding-ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(218, 183, 169, .38) 0 8%, transparent 25%),
    radial-gradient(circle at 92% 15%, rgba(161, 178, 153, .25) 0 9%, transparent 27%),
    radial-gradient(circle at 18% 94%, rgba(185, 130, 131, .18) 0 10%, transparent 30%),
    linear-gradient(145deg, #fbf7f3 0%, #f5ebe4 52%, #f8f2ec 100%);
}
.public-page::before,
.public-page::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  opacity: .55;
}
.public-page::before {
  top: -190px;
  left: -165px;
  border: 1px solid rgba(185, 130, 131, .30);
  box-shadow: 45px 55px 0 14px rgba(232, 211, 201, .32), 100px 110px 0 4px rgba(139, 154, 132, .12);
}
.public-page::after {
  right: -190px;
  bottom: -190px;
  border: 1px solid rgba(139, 154, 132, .28);
  box-shadow: -55px -40px 0 20px rgba(235, 215, 205, .35), -100px -95px 0 5px rgba(185, 130, 131, .10);
}
.upload-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px 16px;
}
.hero-card,
.login-card,
.qr-card {
  width: min(100%, 660px);
  padding: clamp(24px, 5vw, 48px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.wedding-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 720px);
  padding: clamp(28px, 6vw, 58px);
  color: var(--wedding-ink);
  background:
    linear-gradient(rgba(255,252,248,.94), rgba(255,252,248,.94)),
    repeating-linear-gradient(0deg, rgba(139,111,91,.025) 0 1px, transparent 1px 5px);
  border: 1px solid rgba(185, 130, 131, .28);
  border-radius: 34px;
  box-shadow: 0 26px 90px rgba(101, 72, 57, .18), 0 3px 12px rgba(101, 72, 57, .08);
  backdrop-filter: blur(14px);
}
.wedding-card::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(185, 130, 131, .20);
  border-radius: 26px;
  pointer-events: none;
}
.corner-flower {
  position: absolute;
  z-index: 0;
  color: rgba(139, 154, 132, .30);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 92px;
  line-height: 1;
  user-select: none;
}
.corner-flower-left { top: -19px; left: -5px; transform: rotate(-28deg); }
.corner-flower-right { right: -5px; bottom: -18px; transform: rotate(152deg); }
.wedding-header,
.wedding-card > label,
.wedding-card > div,
.wedding-card > button,
.wedding-card > p,
.wedding-card > footer {
  position: relative;
  z-index: 1;
}
.wedding-header { text-align: center; }
.wedding-monogram {
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--wedding-rose-dark);
  background: linear-gradient(145deg, #fffdfa, #f6e9e1);
  border: 1px solid rgba(185, 130, 131, .36);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(147, 102, 103, .13), inset 0 0 0 6px rgba(255,255,255,.55);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
}
.wedding-monogram i {
  color: var(--wedding-sage);
  font-size: 18px;
  font-weight: 400;
}
.eyebrow {
  margin: 18px 0 6px;
  color: var(--accent-2);
  letter-spacing: .16em;
  font-weight: 800;
  font-size: 12px;
}
.wedding-eyebrow {
  margin: 0 0 10px;
  color: var(--wedding-sage);
  letter-spacing: .23em;
  font-size: 11px;
}
h1 { margin: 0; font-size: clamp(30px, 6vw, 48px); line-height: 1.05; }
.wedding-header h1 {
  color: #493930;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 8vw, 62px);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.05;
}
.title-ampersand {
  display: inline-block;
  margin: 0 .06em;
  color: var(--wedding-rose);
  font-style: italic;
  font-weight: 400;
}
.wedding-divider {
  width: min(280px, 78%);
  margin: 19px auto 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--wedding-rose);
}
.wedding-divider::before,
.wedding-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--wedding-line));
}
.wedding-divider::after { background: linear-gradient(90deg, var(--wedding-line), transparent); }
.wedding-divider span { font-size: 18px; }
.wedding-tagline {
  margin: 0;
  color: var(--wedding-rose-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 4vw, 30px);
  font-style: italic;
  line-height: 1.25;
}
.lead { color: var(--muted); line-height: 1.6; font-size: 17px; }
.wedding-card .lead {
  max-width: 585px;
  margin: 14px auto 0;
  color: var(--wedding-muted);
  font-size: 16px;
  line-height: 1.7;
}
.name-field,
.login-form label,
.qr-form label {
  display: grid;
  gap: 8px;
  margin: 24px 0 16px;
  color: var(--muted);
}
.wedding-card .name-field {
  margin-top: 28px;
  color: #6d5d54;
  font-weight: 650;
}
.name-field small { opacity: .72; font-weight: 400; }
input[type="text"],
input[type="password"],
input[type="url"] {
  width: 100%;
  color: var(--text);
  background: #10121b;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
}
.wedding-card input[type="text"] {
  color: var(--wedding-ink);
  background: rgba(255,255,255,.72);
  border-color: #e4d3c8;
  box-shadow: inset 0 1px 2px rgba(90, 65, 53, .04);
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,111,91,.18); }
.wedding-card input:focus {
  border-color: var(--wedding-rose);
  box-shadow: 0 0 0 4px rgba(185,130,131,.13);
}
.drop-zone {
  position: relative;
  min-height: 190px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  text-align: center;
  border: 2px dashed rgba(167,139,250,.42);
  border-radius: 22px;
  background: rgba(124,92,255,.07);
  cursor: pointer;
  transition: .2s ease;
  padding: 24px;
}
.wedding-card .drop-zone {
  min-height: 210px;
  border-color: rgba(185,130,131,.46);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(250,242,236,.78), rgba(247,239,233,.45));
}
.drop-zone:hover,
.drop-zone.dragging,
.drop-zone:focus {
  border-color: var(--accent-2);
  background: rgba(124,92,255,.14);
  transform: translateY(-2px);
  outline: none;
}
.wedding-card .drop-zone:hover,
.wedding-card .drop-zone.dragging,
.wedding-card .drop-zone:focus {
  border-color: var(--wedding-rose);
  background: linear-gradient(145deg, rgba(250,236,230,.95), rgba(245,239,232,.78));
  box-shadow: 0 10px 30px rgba(147,102,103,.10);
}
.drop-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop-zone span { color: var(--muted); font-size: 13px; }
.wedding-card .drop-zone strong {
  color: #57463d;
  font-size: 18px;
}
.wedding-card .drop-zone span { color: #897970; }
.wedding-card .drop-zone .drop-hint { color: var(--wedding-rose-dark); font-size: 14px; }
.upload-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  font-size: 30px;
}
.wedding-card .upload-icon {
  width: 56px;
  height: 56px;
  color: white;
  background: linear-gradient(145deg, #c28d8d, #a97273);
  box-shadow: 0 10px 24px rgba(147,102,103,.22);
}
.upload-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.file-list {
  margin: 16px 0;
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}
.file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #11131d;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 13px;
}
.wedding-card .file-row {
  color: var(--wedding-ink);
  background: rgba(255,255,255,.68);
  border-color: #eadbd2;
}
.file-row div { min-width: 0; display: grid; gap: 3px; }
.file-row strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row span { color: var(--muted); font-size: 12px; }
.wedding-card .file-row span { color: #8d7d74; }
.file-row button { border: 0; color: var(--muted); background: transparent; font-size: 24px; cursor: pointer; }
.wedding-card .file-row button { color: var(--wedding-rose-dark); }
.primary-button,
.secondary-button,
.danger-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}
.primary-button {
  width: 100%;
  margin-top: 16px;
  padding: 15px 18px;
  color: white;
  background: linear-gradient(135deg, var(--accent), #a48269);
  box-shadow: 0 12px 30px rgba(139,111,91,.25);
}
.wedding-button {
  min-height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #b77f80, #956667);
  box-shadow: 0 13px 28px rgba(147,102,103,.24);
  font-size: 16px;
  letter-spacing: .01em;
}
.primary-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.primary-button:disabled,
.danger-button:disabled { opacity: .45; cursor: not-allowed; }
.secondary-button { padding: 10px 14px; background: #171a27; border-color: var(--border); }
.secondary-button:hover { border-color: rgba(216,184,170,.65); }
.danger-button { padding: 10px 14px; color: white; background: var(--danger); }
.progress-panel { margin-top: 18px; }
.progress-copy { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.wedding-card .progress-copy { color: #796961; }
.progress-track { height: 10px; margin-top: 8px; border-radius: 999px; background: #10121b; overflow: hidden; }
.wedding-card .progress-track { background: #eaded7; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #d2a2a1); transition: width .15s linear; }
.wedding-card .progress-bar { background: linear-gradient(90deg, #b77f80, #8b9a84); }
.message { margin-top: 16px; padding: 13px 15px; border-radius: 13px; border: 1px solid; }
.message.success { color: #baf5d8; background: rgba(61,220,151,.10); border-color: rgba(61,220,151,.28); }
.message.error { color: #ffc1cb; background: rgba(255,85,112,.10); border-color: rgba(255,85,112,.28); }
.wedding-card .message.success { color: #476351; background: rgba(139,154,132,.12); border-color: rgba(139,154,132,.35); }
.wedding-card .message.error { color: #8a4f52; background: rgba(185,130,131,.10); border-color: rgba(185,130,131,.34); }
.privacy-note { margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.wedding-card .privacy-note { color: #8a7a71; text-align: center; }
.wedding-footer {
  margin-top: 30px;
  padding-top: 23px;
  display: grid;
  justify-items: center;
  gap: 3px;
  color: #89766d;
  border-top: 1px solid #eadbd2;
  font-family: Georgia, "Times New Roman", serif;
}
.wedding-footer strong {
  color: #5b473d;
  font-size: 20px;
  font-weight: 500;
}
.footer-heart { margin-top: 4px; color: var(--wedding-rose); font-size: 18px; }

/* Адмін-панель */
.logo-mark {
  min-width: 54px;
  width: fit-content;
  height: 54px;
  padding: 0 13px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  font-weight: 900;
  font-size: 19px;
  background: linear-gradient(135deg, var(--accent), #bd8d7a);
  box-shadow: 0 12px 30px rgba(139,111,91,.35);
}
.admin-body { background: #0b0c12; }
.centered { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { max-width: 450px; }
.login-form { margin-top: 20px; }
.login-form label { margin: 12px 0; }
.text-link { display: block; text-align: center; margin-top: 18px; color: var(--muted); }
.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(18px, 4vw, 54px);
  background: rgba(11,12,18,.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.admin-header h1 { font-size: clamp(25px, 4vw, 38px); }
.admin-header .eyebrow { margin-top: 0; }
.admin-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.admin-actions form { margin: 0; }
.admin-main { padding: 28px clamp(18px, 4vw, 54px) 60px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.stats-grid article { padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--panel-2); }
.stats-grid span { display: block; color: var(--muted); font-size: 13px; }
.stats-grid strong { display: block; margin-top: 8px; font-size: 24px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 28px 0 18px; }
.filter-tabs { display: flex; gap: 6px; padding: 5px; border-radius: 13px; background: #151722; }
.filter-tabs a { padding: 8px 13px; border-radius: 9px; color: var(--muted); font-weight: 700; }
.filter-tabs a.active { color: white; background: var(--accent); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.media-card { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--panel-2); }
.media-preview { aspect-ratio: 16/10; background: #050609; display: grid; place-items: center; overflow: hidden; }
.media-preview img,
.media-preview video { width: 100%; height: 100%; object-fit: contain; }
.media-info { display: grid; gap: 5px; padding: 14px 14px 10px; }
.media-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-info span { color: var(--muted); font-size: 12px; }
.card-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.small-button { flex: 1; padding: 8px 10px; background: #12141e; border-color: var(--border); color: var(--muted); }
.danger-link { color: #ff9aac; }
.select-box { position: absolute; z-index: 2; top: 10px; left: 10px; }
.select-box input { position: absolute; opacity: 0; }
.select-box span { display: block; width: 25px; height: 25px; border-radius: 8px; border: 2px solid white; background: rgba(0,0,0,.48); }
.select-box input:checked + span { background: var(--accent); box-shadow: inset 0 0 0 5px var(--accent), inset 0 0 0 7px white; }
.pagination { display: flex; justify-content: center; gap: 20px; margin-top: 26px; color: var(--muted); }
.pagination a { color: var(--accent-2); }
.empty-state { text-align: center; color: var(--muted); padding: 80px 20px; border: 1px dashed var(--border); border-radius: 20px; }
.qr-card { max-width: 560px; text-align: center; }
.qr-form { text-align: left; }
.qr-form label { margin-bottom: 10px; }
.qr-image { width: min(320px, 80vw); margin: 24px auto; padding: 15px; border-radius: 22px; background: white; }
.qr-image img { display: block; width: 100%; }
.url-code { display: block; overflow-wrap: anywhere; color: var(--muted); }
.qr-actions { display: flex; gap: 10px; margin-top: 20px; }
.qr-actions .primary-button { margin: 0; }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .admin-header { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .upload-shell { padding: 14px 10px; align-items: start; }
  .hero-card,
  .login-card,
  .qr-card { border-radius: 20px; padding: 22px; }
  .wedding-card { padding: 31px 20px 27px; border-radius: 25px; }
  .wedding-card::before { inset: 7px; border-radius: 19px; }
  .wedding-monogram { width: 76px; height: 76px; font-size: 24px; }
  .wedding-header h1 { font-size: clamp(37px, 12vw, 50px); }
  .wedding-tagline { font-size: 22px; }
  .wedding-card .lead { font-size: 14px; line-height: 1.62; }
  .wedding-card .drop-zone { min-height: 190px; padding: 19px 13px; }
  .corner-flower { font-size: 68px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid strong { font-size: 19px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .filter-tabs { justify-content: center; }
  .admin-actions { width: 100%; }
  .admin-actions > * { flex: 1; }
  .secondary-button { width: 100%; }
  .qr-actions { flex-direction: column; }
}
