:root {
  --cream: #f8f2e8;
  --beige: #efe3d3;
  --forest: #274235;
  --gold: #b8914c;
  --ink: #1f1f1f;
  --card: #fffdf9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
  background: radial-gradient(circle at top, #fff, var(--cream));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  font-family: "Playfair Display", serif;
  margin-top: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(39, 66, 53, 0.12);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
}

.brand {
  color: var(--forest);
  text-decoration: none;
  font-size: 2rem;
  font-weight: 700;
  font-family: "Playfair Display", serif;
  letter-spacing: 0.01em;
}

.host {
  color: rgba(31, 31, 31, 0.7);
  font-size: 0.82rem;
}

.toolbar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.container {
  width: min(1120px, 92vw);
  margin: 1.25rem auto 2.4rem;
  flex: 1;
}

.hero-banner {
  min-height: 72vh;
  border-radius: 24px;
  margin-bottom: 1.2rem;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
  background-image:
    linear-gradient(to top, rgba(20, 30, 22, 0.72), rgba(20, 30, 22, 0.2)),
    var(--hero-image);
  background-size: cover;
  background-position: center 28%;
  box-shadow: 0 14px 38px rgba(39, 66, 53, 0.18);
}

.hero-overlay {
  width: 100%;
  padding: 1.1rem;
  color: #fff;
}

.hero-kicker {
  margin: 0 0 0.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  opacity: 0.9;
}

.hero-cta {
  margin-top: 0.6rem;
}

.card {
  background: var(--card);
  border: 1px solid rgba(39, 66, 53, 0.1);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(39, 66, 53, 0.09);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.hero {
  background:
    radial-gradient(circle at 12% 16%, rgba(184, 145, 76, 0.16), transparent 44%),
    linear-gradient(145deg, #fff, var(--beige));
}

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

.link-card {
  color: var(--forest);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.dashboard-grid.is-ready .dashboard-link-card {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
}

.dashboard-grid.is-ready.is-animated .dashboard-link-card {
  animation: dashboard-card-in 460ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: var(--stagger-delay, 0ms);
}

@keyframes dashboard-card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dashboard-link-card {
  min-height: 140px;
  aspect-ratio: 1 / 1;
  font-size: 1.14rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 1rem;
  position: relative;
  background: #fffdf9;
  border: 1px solid rgba(39, 66, 53, 0.11);
  letter-spacing: 0.01em;
  box-shadow: 0 8px 22px rgba(39, 66, 53, 0.09);
  will-change: transform, opacity, filter;
}

.link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 30px rgba(39, 66, 53, 0.15);
}

.link-card:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 14px 30px rgba(39, 66, 53, 0.15);
}

.form-card {
  max-width: 560px;
}

.login-layout {
  display: grid;
  gap: 1rem;
}

.login-layout .hero h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.05rem, 4.1vw, 3.4rem);
  line-height: 1.04;
}

.login-layout .hero p {
  margin: 0;
  font-size: 1.16rem;
  color: rgba(31, 31, 31, 0.9);
}

.form-grid {
  display: grid;
  gap: 0.8rem;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  margin-top: 0.25rem;
  border: 1px solid #d9ceb9;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus {
  outline: none;
  border-color: rgba(184, 145, 76, 0.88);
  box-shadow: 0 0 0 3px rgba(184, 145, 76, 0.18);
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.member-card {
  border: 1px solid rgba(39, 66, 53, 0.14);
  border-radius: 14px;
  padding: 0.9rem;
  background: #fff;
}

.member-name {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
}

.member-choice-row {
  display: grid;
  gap: 0.5rem;
}

.member-age-wrap {
  display: none;
  margin-top: 0.5rem;
}

.member-age-wrap.is-visible {
  display: grid;
}

.member-age-wrap small {
  color: rgba(31, 31, 31, 0.68);
}

.upload-card {
  max-width: 760px;
  margin-inline: auto;
}

.upload-intro {
  margin-top: -0.15rem;
  margin-bottom: 0.3rem;
  color: rgba(31, 31, 31, 0.82);
}

.upload-picker {
  display: grid;
  gap: 0.25rem;
  border: 1px dashed rgba(39, 66, 53, 0.35);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.upload-picker:hover {
  border-color: rgba(39, 66, 53, 0.55);
  background: #fff;
}

.upload-picker:focus-within {
  border-color: rgba(184, 145, 76, 0.88);
  box-shadow: 0 0 0 3px rgba(184, 145, 76, 0.18);
}

.upload-picker-title {
  font-weight: 700;
}

.upload-picker-subtitle {
  color: rgba(31, 31, 31, 0.66);
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-hint {
  margin: -0.2rem 0 0.1rem;
  color: rgba(31, 31, 31, 0.72);
  font-size: 0.92rem;
}

#extra-file-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.extra-file-input {
  display: grid;
}

.upload-add-wrap {
  display: grid;
}

.upload-add-wrap.is-hidden {
  display: none;
}

.upload-count {
  margin: 0.2rem 0 0;
  font-weight: 600;
}

.upload-ready {
  margin: -0.2rem 0 0;
  color: rgba(39, 66, 53, 0.88);
  font-weight: 600;
  display: none;
}

.upload-ready.is-visible {
  display: block;
}

.upload-file-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(31, 31, 31, 0.82);
  max-height: 10rem;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.upload-file-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  border: 1px solid rgba(39, 66, 53, 0.2);
  border-radius: 999px;
  padding: 0.32rem 0.68rem;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
}

.upload-file-remove {
  border: 0;
  background: transparent;
  color: rgba(39, 66, 53, 0.82);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  color: #fff;
  background: var(--forest);
  text-decoration: none;
  transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(39, 66, 53, 0.2);
}

.btn:disabled {
  cursor: not-allowed;
  background: rgba(39, 66, 53, 0.45);
  box-shadow: none;
  transform: none;
  filter: none;
}

.btn-ghost {
  color: var(--forest);
  background: transparent;
  border: 1px solid rgba(39, 66, 53, 0.2);
}

.form-grid .btn {
  width: 100%;
}

.topbar .btn-ghost {
  border-radius: 999px;
  padding: 0.42rem 0.78rem;
  font-size: 0.98rem;
  font-weight: 600;
  min-height: 2.35rem;
}

.toolbar-nav-btn {
  width: 2.35rem;
  padding: 0;
  flex: 0 0 2.35rem;
}

.toolbar-nav-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
}

.toolbar-session-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: nowrap;
}

.toolbar-timer {
  position: relative;
}

.toolbar-timer-btn {
  width: 2.35rem;
  padding: 0;
  flex: 0 0 2.35rem;
}

.toolbar-timer-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
}

.toolbar-timer-popover {
  position: absolute;
  top: calc(100% + 0.38rem);
  right: 0;
  min-width: 12.4rem;
  padding: 0.62rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(39, 66, 53, 0.14);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 26px rgba(39, 66, 53, 0.14);
  z-index: 25;
}

.toolbar-timer-label {
  margin: 0 0 0.35rem;
  color: rgba(31, 31, 31, 0.72);
  font-size: 0.76rem;
}

.toolbar-timer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.38rem;
}

.toolbar-timer-unit {
  background: rgba(39, 66, 53, 0.045);
  border: 1px solid rgba(39, 66, 53, 0.09);
  border-radius: 10px;
  padding: 0.38rem 0.18rem 0.3rem;
  display: grid;
  justify-items: center;
}

.toolbar-timer-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--forest);
  line-height: 1.05;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.toolbar-timer-value.is-updated {
  animation: countdown-pop 220ms ease;
}

.toolbar-timer-unit-label {
  margin-top: 0.1rem;
  color: rgba(31, 31, 31, 0.62);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.toolbar-timer-subline {
  margin: 0.42rem 0 0;
  color: rgba(31, 31, 31, 0.74);
  font-size: 0.74rem;
}

@keyframes countdown-pop {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  35% {
    transform: translateY(-2px);
    opacity: 0.75;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.flash {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: #f2f7f3;
  border: 1px solid rgba(39, 66, 53, 0.2);
}

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

.gallery-item {
  margin: 0;
}

.gallery-card {
  background: #fff;
  border: 1px solid rgba(39, 66, 53, 0.12);
  border-radius: 14px;
  padding: 0.6rem;
  box-shadow: 0 6px 20px rgba(39, 66, 53, 0.08);
}

.gallery-media {
  position: relative;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.gallery-item figcaption {
  margin-top: 0.55rem;
  margin-bottom: 0.55rem;
}

.gallery-delete-form {
  margin: 0;
}

.btn-danger {
  background: #8a2f2f;
}

.gallery-delete-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(138, 47, 47, 0.92);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-delete-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.gallery-delete-btn:hover {
  background: #7b2727;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.88);
  padding: 1rem;
}

.lightbox.is-open {
  display: grid;
}

.lightbox-image {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1200px);
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  touch-action: pan-y;
}

.lightbox-close,
.lightbox-download,
.lightbox-nav {
  position: absolute;
  z-index: 3;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-close,
.lightbox-download {
  top: 1rem;
  width: 2.4rem;
  height: 2.4rem;
}

.lightbox-close {
  right: 1rem;
  font-size: 1.7rem;
  line-height: 1;
}

.lightbox-counter {
  position: absolute;
  z-index: 3;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.6);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.lightbox-download {
  right: 4rem;
}

.lightbox-download svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.8rem;
  height: 2.8rem;
  font-size: 2rem;
  line-height: 1;
  opacity: 1;
  transition: opacity 420ms ease, background-color 220ms ease;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-controls-hidden .lightbox-nav {
  opacity: 0;
  pointer-events: none;
  transition-delay: 120ms;
}

.lightbox-close:hover,
.lightbox-download:hover,
.lightbox-nav:hover {
  background: rgba(20, 20, 20, 0.82);
}

.lightbox-image.is-fading {
  animation: lightbox-fade 220ms ease;
}

@keyframes lightbox-fade {
  from {
    opacity: 0.6;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.no-scroll {
  overflow: hidden;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.stat-card h2 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.stat-card p {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--forest);
}

.table-wrap {
  overflow-x: auto;
}

.guest-table {
  width: 100%;
  border-collapse: collapse;
}

.guest-table th,
.guest-table td {
  text-align: left;
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid rgba(39, 66, 53, 0.12);
}

.guest-table th {
  font-weight: 600;
}

.map-wrap iframe {
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 12px;
  margin: 0.8rem 0;
}

.map-consent {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1px solid rgba(39, 66, 53, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.map-consent p {
  margin: 0;
}

.map-preview {
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 0;
  border: 1px solid rgba(39, 66, 53, 0.16);
  border-radius: 12px;
  cursor: pointer;
  background-color: rgba(221, 230, 225, 0.95);
  background-image:
    linear-gradient(180deg, rgba(28, 45, 37, 0.22), rgba(28, 45, 37, 0.22)),
    var(--map-preview-image);
  background-size: contain;
  background-position: top left;
  background-repeat: no-repeat;
  display: grid;
  place-items: center;
  padding: 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.map-preview:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(39, 66, 53, 0.14);
  filter: brightness(1.02);
}

.map-preview-overlay {
  font-weight: 700;
  color: #fff;
  background: rgba(39, 66, 53, 0.9);
  border-radius: 999px;
  padding: 0.48rem 0.82rem;
}

.map-embed-target:not(:empty) {
  margin-top: 0.2rem;
}

.location-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.55rem;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.location-actions .btn {
  width: auto;
  min-width: 0;
  white-space: nowrap;
  justify-content: center;
  padding: 0.58rem 0.88rem;
  font-size: 0.98rem;
}

@media (max-width: 640px) {
  .toolbar-timer-popover {
    right: -0.1rem;
    min-width: 11.5rem;
    padding: 0.5rem 0.6rem;
  }

  .toolbar-timer-value {
    font-size: 0.9rem;
  }

  .location-actions {
    justify-content: flex-start;
  }

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

  .dashboard-link-card {
    min-height: 0;
    font-size: 1.08rem;
  }
}

@media (max-width: 380px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-link-card {
    min-height: 118px;
    aspect-ratio: auto;
  }
}

.site-footer {
  border-top: 1px solid rgba(39, 66, 53, 0.12);
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(4px);
  padding: 0.72rem 1rem;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}

.site-footer a {
  color: rgba(39, 66, 53, 0.85);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

.legal-card h2 {
  margin-top: 1.2rem;
}

@media (min-width: 768px) {
  .hero-overlay {
    max-width: 54ch;
    padding: 2rem;
  }

  .hero-banner {
    min-height: 78vh;
    background-position: center 24%;
  }
}

@media (max-width: 640px) {
  .brand {
    font-size: 1.72rem;
  }
}

@media (min-width: 1024px) {
  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(420px, 1.2fr);
    align-items: start;
    min-height: min(74vh, 780px);
    align-content: center;
    margin-top: 0.4rem;
  }

  .login-layout .card {
    margin-bottom: 0;
  }

  .login-layout .hero {
    min-height: 88%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.2rem;
  }

  .login-layout .form-card {
    max-width: none;
    padding: 1.5rem;
  }
}
