/* NFC Gallery — bright, playful, minimal birthday styling. */

:root {
  --accent: #ff5da2;
  --ink: #2b2440;
  --bg: #fff8fb;
  --card: #ffffff;
  --soft-shadow: 0 10px 30px rgba(43, 36, 64, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 209, 102, 0.25), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(94, 198, 255, 0.22), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(255, 93, 162, 0.18), transparent 45%),
    var(--bg);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

/* ---------- Hero / cover ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(3rem, 10vw, 7rem) 1.25rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #7b5cff 55%, #5ec6ff);
}

.hero--photo {
  background-image:
    linear-gradient(rgba(33, 22, 52, 0.45), rgba(33, 22, 52, 0.55)),
    var(--hero-image);
  background-size: cover;
  background-position: center;
}

.hero__overlay {
  position: relative;
  z-index: 2;
  max-width: 40rem;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  opacity: 0.95;
}

.hero__title {
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}

.hero__description {
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  margin: 0 auto 1.75rem;
  max-width: 34rem;
  opacity: 0.97;
}

.hero__cta {
  display: inline-block;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  box-shadow: var(--soft-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero__cta:hover,
.hero__cta:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 32px rgba(43, 36, 64, 0.22);
}

/* Floating confetti dots in the hero. */
.hero__confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    radial-gradient(circle, #ffd166 0 6px, transparent 7px),
    radial-gradient(circle, #fff 0 4px, transparent 5px),
    radial-gradient(circle, #5ec6ff 0 5px, transparent 6px),
    radial-gradient(circle, #ff5da2 0 4px, transparent 5px);
  background-position: 8% 30%, 22% 70%, 78% 22%, 90% 65%;
  background-repeat: no-repeat;
  opacity: 0.55;
  pointer-events: none;
}

/* ---------- Photo grid ---------- */
.gallery {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem);
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  /* Mobile-first: 2 columns by default, growing on larger screens. */
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 960px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.grid__item {
  margin: 0;
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  box-shadow: var(--soft-shadow);
  aspect-ratio: 1 / 1;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: 0 18px 36px rgba(43, 36, 64, 0.22);
  outline: none;
}

.tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.2rem 0.75rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, rgba(20, 12, 35, 0.72));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.tile:hover .tile__caption,
.tile:focus-visible .tile__caption {
  opacity: 1;
  transform: translateY(0);
}

.empty {
  text-align: center;
  font-size: 1.2rem;
  padding: 3rem 1rem;
}

/* ---------- Message / fallback pages ---------- */
.message-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 6vw, 4rem);
}

.message-page__card {
  background: var(--card);
  border-radius: 1.25rem;
  box-shadow: var(--soft-shadow);
  padding: clamp(1.75rem, 5vw, 3rem);
  max-width: 32rem;
  text-align: center;
}

.message-page__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.message-page__body {
  margin: 0.75rem 0 0;
  color: #6b6280;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
  color: #8a809c;
  font-weight: 600;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(20, 12, 35, 0.86);
  backdrop-filter: blur(6px);
  animation: fade-in 0.18s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figure {
  margin: 0;
  max-width: min(92vw, 1000px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  background: #fff;
}

.lightbox__caption {
  color: #fff;
  margin-top: 0.9rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  min-height: 1.2em;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover,
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.06);
  outline: none;
}

.lightbox__close {
  top: clamp(0.75rem, 3vw, 1.5rem);
  right: clamp(0.75rem, 3vw, 1.5rem);
  width: 46px;
  height: 46px;
  font-size: 1.8rem;
  line-height: 1;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2rem;
  line-height: 1;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
  transform: translateY(-50%) scale(1.06);
}

.lightbox__nav--prev {
  left: clamp(0.5rem, 2vw, 1.5rem);
}

.lightbox__nav--next {
  right: clamp(0.5rem, 2vw, 1.5rem);
}

@media (max-width: 520px) {
  .lightbox__nav {
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* ===================================================================== */
/* Public gallery themes (basic "look" picker).                          */
/* ===================================================================== */
/* Festive is the default styling above; classic/minimal tweak the hero  */
/* and background so the choice is visible without a full redesign.       */
.theme-classic {
  --bg: #fbf7f1;
}
.theme-classic .hero {
  background: linear-gradient(135deg, var(--accent), #b07c4f 60%, #8a6d52);
}
.theme-classic .hero__title {
  font-family: Georgia, "Times New Roman", serif;
}
.theme-classic .hero__confetti {
  opacity: 0.2;
}

.theme-minimal {
  --bg: #ffffff;
  background: #ffffff;
}
.theme-minimal .hero {
  background: linear-gradient(135deg, #2b2440, #4b4566);
}
.theme-minimal .hero__confetti {
  display: none;
}
.theme-minimal .tile {
  border-radius: 8px;
}

/* ===================================================================== */
/* Customer dashboard + auth pages.                                      */
/* ===================================================================== */
.dash {
  background: var(--bg);
}

.dash__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  background: var(--card);
  box-shadow: var(--soft-shadow);
}

.dash__brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}

.dash__nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.dash__nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.dash__nav a:hover {
  color: var(--accent);
}

.link-button {
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-button:hover {
  color: var(--accent);
}

.dash__main {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.dash__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.dash__header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.dash__hint {
  margin: 0.25rem 0 0;
  color: #6b6280;
}

/* Flash messages */
.messages {
  list-style: none;
  max-width: 960px;
  margin: 1rem auto 0;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: grid;
  gap: 0.5rem;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: var(--soft-shadow);
  background: var(--card);
}

.message--success {
  background: #e8f8ef;
  color: #1c7a4b;
}

.message--error {
  background: #fdecef;
  color: #b22a4d;
}

/* Buttons */
.btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  background: #f1ecf7;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  box-shadow: inset 0 0 0 2px #e3dcef;
}

.btn--small {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.btn--danger {
  background: #fdecef;
  color: #b22a4d;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Gallery cards */
.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
  padding: 1.1rem 1.25rem;
}

.card__title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.card__meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: #6b6280;
  font-size: 0.9rem;
}

.card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #efeaf6;
  color: #5b5270;
}

.badge--active {
  background: #e8f8ef;
  color: #1c7a4b;
}

.badge--draft {
  background: #fff5e0;
  color: #9a6b00;
}

.badge--paused {
  background: #eef2ff;
  color: #3a4a9a;
}

.badge--archived {
  background: #f1eef0;
  color: #7a6470;
}

/* Per-gallery sub-nav */
.subnav {
  max-width: 960px;
  margin: 1rem auto 0;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.subnav__title {
  font-weight: 800;
  margin-right: 0.5rem;
}

.subnav__link {
  text-decoration: none;
  color: #6b6280;
  font-weight: 700;
  padding: 0.35rem 0.2rem;
  border-bottom: 3px solid transparent;
}

.subnav__link.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.subnav__link:hover {
  color: var(--accent);
}

/* Forms (settings + auth) */
.settings-form,
.auth-form {
  display: grid;
  gap: 1rem;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
  padding: clamp(1.25rem, 4vw, 2rem);
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 700;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="url"],
.field textarea,
.field select,
.auth-form input,
.upload-form input[type="text"],
.photo-admin__caption input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 2px solid #e3dcef;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}

.field input[type="color"] {
  width: 4rem;
  height: 2.5rem;
  padding: 0.2rem;
  border: 2px solid #e3dcef;
  border-radius: 10px;
}

.field__help {
  color: #8a809c;
  font-size: 0.85rem;
}

.req {
  color: var(--accent);
}

.form-error {
  color: #b22a4d;
  font-size: 0.88rem;
  font-weight: 600;
}

.settings-form__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Photo management */
.usage {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: #6b6280;
  font-weight: 600;
  margin-bottom: 1rem;
}

.upload-form {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.upload-form__hint {
  margin: 0 0 0.6rem;
  color: #8a809c;
  font-size: 0.9rem;
}

.upload-form__row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.upload-form__row input[type="text"] {
  flex: 1 1 12rem;
}

.photo-admin {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.photo-admin__item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--soft-shadow);
  padding: 0.85rem;
}

.photo-admin__thumb {
  position: relative;
  width: 96px;
  height: 96px;
}

.photo-admin__thumb img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
}

.cover-flag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
}

.photo-admin__caption {
  display: grid;
  gap: 0.4rem;
}

.photo-admin__actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
}

.photo-admin__actions form {
  display: flex;
  gap: 0.3rem;
}

@media (max-width: 640px) {
  .photo-admin__item {
    grid-template-columns: 1fr;
  }
}

/* Auth cards */
.auth-card {
  text-align: left;
}

.auth-card .message-page__title {
  text-align: center;
}

.auth-links {
  text-align: center;
  margin-top: 1rem;
}

.auth-links a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

/* Account page */
.account {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.25rem;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
  padding: 1.25rem 1.5rem;
  max-width: 480px;
}

.account dt {
  font-weight: 700;
  color: #6b6280;
}

.account dd {
  margin: 0;
}

.account__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
}
