*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #CE1432;
  --red-dark: #a10f28;
  --red-tint: #fdecec;
  --bg: #ffffff;
  --card: #ffffff;
  --text: #5A5A5C;
  --text-light: #6b6b6e;
  --border: #D2D3D4;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 0.75rem;
  --font: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
}

body {
  font-family: var(--font);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) 3.75rem;
}

.step { display: none; }
.step.active { display: block; }

/* cards */
.card, .upload-zone, .review-item, .photo-card, .login-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* brand */
.brand { text-align: center; margin-bottom: var(--space-lg); }
.brand-logo { width: 100%; max-width: 11.25rem; height: auto; }
.tagline { color: var(--text-light); margin-top: var(--space-md); }

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

.consent {
  padding: 0 1.25rem;
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  border-left: 3px solid var(--red);
  border-radius: 0;
  box-shadow: none;
  font-style: italic;
}

/* buttons */
.btn {
  display: inline-block;
  min-height: 2.75rem;
  padding: var(--space-sm) 1.75rem;
  border: none;
  border-radius: 0.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, opacity 0.2s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #bcbdbf; }
.btn-small { min-height: 2.75rem; padding: var(--space-xs) var(--space-md); font-size: 0.85rem; border-radius: 0.375rem; }

/* focus visibility (keyboard navigation) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.upload-zone:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: var(--space-lg);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--red);
  background: var(--red-tint);
}
.upload-zone input[type="file"] { display: none; }
.upload-placeholder .icon { font-size: 3rem; color: var(--red); line-height: 1; }
.upload-placeholder p { margin-top: var(--space-sm); color: var(--text-light); }
.upload-placeholder .small { font-size: 0.85rem; }

/* preview grid */
.preview-grid, .review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.preview-item, .review-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.preview-item img, .review-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.remove-btn {
  position: absolute;
  top: var(--space-xs); right: var(--space-xs);
  width: 2.75rem; height: 2.75rem;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* progress */
.progress-bar-wrap { margin: var(--space-lg) 0; }
.progress-bar {
  height: 0.5rem;
  background: var(--border);
  border-radius: 0.25rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 0.3s;
}
#progressText { text-align: center; margin-top: var(--space-sm); color: var(--text-light); font-size: 0.85rem; }

/* form */
.form-group { margin-bottom: var(--space-md); }
.form-group label { display: block; font-weight: 700; margin-bottom: var(--space-xs); font-size: 0.95rem; }
.form-group .optional { font-weight: 400; color: var(--text-light); font-size: 0.85rem; }
.form-group input {
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-sm) 0.875rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-family: var(--font);
  font-size: 1rem;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--red); }

.step-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-top: var(--space-lg);
}

/* done */
.done-message { text-align: center; padding: var(--space-xl) var(--space-md); }
.done-message .icon-check {
  display: inline-block;
  width: 4rem; height: 4rem;
  line-height: 4rem;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 2rem;
  margin-bottom: var(--space-md);
}
.done-message h2 { margin-bottom: var(--space-sm); }
.done-message p { color: var(--text-light); margin-bottom: var(--space-lg); }

/* hints */
.hint { color: var(--text-light); margin-bottom: var(--space-md); }

/* === LOGIN === */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-md);
}
.login-box {
  max-width: 400px;
  width: 100%;
  padding: 2.5rem 2rem;
  text-align: center;
}
.login-box h1 { color: var(--red); font-size: 1.5rem; }
.login-box .subtitle { font-size: 1.1rem; margin: var(--space-xs) 0 var(--space-md); font-weight: 700; }
.login-box .desc { color: var(--text-light); }
.login-box .hint { font-size: 0.8rem; margin-top: var(--space-md); }

/* === ADMIN === */
.admin-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) var(--space-lg);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-inner h1 { font-size: 1.2rem; color: var(--red); }
.header-inner nav { display: flex; align-items: center; gap: var(--space-sm); }

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.date-nav h2 { font-size: 1.15rem; }

.session-stats { margin-bottom: var(--space-md); color: var(--text-light); font-size: 0.9rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-sm);
}
.photo-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  transition: transform 0.2s;
}
.photo-card:hover { transform: scale(1.02); }
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  padding: var(--space-sm) 0.625rem;
  color: #fff;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.photo-card:hover .photo-overlay { opacity: 1; }

.empty-state { text-align: center; padding: var(--space-2xl) var(--space-md); color: var(--text-light); }

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-md);
}
.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.25rem;
}
.lightbox-close {
  position: absolute;
  top: var(--space-md); right: var(--space-lg);
  width: 2.75rem; height: 2.75rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 101;
  line-height: 1;
}
.lightbox-download {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  border: none;
  min-height: 2.75rem;
  padding: var(--space-sm) 1.75rem;
  border-radius: 0.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  z-index: 101;
}
.lightbox-download:hover { background: var(--red-dark); }

.no-scroll { overflow: hidden; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* responsive */
@media (max-width: 480px) {
  .container { padding: var(--space-md) 0.75rem 2.5rem; }
  .preview-grid, .review-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .date-nav h2 { font-size: 1rem; }
  .admin-main { padding: var(--space-md); }
}
