:root {
  --bg: #0c0a12;
  --card: #17141f;
  --surface2: #1f1b29;
  --field: #0f0f0f;
  --border: rgba(255, 255, 255, 0.1);
  --border2: rgba(255, 255, 255, 0.15);
  --ink: #f0f0f0;
  --accent: #7c5cff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 92, 255, 0.18);
  --accent-grad: linear-gradient(135deg, #f472b6, #7c5cff);
  --danger: #e05252;
  --muted: rgba(255, 255, 255, 0.6);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  background: var(--accent-grad);
  flex-shrink: 0;
}

/* ---------- Shell dashboard : sidebar + topbar + contenu ---------- */
.app-shell { height: 100vh; display: flex; overflow: hidden; }
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.85rem;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sidebar-logo .brand-mark { width: 2rem; height: 2rem; border-radius: 0.55rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  border: none;
  border-radius: 0.6rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.sidebar-nav-item.active { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.sidebar-nav-item svg { flex-shrink: 0; }

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--border);
}
.app-content { flex: 1; overflow-y: auto; padding: 1.75rem 2.25rem 3.75rem; }
#screen-accueil { max-width: 760px; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-title { font-size: 0.95rem; font-weight: 700; }

/* ---------- Modal : wizard de création ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 10, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.modal-box {
  width: 520px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 0.9rem;
  padding: 1.5rem 1.6rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.modal-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.05rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; line-height: 1; }

/* ---------- Aperçu du mur (event réel en iframe) ---------- */
.mur-iframe {
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 400px;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #17313a;
}

header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 { font-size: 1.2rem; margin: 0; }
main { padding: 1.5rem; max-width: 720px; margin: 0 auto; }
.center-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
  padding: 1.5rem;
}
.btn {
  background: var(--accent-grad);
  color: var(--accent-ink);
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.btn-danger { background: var(--danger); color: #fff; }
input, select, textarea {
  background: #0f0f0f;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.35rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s ease;
  color-scheme: dark;
}
input[type="date"] { padding: 0.55rem 0.6rem; cursor: pointer; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.card {
  background: var(--card);
  border-radius: 0.6rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-title { margin: 0 0 1.1rem; font-size: 1.05rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-tile { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0; }
.stat-tile strong { font-size: 1.75rem; }
.muted { color: var(--muted); font-size: 0.85rem; }
.event-form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.8rem; font-weight: 600; opacity: 0.85; }
.field-hint { margin: 0.5rem 0 0; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}
.storage-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 480px) {
  .storage-options { grid-template-columns: 1fr; }
}
.storage-option {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: #0f0f0f;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.storage-option:hover { border-color: rgba(124, 92, 255, 0.4); }
.storage-option.selected { border-color: var(--accent); background: rgba(124, 92, 255, 0.1); }
.storage-option-title { font-size: 0.9rem; font-weight: 600; }
.storage-option-sub { font-size: 0.75rem; opacity: 0.65; }

.dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: 0.6rem;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: rgba(255, 255, 255, 0.02);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.06);
}
.dropzone-icon { font-size: 1.5rem; margin-bottom: 0.4rem; }
.dropzone-text { margin: 0; font-size: 0.85rem; color: var(--muted); }
.dropzone-text .dropzone-link { color: var(--accent); font-weight: 600; }
.dropzone-filename {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.dropzone-thumb {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: cover;
  border-radius: 0.35rem;
}

.qr-frame {
  background: #fff;
  padding: 0.5rem;
  border-radius: 0.6rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.qr-frame img.qr { width: 90px; height: 90px; display: block; }
.qr-frame a {
  font-size: 0.68rem;
  color: var(--ink-deep, #333);
  text-decoration: none;
  font-weight: 600;
}
.qr-frame a:hover { text-decoration: underline; }

.wizard-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.wizard-step-dot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}
.wizard-step-dot span {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: #0f0f0f;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}
.wizard-step-dot.active { color: var(--ink); }
.wizard-step-dot.active span { border-color: var(--accent); background: rgba(124, 92, 255, 0.18); }
.wizard-step-dot.done span { border-color: var(--accent); background: var(--accent); color: #fff; }
.wizard-panel { display: flex; flex-direction: column; gap: 1.1rem; }
.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.wizard-nav .btn:only-child { margin-left: auto; }
.event-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.photo-card {
  background: var(--card);
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
}
.photo-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.photo-meta {
  padding: 0.4rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  gap: 0.4rem;
}
.heart-flat {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0;
  flex-shrink: 0;
}
.heart-flat-liked { color: var(--danger); }
.heart-flat.heart-pulse { animation: heart-pulse 0.4s ease; }
.hidden { display: none !important; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.lightbox-img-wrap {
  position: relative;
  display: inline-flex;
  max-height: 78vh;
  max-width: 100%;
}
.lightbox-img-wrap #lightbox-heart {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
}
.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 0.4rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.1rem;
  cursor: pointer;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-meta {
  position: absolute;
  bottom: 1.25rem;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--paper, #f0f0f0);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.lightbox-meta a { color: var(--marigold, var(--accent)); }

/* ---------- Mur polaroid (page invité /e/:code) ---------- */
:root {
  --paper: #f3ecd9;
  --ink-deep: #0f2429;
  --marigold: #e8a93b;
  --raspberry: #c4425b;
  --sage: #7fa37a;
}
body.event-page {
  background: radial-gradient(ellipse at top, #17313a 0%, var(--ink-deep) 70%);
  font-family: "Quicksand", system-ui, sans-serif;
  color: var(--paper);
}
.event-header {
  text-align: center;
  padding: 3rem 1.25rem 1.5rem;
}
.event-banner {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  object-position: center;
  border-radius: 0.75rem;
  margin: 0 auto 1.5rem;
}
.event-banner-sm { max-height: 140px; margin-bottom: 1rem; }
.event-title-hand {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: clamp(2.4rem, 9vw, 4.5rem);
  margin: 0 auto;
  max-width: 44rem;
  line-height: 1.1;
}
.event-sub {
  max-width: 30rem;
  margin: 0.5rem auto 0;
  font-size: 0.875rem;
  opacity: 0.7;
}
.event-main { max-width: 64rem; margin: 0 auto; padding: 0 1rem 5rem; }
.upload-block {
  border: 2px dashed rgba(232, 169, 59, 0.5);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.upload-block input[type="text"] {
  width: 100%;
  max-width: 20rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: none;
  background: var(--paper);
  color: var(--ink-deep);
  font-family: inherit;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.upload-choices { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
body.event-page .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--marigold);
  color: var(--ink-deep);
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}
body.event-page .btn:hover { transform: translateY(-2px); }
body.event-page .btn-outline {
  background: transparent;
  color: var(--paper);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}
.corkboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2rem 1.25rem;
  padding: 1.5rem;
  border-radius: 1rem;
  background-image: radial-gradient(rgba(0, 0, 0, 0.18) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 22px 22px, 14px 14px;
  background-position: 0 0, 7px 7px;
}
.pin {
  position: relative;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.pin-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 3.5rem;
  height: 1.25rem;
  opacity: 0.9;
}
.pin-card {
  background: var(--paper);
  padding: 0.6rem 0.6rem 1rem;
  box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pin:hover .pin-card {
  transform: translateY(-4px);
  box-shadow: 0 16px 28px -10px rgba(0, 0, 0, 0.55);
}
.pin-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.1);
}
.pin-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin-caption {
  margin: 0.5rem 0 0;
  text-align: center;
  color: var(--ink-deep);
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pin-heart {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  background: rgba(15, 36, 41, 0.65);
  color: white;
  border: none;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.pin-heart-liked { background: var(--raspberry); }
.pin-heart:hover { transform: scale(1.08); }
.pin-heart.heart-pulse { animation: heart-pulse 0.4s ease; }
@keyframes heart-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.5); }
  100% { transform: scale(1); }
}
.heart-float {
  position: absolute;
  font-size: 2.2rem;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: heart-float 0.9s ease-out forwards;
  z-index: 5;
}
@keyframes heart-float {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  25% { opacity: 1; transform: translate(-50%, -70%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}
