/* Zappit guest client: mobile first, light lavender surface with indigo accents (see docs/mockups). */
:root {
  --z-bg: #f4f2fb;
  --z-surface: #ffffff;
  --z-text: #1d1b2f;
  --z-muted: #5d5a73;
  --z-primary: #4f46e5;
  --z-primary-strong: #3730a3;
  --z-primary-soft: #e7e5fb;
  --z-danger: #b42318;
  --z-danger-soft: #fdecea;
  --z-success: #0f7b4f;
  --z-warning: #8a5a00;
  --z-warning-soft: #fff4dc;
  --z-border: #dcd8ef;
  --z-radius: 16px;
  --z-radius-small: 10px;
  --z-shadow: 0 2px 10px rgba(39, 31, 102, 0.08);
  --z-gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --z-bg: #14121f;
    --z-surface: #1f1c2e;
    --z-text: #f1effa;
    --z-muted: #b3afc9;
    --z-primary: #8b85ff;
    --z-primary-strong: #b5b1ff;
    --z-primary-soft: #2c2850;
    --z-danger: #ff8a80;
    --z-danger-soft: #3a1f22;
    --z-success: #5fd3a0;
    --z-warning: #ffcf70;
    --z-warning-soft: #3a3018;
    --z-border: #36324d;
    --z-shadow: none;
    color-scheme: dark;
  }
}

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

html, body {
  margin: 0;
  background: var(--z-bg);
  color: var(--z-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--z-primary); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0.25rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
h1:focus { outline: none; }

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

.guest-shell { min-height: 100vh; display: flex; flex-direction: column; }
.guest-header { padding: 12px var(--z-gutter); }
.wordmark { font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; color: var(--z-primary); text-decoration: none; }
.guest-main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 0 var(--z-gutter) 96px; }

.guest-nav {
  position: fixed; inset: auto 0 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--z-surface); border-top: 1px solid var(--z-border);
  padding-bottom: env(safe-area-inset-bottom);
}
.guest-nav-item { padding: 12px 4px; text-align: center; color: var(--z-muted); text-decoration: none; font-size: 0.9rem; }
.guest-nav-item.active { color: var(--z-primary); font-weight: 700; }

.event-header { margin: 8px 0 16px; }
.event-title { margin: 0; color: var(--z-muted); font-size: 0.95rem; }
.event-greeting { margin: 0; font-weight: 700; font-size: 1.2rem; }

.card {
  background: var(--z-surface); border: 1px solid var(--z-border);
  border-radius: var(--z-radius); box-shadow: var(--z-shadow);
  padding: 16px; margin: 0 0 16px;
}

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid transparent; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.button.primary { background: var(--z-primary); color: #fff; }
.button.secondary { background: transparent; color: var(--z-primary); border-color: var(--z-primary); }
.button.danger { background: var(--z-danger); color: #fff; }
.button.small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.button.wide { width: 100%; margin: 8px 0; }
.button:disabled, .button.disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.button:focus-visible, input:focus-visible, .filter:focus-visible { outline: 3px solid var(--z-primary-strong); outline-offset: 2px; }
.picker { position: relative; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

label { display: block; font-weight: 600; margin: 0 0 6px; }
input:not([type]), input[type="text"], input[id] {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--z-border); border-radius: var(--z-radius-small);
  background: var(--z-surface); color: var(--z-text); font: inherit;
}
input[aria-invalid="true"] { border-color: var(--z-danger); }
.field-error { color: var(--z-danger); margin: 6px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 12px 0; }
.check input { width: 20px; height: 20px; min-height: 0; }

.hint { color: var(--z-muted); font-size: 0.9rem; }
.empty-state { text-align: center; color: var(--z-muted); margin: 24px 0; }
.back { display: inline-block; margin: 8px 0 16px; }
.count { color: var(--z-muted); margin: 0 0 8px; }

.notice { border-radius: var(--z-radius-small); padding: 12px 14px; margin: 0 0 16px; }
.notice p { margin: 0 0 4px; }
.notice-problem { background: var(--z-danger-soft); }
.notice-offline, .notice-busy, .notice-auth { background: var(--z-warning-soft); color: var(--z-text); }
.support-id { font-size: 0.85rem; color: var(--z-muted); }

.loading { min-height: 120px; }
.skeleton {
  display: block; height: 120px; border-radius: var(--z-radius);
  background: linear-gradient(90deg, var(--z-primary-soft), var(--z-surface), var(--z-primary-soft));
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

.progress { display: grid; gap: 4px; margin: 8px 0; }
.progress progress { width: 100%; height: 8px; accent-color: var(--z-primary); }
.progress-text { font-size: 0.85rem; color: var(--z-muted); }

.queue-summary .queue-count { font-size: 1.2rem; font-weight: 700; margin: 0; }
.queue-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.queue-item {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  background: var(--z-surface); border: 1px solid var(--z-border);
  border-radius: var(--z-radius); padding: 12px;
}
.thumb { width: 64px; height: 64px; border-radius: var(--z-radius-small); object-fit: cover; background: var(--z-primary-soft); display: block; }
.file-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--z-primary-soft); color: var(--z-primary-strong); font-size: 0.8rem; font-weight: 600;
}
.status-received .chip { color: var(--z-success); }
.status-rejected .chip, .status-failed .chip, .status-expired .chip { background: var(--z-danger-soft); color: var(--z-danger); }
.status-paused .chip, .status-needsfile .chip { background: var(--z-warning-soft); color: var(--z-warning); }
.item-error { color: var(--z-danger); font-size: 0.9rem; margin: 4px 0 0; }

.filters { display: flex; gap: 8px; margin: 0 0 12px; overflow-x: auto; }
.filter {
  min-height: 36px; padding: 6px 14px; border-radius: 999px; font: inherit;
  border: 1px solid var(--z-border); background: var(--z-surface); color: var(--z-text); cursor: pointer;
}
.filter.active { background: var(--z-primary); border-color: var(--z-primary); color: #fff; }

.media-grid { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 480px) { .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.media-card a { position: relative; display: block; color: inherit; text-decoration: none; }
.media-card .file-name { font-size: 0.8rem; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-thumbnail { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--z-radius-small); }
.media-placeholder { display: block; aspect-ratio: 1; border-radius: var(--z-radius-small); background: var(--z-primary-soft); }
.media-placeholder.large { aspect-ratio: auto; min-height: 200px; display: grid; place-items: center; padding: 24px; text-align: center; }
.media-card .badge, .media-card .chip { position: absolute; left: 6px; top: 6px; }
.media-card .badge { background: rgba(0, 0, 0, 0.6); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; }
.media-card.video .chip { top: 32px; }

.media-viewer { margin: 0 0 16px; }
.media-viewer img, .media-viewer video { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--z-radius); background: #000; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0 0 16px; }
.facts dt { color: var(--z-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.recovery-code {
  display: block; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 1.15rem;
  letter-spacing: 0.06em; padding: 12px; margin: 12px 0; border-radius: var(--z-radius-small);
  background: var(--z-primary-soft); user-select: all; overflow-wrap: anywhere;
}

.dialog-backdrop { position: fixed; inset: 0; background: rgba(20, 18, 31, 0.55); display: grid; place-items: end center; padding: var(--z-gutter); z-index: 10; }
@media (min-width: 640px) { .dialog-backdrop { place-items: center; } }
.dialog { width: 100%; max-width: 480px; background: var(--z-surface); border-radius: var(--z-radius); padding: 20px; box-shadow: var(--z-shadow); }
.dialog .actions { justify-content: flex-end; }

#blazor-error-ui { display: none; position: fixed; inset: auto 0 0 0; padding: 12px var(--z-gutter); background: var(--z-danger-soft); color: var(--z-text); z-index: 20; }
.z-boot { max-width: 640px; margin: 0 auto; padding: 24px var(--z-gutter); color: var(--z-muted); }
.z-wordmark { font-weight: 800; font-size: 1.4rem; color: var(--z-primary); margin: 0 0 8px; }
