/* InnoBooth Gallery — modern responsive UI */
:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --text: #0f172a;
  --text-muted: #64748b;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  /* Standaard = migratie appearance_primary_color; body zet --accent vaak opnieuw via inline style */
  --accent: #2563eb;
  --accent-hover: color-mix(in srgb, var(--accent) 82%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --success: #059669;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --gallery-accent: #2563eb;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface-2);
  min-height: 100vh;
  /* Hover/focus-tinten volgen dynamische --accent (inline op body) */
  --accent-hover: color-mix(in srgb, var(--accent) 82%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ——— Install & auth full-bleed scenes ——— */
body.is-install,
body.page-auth {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 55%),
    radial-gradient(900px 500px at 100% 20%, rgba(14, 165, 233, 0.18), transparent 50%),
    linear-gradient(165deg, #0f172a 0%, #1e1b4b 45%, #312e81 100%);
  color: #e2e8f0;
}

.install-scene,
.auth-scene {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  padding-bottom: 3rem;
}

.install-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  color: #fff;
}

.install-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 58%, #fff), var(--accent));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: var(--shadow-lg);
}

.install-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
}

.install-brand span {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.install-brand small {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 0.1rem;
}

.install-card,
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 480px) {
  .install-card,
  .auth-card {
    padding: 2.25rem 2rem;
  }
}

.install-card h1,
.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.install-lead {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.install-lead code {
  font-size: 0.8em;
}

.stepper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.stepper-step {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background var(--transition);
}

.stepper-step.is-active {
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 58%, #fff));
}

.stepper-step.is-done {
  background: var(--accent);
}

/* ——— Forms ——— */
.form-grid {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 520px) {
  .form-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.field label,
label.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

.field input,
.field textarea,
.field select,
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
textarea {
  width: 100%;
  max-width: none;
  padding: 0.65rem 0.85rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:hover,
textarea:hover {
  border-color: #cbd5e1;
}

.field input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="color"] {
  height: 44px;
  padding: 0.2rem;
  cursor: pointer;
}

input[type="file"] {
  width: 100%;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  background: var(--accent);
  color: #fff !important;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), transform 0.15s ease, box-shadow var(--transition);
}

.btn:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: scale(0.98);
}

.btn.secondary {
  background: #64748b;
}

.btn.secondary:hover {
  background: #475569;
}

.btn.ghost {
  background: transparent;
  color: var(--accent) !important;
  box-shadow: none;
  border: 1px solid var(--border);
}

.btn.ghost:hover {
  background: var(--surface-2);
}

.link-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
}

.link-btn:hover {
  color: #b91c1c;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.alert-error {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.err { color: var(--danger); }
.ok { color: var(--success); }

code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ——— Public home ——— */
body.public:not(.is-install):not(.page-auth) {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.public-main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero p {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* ——— Admin shell ——— */
body.admin {
  background: var(--surface-2);
}

.admin-app {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .admin-app {
    grid-template-columns: 260px 1fr;
  }
}

.admin-sidebar {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

@media (min-width: 900px) {
  .admin-sidebar {
    min-height: 100vh;
    padding: 1.5rem 1.25rem;
  }
}

.admin-brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
  color: inherit;
}

.admin-brand-tagline {
  margin: 0;
  padding: 0 0.5rem 0.15rem;
  font-size: 0.65rem;
  line-height: 1.35;
  color: #94a3b8;
  text-align: right;
  font-weight: 400;
}

.admin-brand-tagline strong {
  font-weight: 700;
  color: #e2e8f0;
}

.admin-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 58%, #fff), var(--accent));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.admin-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.admin-brand-text {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.admin-brand-text small {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.65;
}

.admin-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  border: none;
}

@media (min-width: 900px) {
  .admin-nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }
}

.admin-nav a {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-nav a.is-active {
  background: color-mix(in srgb, var(--accent) 38%, transparent);
  color: #fff;
}

.admin-sidebar-spacer { flex: 1; min-height: 0.5rem; }

.admin-nav-logout {
  margin-top: auto;
}

.admin-nav-logout a {
  color: #f87171;
}

.admin-nav-logout a:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.admin-main {
  padding: 1.25rem 1.25rem 3rem;
  max-width: min(1100px, 100%);
  width: 100%;
}

@media (min-width: 640px) {
  .admin-main {
    padding: 2rem 2rem 3rem;
  }
}

.admin-main:has(.admin-page-full) {
  max-width: none;
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.form-section {
  margin-bottom: 1.75rem;
}

.form-section:last-child {
  margin-bottom: 0;
}

.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9rem;
}

.tbl th,
.tbl td {
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
  text-align: left;
}

.tbl th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface-2);
}

.tbl tbody tr:hover {
  background: #fafafa;
}

.tbl tbody tr:last-child td {
  border-bottom: none;
}

/* Tablet & phone: table → labeled card grid (events + audit) */
@media (max-width: 1024px) {
  .tbl-wrap--responsive {
    overflow: visible;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  .tbl--responsive-cards {
    display: block;
    border-collapse: separate;
    border-spacing: 0;
  }

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

  .tbl--responsive-cards tbody {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .tbl--responsive-cards tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0;
  }

  .tbl--responsive-cards tbody tr:hover {
    background: var(--surface);
  }

  .tbl--responsive-cards td {
    display: block;
    padding: 0;
    border: none;
    font-size: 0.88rem;
    vertical-align: top;
  }

  .tbl--responsive-cards td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
  }

  .tbl--responsive-cards td.tbl-card-actions {
    padding-top: 0.65rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
  }

  .tbl--responsive-cards td.tbl-card-text code {
    word-break: break-word;
    font-size: 0.78rem;
  }

  .tbl--responsive-cards .tbl-cell-license {
    max-width: none;
  }

  .tbl--responsive-cards .tbl-cell-license code {
    font-size: 0.78rem;
  }
}

.tbl .tbl-cell-meta {
  word-break: break-word;
  font-size: 0.8rem;
  vertical-align: top;
}

.tbl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.tbl-actions a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.tbl-actions a:hover {
  text-decoration: underline;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.toolbar-events {
  justify-content: space-between;
}

.toolbar-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.events-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex: 1 1 16rem;
  justify-content: flex-end;
}

.events-search-input {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 22rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.tbl .tbl-cell-license {
  font-size: 0.8rem;
  word-break: break-word;
  max-width: 14rem;
  vertical-align: top;
}

.tbl .tbl-cell-license code {
  font-size: 0.78rem;
}

/* ——— Gallery (public) ——— */
body.gallery-body {
  background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 50%, #fafafa 100%);
  color: var(--text);
}

.gallery-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

@media (min-width: 640px) {
  .gallery-shell {
    padding: 0 1.5rem 4rem;
  }
}

.gallery-top {
  padding: 1.25rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.gallery-hero .gallery-hero__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.35rem;
  width: 100%;
}

.gallery-hero__logo-wrap {
  flex: 0 1 auto;
  min-width: 0;
  line-height: 0;
}

.gallery-hero__title {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--gallery-accent);
  flex: 1 1 12rem;
  min-width: 0;
  line-height: 1.2;
}

@media (max-width: 720px) {
  .gallery-hero__logo-wrap {
    flex: 1 1 100%;
  }
}

.gallery-page-head {
  margin-bottom: 1.5rem;
}

.gallery-page-head .quota {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gallery-page-head .gallery-actions {
  margin: 0;
}

.gallery-logo {
  width: auto;
  object-fit: contain;
}

.gallery-logo--large {
  max-height: 4.5rem;
  max-width: min(100%, 20rem);
  height: auto;
}

.gallery-logo--square {
  max-height: 52px;
  max-width: 10rem;
}

.gallery-actions {
  margin: 0;
}

.gallery-actions .btn {
  white-space: nowrap;
}

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

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}

.gallery-grid .thumb {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
 background: #e4e4e7;
}

.gallery-grid .thumb:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.gallery-grid .thumb:focus-visible {
  outline: 2px solid var(--gallery-accent);
  outline-offset: 2px;
}

.gallery-grid .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.gallery-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

.item-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
  transition: color var(--transition);
}

.item-page .back-link:hover {
  color: var(--gallery-accent);
}

.item-page h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.item-full {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: #000;
  line-height: 0;
}

.item-full img {
  width: 100%;
  height: auto;
  display: block;
  max-height: min(85vh, 900px);
  object-fit: contain;
  margin: 0 auto;
}

.item-actions {
  margin-top: 1.25rem;
}

.gallery-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.gallery-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  z-index: 10000;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.85rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  color: #f8fafc;
  background: #0f172a;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease;
  opacity: 0;
  pointer-events: none;
}

.gallery-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-toast {
    transition-duration: 0.01ms;
  }
}

hr.soft {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.site-footer-legal {
  margin-top: auto;
  padding: 1.25rem 1rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.55;
}

.site-footer-legal p {
  margin: 0;
}

.site-footer-legal a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer-legal a:hover {
  color: var(--accent);
}

body.is-install .site-footer-legal,
body.page-auth .site-footer-legal {
  color: rgba(226, 232, 240, 0.78);
}

body.is-install .site-footer-legal a,
body.page-auth .site-footer-legal a {
  color: color-mix(in srgb, var(--accent) 72%, #fff);
}

body.is-install .site-footer-legal a:hover,
body.page-auth .site-footer-legal a:hover {
  color: color-mix(in srgb, var(--accent) 52%, #fff);
}

.token-banner {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, #fff), color-mix(in srgb, var(--accent) 16%, #f8fafc));
  border: 1px solid color-mix(in srgb, var(--accent) 32%, #e2e8f0);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.token-banner code {
  word-break: break-all;
  display: inline-block;
  margin-top: 0.35rem;
 background: var(--surface);
}
