@font-face {
  font-family: 'TAN Pearl';
  src: url('/static/guest/fonts/TAN-Pearl-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #FFF8FA;
  font-family: 'Cardo', serif;
  color: #7A2E4C;
}
a { color: #B5476B; }
a:hover { color: #F06EA0; }

/* Lock screen */
.lock-screen {
  position: fixed;
  inset: 0;
  background: #FFF8FA;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}
.lock-card { max-width: 360px; width: 100%; text-align: center; }
.lock-card.shake { animation: shakeX 0.4s ease-in-out; }
.lock-title {
  font-family: 'TAN Pearl', cursive;
  font-size: 44px;
  color: #F06EA0;
  margin-bottom: 8px;
}
.lock-subtitle {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #B5476B;
  margin-bottom: 30px;
}
.pin-boxes { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; }
.pin-box {
  width: 52px;
  height: 64px;
  text-align: center;
  font-size: 26px;
  border: 1px solid #F2A9C4;
  border-radius: 6px;
  font-family: 'Cardo', serif;
  color: #7A2E4C;
  outline: none;
  background: #fff;
}
.pin-box.error { border-color: #D9436B; }
.pin-error { color: #D9436B; font-size: 13px; }

/* Layout */
.page { min-height: 100vh; }
.section-title {
  font-family: 'Cardo', serif;
  font-size: 15px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #F06EA0;
  text-align: center;
  margin: 0 0 8px;
  font-weight: 700;
}
.section-subtitle {
  text-align: center;
  color: #8a4a63;
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 36px;
}
.btn {
  display: inline-block;
  text-decoration: none;
  padding: 16px 34px;
  border-radius: 2px;
  font-family: 'Cardo', serif;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: #F06EA0; color: #fff; }
.btn-outline { background: transparent; color: #F06EA0; border-color: #F06EA0; }
.btn-primary:hover { color: #fff; }
.btn-outline:hover { color: #F06EA0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Hero */
.hero {
  padding: 110px 24px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.hero-names { width: min(90vw, 640px); height: auto; overflow: visible; }
.name-path {
  fill: none;
  stroke: #F06EA0;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: write 2.6s ease forwards;
}
.name-fill {
  fill: #F06EA0;
  opacity: 0;
  animation: fillIn 1s ease forwards;
  animation-delay: 2.1s;
}
.hero-amp {
  font-family: 'TAN Pearl', cursive;
  font-size: 36px;
  fill: #B5476B;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards;
  animation-delay: 2.5s;
}
.hero-date {
  font-size: 15px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #B5476B;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards;
  animation-delay: 2.9s;
}
.hero-chateau {
  width: 100%;
  max-width: 980px;
  opacity: 0;
  animation: fadeUp 1.4s ease-out 3.2s forwards;
}
.hero-chateau img { width: 100%; height: auto; display: block; }
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 1.4s ease-out 3.6s forwards;
}

@keyframes write { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes fillIn { to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@keyframes pulseDot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .name-path, .name-fill, .hero-amp, .hero-date, .hero-chateau, .hero-actions {
    animation: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
  }
}

/* Upload section */
.upload-section { max-width: 640px; margin: 0 auto; padding: 40px 24px 80px; }
.upload-form { display: flex; flex-direction: column; gap: 16px; }
.name-input {
  border: none;
  border-bottom: 1px solid #F2A9C4;
  background: transparent;
  padding: 10px 4px;
  font-family: 'Cardo', serif;
  font-size: 16px;
  color: #7A2E4C;
  outline: none;
}
.name-error { font-size: 12px; color: #D9436B; margin-top: -12px; }
.selection-limit-msg { font-size: 12px; color: #c48ba3; }
.dropzone {
  border: 2px dashed #F2A9C4;
  background: transparent;
  border-radius: 4px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.dropzone.drag-over { border-color: #F06EA0; background: #FCE7EF; }
.dropzone-title { font-family: 'Cardo', serif; font-size: 15px; color: #B5476B; letter-spacing: 1px; }
.dropzone-subtitle { font-size: 13px; color: #c48ba3; margin-top: 6px; }

.pending-status-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #B5476B; }
.pending-progress-track { width: 100%; height: 4px; background: #F7DDE8; border-radius: 2px; overflow: hidden; }
.pending-progress-bar { height: 100%; width: 0%; background: #F06EA0; transition: width .3s ease; }
.pending-tiles { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.pending-tile { position: relative; width: 76px; height: 76px; flex-shrink: 0; border-radius: 4px; overflow: hidden; background: #f5d9e4; }
.pending-tile img, .pending-tile video { width: 100%; height: 100%; object-fit: cover; }
.pending-tile-status {
  position: absolute;
  bottom: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  background: #c9c9c9;
}
.pending-tile-status.uploading { background: #F06EA0; animation: pulseDot 1s ease-in-out infinite; }
.pending-tile-status.uploaded { background: #4CAF7D; }
.pending-tile-status.failed { background: #D9436B; }
.pending-tile-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(40,10,20,.55);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
}
.publish-btn { width: 100%; border: none; padding: 16px; }
.processing-notice { text-align: center; font-size: 12px; color: #c48ba3; }

/* Gallery section */
.gallery-section { max-width: 1100px; margin: 0 auto; padding: 20px 24px 110px; }
.gallery-empty { text-align: center; color: #c48ba3; font-size: 14px; padding: 40px 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.gallery-tile { position: relative; border-radius: 4px; overflow: hidden; cursor: pointer; background: #f5d9e4; }
.gallery-tile img { width: 100%; height: auto; display: block; }
.gallery-tile-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 12px 10px;
  background: linear-gradient(to top, rgba(40,10,20,.65), transparent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
.gallery-tile-play {
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(40,10,20,.55);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  pointer-events: none;
}
.load-more-btn { display: block; margin: 30px auto 0; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(40,10,20,.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.lightbox-media { max-width: 90vw; max-height: 70vh; display: flex; }
.lightbox-media img, .lightbox-media video { max-width: 90vw; max-height: 70vh; display: block; }
.lightbox-guest { color: #fff; margin-top: 16px; text-align: center; font-family: 'Cardo', serif; font-weight: 700; }
.lightbox-loading, .lightbox-retry { color: #fff; font-family: 'Cardo', serif; text-align: center; }
.lightbox-retry button {
  margin-left: 8px;
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  padding: 6px 14px;
  border-radius: 2px;
  cursor: pointer;
  font-family: 'Cardo', serif;
}
.lightbox-close { position: absolute; top: 24px; right: 24px; color: #fff; font-size: 28px; cursor: pointer; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #F06EA0;
  color: #fff;
  padding: 14px 24px;
  border-radius: 4px;
  font-family: 'Cardo', serif;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(240,110,160,.35);
  z-index: 1100;
}
