/* A deliberately plain, dark, dense interface. The point of this UI is to make distributed
   behaviour legible, so nothing here competes with the seat map or the saga steps. */

:root {
    --bg: #14161a;
    --panel: #1c1f26;
    --line: #2a2f39;
    --text: #e6e8ec;
    --muted: #8b93a3;
    --accent: #4a9eff;
    --ok: #3fb950;
    --warn: #d29922;
    --bad: #f85149;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
}

.boot { padding: 3rem; color: var(--muted); }

.shell { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; min-height: 100vh; display: flex; flex-direction: column; }

header {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .14em; color: var(--text); text-decoration: none; font-size: .85rem; }
header nav { display: flex; gap: 1rem; flex: 1; }
header nav a { color: var(--muted); text-decoration: none; font-size: .9rem; }
header nav a:hover { color: var(--text); }
.who { display: flex; align-items: center; gap: .75rem; font-size: .85rem; }
.user { color: var(--muted); }

main { flex: 1; padding: 1.5rem 0 3rem; }

footer {
    display: flex; gap: 1rem; align-items: center;
    padding: 1rem 0; border-top: 1px solid var(--line);
    color: var(--muted); font-size: .8rem;
}
footer .spacer { flex: 1; }
footer a { color: var(--muted); }

h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 0 0 .35rem; }
h2.section { margin: 1.75rem 0 .5rem; color: var(--muted); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
code { background: #10131a; padding: .1rem .35rem; border-radius: 3px; font-size: .85em; }

button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
button.primary {
    background: var(--accent); color: #06121f; border: none;
    padding: .6rem 1.1rem; border-radius: 6px; font-weight: 600;
}

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem; }
.panel.narrow { max-width: 460px; }

.hint {
    background: #16202b; border-left: 3px solid var(--accent);
    padding: .8rem 1rem; border-radius: 0 6px 6px 0;
    margin-bottom: 1.25rem; font-size: .9rem; color: #c6d3e2;
}

.error { color: var(--bad); }
.error-text { color: var(--bad); }

/* --- sign in --- */
.accounts { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.account {
    display: flex; flex-direction: column; gap: .15rem; text-align: left;
    background: #232833; border: 1px solid var(--line); color: var(--text);
    padding: .7rem .9rem; border-radius: 6px;
}
.account:hover:not(:disabled) { border-color: var(--accent); }
.account-name { font-weight: 600; }
.account-email { color: var(--muted); font-size: .82rem; }

/* --- events --- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .85rem; }
.card {
    text-align: left; background: var(--panel); border: 1px solid var(--line);
    color: var(--text); padding: 1rem; border-radius: 8px;
}
.card:hover { border-color: var(--accent); }
.card .when { margin: .5rem 0 0; font-size: .85rem; }

/* --- seat map --- */
.legend { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; font-size: .82rem; color: var(--muted); }
.legend .refresh { margin-left: auto; }
.sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.sw.available { background: #2f3b4d; }
.sw.held { background: var(--warn); }
.sw.sold { background: #3a3f4a; }
.sw.picked { background: var(--accent); }

.row { display: flex; align-items: center; gap: .3rem; margin-bottom: .3rem; }
.row-label { width: 1.5rem; color: var(--muted); font-size: .8rem; }
.seat {
    width: 2.1rem; height: 2.1rem; border-radius: 4px;
    border: 1px solid transparent; font-size: .78rem;
    background: #2f3b4d; color: var(--text);
    transition: background .25s;
}
.seat:hover:not(:disabled) { border-color: var(--accent); }
.seat.held { background: var(--warn); color: #241a00; }
.seat.sold { background: #3a3f4a; color: #6b7280; }
.seat.picked { background: var(--accent); color: #06121f; font-weight: 700; }

.checkout {
    display: flex; align-items: center; gap: 1rem;
    margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.checkout > div:first-child { flex: 1; }

/* --- saga --- */
.saga { display: flex; flex-direction: column; gap: 0; margin-bottom: 1.5rem; }
.step { display: flex; gap: .9rem; padding: .6rem 0; position: relative; }
.step .dot {
    width: .85rem; height: .85rem; border-radius: 50%; margin-top: .35rem;
    background: #333a46; flex: none; border: 2px solid #333a46;
}
.step:not(:last-child)::before {
    content: ""; position: absolute; left: .38rem; top: 1.5rem; bottom: -.35rem;
    width: 2px; background: #333a46;
}
.step.done .dot { background: var(--ok); border-color: var(--ok); }
.step.active .dot { background: var(--accent); border-color: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.step.failed .dot { background: var(--bad); border-color: var(--bad); }
.step.pending { opacity: .45; }
.step-name { font-weight: 600; }
.step-detail { font-size: .84rem; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.kv { display: flex; gap: 1rem; padding: .35rem 0; font-size: .9rem; }
.kv span:first-child { width: 6rem; color: var(--muted); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.pending { color: var(--warn); }
.trace { margin-top: 1rem; font-size: .85rem; }

/* --- tickets --- */
.tickets { display: flex; flex-direction: column; gap: .7rem; }
.ticket {
    display: flex; gap: 1rem; background: var(--panel);
    border: 1px solid var(--line); border-radius: 8px; padding: 1rem;
}
.ticket.cancelled { opacity: .6; }
.ticket-main { flex: 1; }
.ticket .seats { margin: .4rem 0 0; font-family: ui-monospace, monospace; font-size: .85rem; }
.ticket-side { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.badge { padding: .15rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 600; background: #23301f; }
.badge.bad { background: #33201f; }
.price { color: var(--muted); font-size: .85rem; }

.notifications { display: flex; flex-direction: column; gap: .5rem; }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; font-size: .88rem; }
.note span { float: right; font-size: .78rem; }
.note p { margin: .3rem 0 0; color: var(--muted); }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bad); color: #fff; padding: .7rem 1.25rem; z-index: 100;
}
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
