:root {
  --bg: #f6f2ea;
  --ink: #2b2a26;
  --accent: #b4512c;
  --accent-dark: #79361e;
  --card: #fffaf1;
  --line: #e7dac7;
  --soft: #6d655a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(180, 81, 44, 0.15), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(121, 54, 30, 0.1), transparent 35%),
    var(--bg);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
}

.login-page {
  max-width: 560px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 2.2rem 1.4rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #f1debe 0%, #e3bf97 60%, #d6a27a 100%);
  animation: rise 450ms ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    120deg,
    transparent,
    transparent 14px,
    rgba(255, 255, 255, 0.08) 14px,
    rgba(255, 255, 255, 0.08) 18px
  );
  pointer-events: none;
}

h1,
h2 {
  font-family: "Fraunces", serif;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.05;
  position: relative;
}

.subtitle {
  margin: 0.5rem 0 0;
  color: #473f34;
  position: relative;
}

.couple-image {
  margin-top: 1.2rem;
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  position: relative;
}

.hidden {
  display: none !important;
}

.message,
.upload-panel,
.gallery-section,
.admin-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.message {
  font-size: 1.02rem;
  color: var(--accent-dark);
}

input,
textarea,
button,
.button-link {
  font: inherit;
}

input,
textarea {
  width: 100%;
  margin-top: 0.4rem;
  margin-bottom: 0.7rem;
  border: 1px solid #d7c5ac;
  background: #fffdf9;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

button,
.button-link {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
  text-decoration: none;
  display: inline-block;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

button.secondary {
  background: #efe2cf;
  color: #5f4d3a;
}

button.danger {
  background: #b1302c;
}

button.danger:hover {
  background: #852320;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
}

.gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

#galleryPageInfo {
  min-width: 110px;
  text-align: center;
}

.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}

.admin-media-card .card-media {
  height: 160px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.card-media {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: #f4ece2;
}

.gallery-clickable {
  cursor: zoom-in;
}

.card-meta {
  padding: 0.6rem;
  font-size: 0.9rem;
}

.card-meta .name {
  display: block;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.status {
  color: var(--soft);
  min-height: 1.2em;
}

.upload-progress {
  margin-top: 0.7rem;
}

.upload-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #eadbc8;
  overflow: hidden;
  border: 1px solid #dbc6ad;
}

.upload-progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #b4512c, #d9763b);
  transition: width 120ms linear;
}

.camera-choice {
  margin-top: 0.7rem;
  border: 1px solid #d8c5ab;
  border-radius: 14px;
  padding: 0.7rem;
  background: #fff7ec;
}

.recorder-preview {
  width: 100%;
  max-height: 340px;
  border-radius: 12px;
  object-fit: cover;
  background: #111;
  margin-top: 0.45rem;
}

.video-recorder {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-recorder-preview {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  background: #000;
}

.video-recorder-top-overlay {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  display: flex;
  justify-content: center;
}

.video-recorder-metrics {
  background: rgba(18, 18, 18, 0.7);
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.video-recorder-bottom-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0 1rem;
}

.video-recorder-status {
  color: #f5eee5;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  text-align: center;
  margin: 0;
}

.video-quality-wrap {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
}

.video-quality-label {
  color: #f5eee5;
  font-size: 0.9rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.video-quality-select {
  min-width: 240px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(20, 20, 20, 0.6);
  color: #fff;
  padding: 0.55rem 0.9rem;
}

.video-recorder-main-btn,
.video-recorder-upload-btn,
.video-recorder-close-btn {
  min-width: 220px;
}

.video-recorder-close-btn {
  background: rgba(255, 255, 255, 0.24);
}

.video-recorder-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  border-radius: 999px;
  border: none;
  font-size: 2rem;
  color: #fff;
  background: rgba(20, 20, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-link {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  word-break: break-all;
}

.mt-8 {
  margin-top: 0.8rem;
}

.mt-7 {
  margin-top: 0.7rem;
}

.qr-image {
  max-width: 280px;
  width: 100%;
  border: 1px solid #e7dac7;
  border-radius: 12px;
  background: #fff;
}

.card-actions {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.home-page {
  max-width: 900px;
}

.home-steps {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
}

.home-steps li {
  margin-bottom: 0.45rem;
}

.fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(22, 18, 14, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.fullscreen-image {
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.45);
}

.fullscreen-close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  font-size: 1.9rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.2);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  text-align: center;
  font-size: 0.95rem;
  color: #6a5d52;
  margin: 1.5rem 0 0.3rem;
}

.footer-text {
  font-family: "Fraunces", serif;
  font-style: italic;
  white-space: nowrap;
}

.footer-line {
  width: min(90px, 18vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, #cba57e, transparent);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 0.8rem;
  }

  .hero {
    border-radius: 18px;
    padding: 1.4rem 1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
