html, body {
    margin: 0;
    min-height: 100%;
    background: #0f172a;
    color: #e5e7eb;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Blazor circuit error banner. Global (not scoped) so it is hidden by default on EVERY layout,
   including the chrome-less GuestLayout used by the guest upload page. Blazor reveals it by
   setting an inline display on #blazor-error-ui when a genuine circuit error occurs, so the
   default here must be `none` WITHOUT !important (otherwise it could never appear). */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #dc3545;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.4);
}
#blazor-error-ui .blazor-error-icon { font-size: 1.5rem; }
#blazor-error-ui .blazor-error-link,
#blazor-error-ui .blazor-error-dismiss {
    color: #fff;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    padding: 0 0.5rem;
}
#blazor-error-ui .blazor-error-dismiss { font-size: 1.2rem; padding: 0 0.25rem; opacity: 0.8; }
#blazor-error-ui .blazor-error-dismiss:hover { opacity: 1; }

a { color: #38bdf8; }
.content { padding: 0; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
    gap: 2rem;
    align-items: center;
    padding: 5rem min(6vw, 5rem);
    background: radial-gradient(circle at top left, rgba(45, 212, 191, .28), transparent 35%), linear-gradient(135deg, #111827 0%, #0f172a 58%, #164e63 100%);
}

.hero h1 { font-size: clamp(2.5rem, 6vw, 5rem); line-height: .95; font-weight: 850; margin: .5rem 0 1rem; }
.lead { font-size: 1.25rem; color: #cbd5e1; max-width: 68ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; color: #5eead4; font-weight: 800; font-size: .8rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-card, .panel, .feature-grid > div, .price-card, .result-card {
    border: 1px solid rgba(148, 163, 184, .25);
    background: rgba(15, 23, 42, .72);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
    border-radius: 28px;
}
.hero-card { padding: 2rem; text-align: center; display: grid; gap: 1rem; }
.qr-preview, .qr-large {
    display: grid; place-items: center; margin: auto; width: 180px; height: 180px;
    border-radius: 24px; background: repeating-linear-gradient(45deg, #fff 0 12px, #111827 12px 24px);
    color: #fff; font-weight: 900; font-size: 2.8rem; text-shadow: 0 2px 12px #000;
}
.qr-large { width: 140px; height: 140px; font-size: 1rem; }
.feature-grid, .pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 2rem min(6vw, 5rem); }
.pricing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feature-grid > div, .price-card { padding: 1.5rem; }
.panel { margin: 2rem min(6vw, 5rem); padding: 2rem; }
.panel.narrow { max-width: 780px; margin-left: auto; margin-right: auto; }
.form-stack { display: grid; gap: .75rem; max-width: 620px; }
.muted { color: #94a3b8; }
.price { font-size: 2.2rem; font-weight: 900; color: #5eead4; }
.gallery-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.media-card { overflow: hidden; border: 1px solid rgba(148, 163, 184, .22); border-radius: 18px; background: rgba(30, 41, 59, .8); }
.media-card img, .media-card video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #020617; }
.media-card div { padding: 1rem; display: grid; gap: .25rem; }
.media-card span { color: #94a3b8; font-size: .9rem; }
.alert { border-radius: 16px; }

@media (max-width: 900px) {
    .hero, .feature-grid, .pricing-grid { grid-template-columns: 1fr; }
    .hero { padding-top: 3rem; }
}

/* ---- Host area (v1) ---- */
.empty-state { text-align: center; padding: 3rem 1rem; display: grid; gap: 1rem; justify-items: center; }
.event-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.event-card { display: grid; gap: .5rem; padding: 1.25rem; border: 1px solid rgba(148,163,184,.22); border-radius: 18px; background: rgba(30,41,59,.8); text-decoration: none; color: inherit; transition: transform .12s ease, border-color .12s ease; }
.event-card:hover { transform: translateY(-2px); border-color: rgba(148,163,184,.5); }
.event-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.event-card-meta { color: #94a3b8; font-size: .9rem; }
.status-chip { font-size: .75rem; padding: .15rem .6rem; border-radius: 999px; background: rgba(148,163,184,.2); }
.status-chip.status-active { background: rgba(52,211,153,.2); color: #6ee7b7; }
.status-chip.status-expired { background: rgba(251,191,36,.2); color: #fcd34d; }
.status-chip.status-cancelled { background: rgba(248,113,113,.2); color: #fca5a5; }
.tabs { display: flex; gap: .5rem; border-bottom: 1px solid rgba(148,163,184,.22); margin: 1.5rem 0; flex-wrap: wrap; }
.tab { background: none; border: none; color: #94a3b8; padding: .6rem 1rem; cursor: pointer; border-bottom: 2px solid transparent; font: inherit; }
.tab.active { color: #fff; border-bottom-color: #6d28d9; }
.toggle-row { display: flex; align-items: center; gap: .5rem; }
.form-inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.link-table, .settings-list { width: 100%; border-collapse: collapse; }
.link-table th, .link-table td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid rgba(148,163,184,.15); }
.settings-list { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.5rem; margin-bottom: 2rem; }
.settings-list dt { color: #94a3b8; }
.danger-zone { border: 1px solid rgba(248,113,113,.35); border-radius: 16px; padding: 1.25rem; }
.result-card { border: 1px solid rgba(148,163,184,.22); border-radius: 18px; padding: 1.5rem; background: rgba(30,41,59,.8); }
/* Reserve space for the QR SVG so the following caption never overlaps it. */
.qr-large { margin: 1rem 0; min-height: 200px; line-height: 0; }
.qr-large svg { display: block; }
.nav-link-button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }
.nav-form { display: inline; margin: 0; }
.auth-checking { padding: 3rem; text-align: center; color: #94a3b8; }
.text-center { text-align: center; }

/* ---- Legal + footer + guest layout ---- */
.legal h2 { margin-top: 1.5rem; }
.footer-links { display: flex; gap: 1rem; justify-content: center; margin-top: .5rem; }
.footer-links a, .guest-footer a { color: #94a3b8; text-decoration: none; }
.footer-links a:hover, .guest-footer a:hover { text-decoration: underline; }
.guest-page { min-height: 100dvh; display: flex; flex-direction: column; }
.guest-page main { flex: 1; }
.guest-footer { display: flex; gap: 1rem; justify-content: center; padding: 1.5rem; }
.privacy-note { font-size: .85rem; color: #94a3b8; margin-top: 1rem; }
.guest-upload h1 { margin-bottom: .25rem; }

/* Guest upload actions: two big, unmistakable steps kept at the top of the page so they never
   scroll out of reach. Choose = blue (step 1), upload = green (step 2). */
.upload-actions {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin: 1.5rem 0;
}
.btn-choose, .btn-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1.15rem 2.25rem;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    line-height: 1.2;
    transition: background .15s ease, transform .05s ease;
}
.btn-ico { font-size: 1.35em; line-height: 1; }
.btn-choose { background: #2563eb; box-shadow: 0 6px 18px rgba(37,99,235,.35); }
.btn-choose:hover { background: #1d4ed8; }
.btn-choose:active { transform: translateY(1px); }
.btn-choose.is-disabled { background: #3b5b80; opacity: .8; cursor: default; box-shadow: none; pointer-events: none; }
/* Keyboard focus ring driven by the visually-hidden native input that precedes the label. */
.guest-file-input:focus-visible + .btn-choose { outline: 3px solid #93c5fd; outline-offset: 2px; }

.btn-upload { background: #16a34a; box-shadow: 0 6px 18px rgba(22,163,74,.35); }
.btn-upload:hover:not(:disabled) { background: #15803d; }
.btn-upload:active:not(:disabled) { transform: translateY(1px); }
.btn-upload:disabled { background: #4b7c5a; opacity: .8; cursor: default; box-shadow: none; }

/* "Verwerfen" is deliberately quiet so it never competes with the two primary buttons. */
.btn-clear {
    align-self: center;
    background: none;
    border: none;
    color: #94a3b8;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    padding: .25rem;
}
.btn-clear:disabled { opacity: .5; cursor: default; }

/* Native file input kept in the DOM (JS reads it) but visually hidden; the styled label is
   the real button. Not display:none, so it stays keyboard-focusable. */
.guest-file-input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
@media (min-width: 641px) { .upload-actions { flex-direction: row; flex-wrap: wrap; align-items: center; } }

/* ---- Moderation ---- */
.filter-chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip { background: rgba(148,163,184,.15); border: none; color: #cbd5e1; padding: .35rem .9rem; border-radius: 999px; cursor: pointer; font: inherit; }
.chip.active { background: #6d28d9; color: #fff; }
.mod-badge { display: inline-block; font-size: .7rem; padding: .1rem .5rem; border-radius: 999px; }
.mod-badge.mod-approved { background: rgba(52,211,153,.2); color: #6ee7b7; }
.mod-badge.mod-pending { background: rgba(251,191,36,.2); color: #fcd34d; }
.mod-badge.mod-rejected { background: rgba(248,113,113,.2); color: #fca5a5; }
.media-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }
