@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/open-sans-400.woff2") format("woff2");
}

@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/open-sans-600.woff2") format("woff2");
}

@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/open-sans-700.woff2") format("woff2");
}

:root {
    --brand: hsl(217 69% 33%);
    --primary: hsl(220 55% 18%);
    --text: hsl(220 30% 15%);
    --nav-text: hsl(0 1% 39%);
    --muted: hsl(220 10% 45%);
    --muted-surface: hsl(220 15% 95%);
    --line: hsl(220 15% 90%);
    --surface: #ffffff;
    --background: hsl(40 33% 98%);
    --refused: #a32020;
    --done: #1d6b3a;
    --radius: 0.5rem;
    font-family: "Open Sans", system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
}

body {
    margin: 0;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--brand);
    font-weight: 600;
    text-underline-offset: 0.2em;
}

a:hover {
    text-decoration-thickness: 2px;
}

header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid hsl(0 1% 57% / 0.3);
}

.ecosystem-bar {
    background: var(--brand);
    font-size: 0.8125rem;
    font-weight: 600;
}

.ecosystem-bar nav,
.site-bar,
.footer-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.ecosystem-bar nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    height: 2.25rem;
    overflow-x: auto;
    white-space: nowrap;
}

.ecosystem-bar a {
    color: rgb(255 255 255 / 0.8);
    text-decoration: none;
}

.ecosystem-bar a:hover {
    color: #ffffff;
}

.site-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
    min-height: 4.75rem;
}

.site-bar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.site-bar a {
    font-size: 0.9375rem;
    text-decoration: none;
}

.site-bar nav a {
    padding: 0.5rem 0.75rem;
    color: var(--nav-text);
    border-radius: calc(var(--radius) - 2px);
}

.site-bar nav a:hover,
.site-bar nav a.active {
    color: var(--brand);
}

.brand {
    display: flex;
    padding: 0.75rem 0;
}

.brand img {
    height: 2.75rem;
    width: auto;
}

.button-link {
    padding: 0.625rem 1.25rem;
    color: #ffffff;
    background: var(--brand);
    border-radius: calc(var(--radius) - 2px);
}

.button-link:hover {
    opacity: 0.9;
}

.admin-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}

.admin-bar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    flex: 1;
}

.admin-bar a {
    padding: 0.75rem 0;
    color: var(--nav-text);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.admin-bar a:hover {
    color: var(--brand);
}

.admin-bar a.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.admin-bar button {
    margin: 0.5rem 0;
}

main {
    flex: 1;
    width: 100%;
    max-width: 48rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    box-sizing: border-box;
}

h1, h2, h3, h4 {
    color: var(--primary);
    font-weight: 700;
    line-height: 1.25;
}

h1:focus {
    outline: none;
}

h1 {
    margin-top: 0;
    font-size: 2.25rem;
}

h2 {
    font-size: 1.5rem;
}

form {
    display: grid;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
}

label {
    display: grid;
    gap: 0.375rem;
    font-weight: 600;
}

input, textarea, select, button {
    font: inherit;
}

input, textarea, select {
    padding: 0.5rem 0.75rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 2px);
    min-width: 0;
}

input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

button {
    justify-self: start;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: opacity 0.15s;
}

button:hover:not(:disabled) {
    opacity: 0.9;
}

button:disabled {
    opacity: 0.6;
    cursor: default;
}

button.secondary {
    color: var(--brand);
    background: transparent;
}

button.secondary:hover:not(:disabled) {
    opacity: 1;
    background: hsl(217 69% 33% / 0.08);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    overflow: hidden;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

th {
    color: var(--primary);
    font-weight: 700;
    background: var(--muted-surface);
}

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

.voucher-qr {
    display: grid;
    gap: 1rem;
    justify-items: start;
    margin: 0;
}

.voucher-qr img {
    width: min(20rem, 100%);
    image-rendering: pixelated;
    background: #ffffff;
}

.voucher-qr figcaption {
    display: grid;
    gap: 0.375rem;
    width: 100%;
    font-weight: 600;
}

.voucher-text {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    background: var(--muted-surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 2px);
}

.voucher-text code {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

button.copy {
    display: grid;
    place-items: center;
    flex: none;
    padding: 0.375rem;
    color: var(--brand);
    background: transparent;
    border-color: transparent;
}

button.copy:hover:not(:disabled) {
    opacity: 1;
    background: hsl(217 69% 33% / 0.08);
}

button.copy svg {
    width: 1.125rem;
    height: 1.125rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hint {
    color: var(--muted);
    font-weight: 400;
}

.refused {
    color: var(--refused);
}

.done {
    color: var(--done);
}

.loading {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
}

footer {
    color: #ffffff;
    background: var(--brand);
}

.footer-inner {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.footer-inner img {
    height: 2.5rem;
    width: auto;
}

.footer-inner .tagline {
    margin: 1.25rem 0 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.footer-inner .legal {
    margin: 2rem 0 0;
    padding-top: 1.5rem;
    font-size: 0.875rem;
    color: rgb(255 255 255 / 0.75);
    border-top: 1px solid rgb(255 255 255 / 0.2);
}

.footer-inner a {
    color: rgb(255 255 255 / 0.85);
    font-weight: 400;
}

.footer-inner a:hover {
    color: #ffffff;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 1.25rem;
    background: #fff4c2;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    cursor: pointer;
}
