@import url("/assets/altcha.css");

:root {
    color-scheme: light dark;
    --bg: #f4f5f2;
    --card: #ffffff;
    --text: #1d211c;
    --muted: #5f675d;
    --line: #d9ddd5;
    --accent: #2f7d4f;
    --accent-text: #ffffff;
    --error: #b3261e;
    --error-bg: #fdecea;
    --info-bg: #e8f3ec;
    --radius: 12px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #121512;
        --card: #1b1f1b;
        --text: #e7ebe5;
        --muted: #9aa397;
        --line: #2f352e;
        --accent: #5cbf83;
        --accent-text: #0e1a12;
        --error: #ffb4ab;
        --error-bg: #3b1714;
        --info-bg: #17301f;
    }
}

:root[data-theme="dark"] {
    --bg: #121512;
    --card: #1b1f1b;
    --text: #e7ebe5;
    --muted: #9aa397;
    --line: #2f352e;
    --accent: #5cbf83;
    --accent-text: #0e1a12;
    --error: #ffb4ab;
    --error-bg: #3b1714;
    --info-bg: #17301f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: var(--bg);
    color: var(--text);
}

.card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
}

.card.wide {
    max-width: 720px;
}

h1 {
    font-size: 1.5rem;
    margin: 0 0 8px;
}

h2 {
    font-size: 1.1rem;
    margin: 28px 0 12px;
}

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

.small {
    font-size: 0.85rem;
}

.stack {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
}

input,
select {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    width: 100%;
}

input:focus,
select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

button {
    font: inherit;
    font-weight: 600;
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-text);
    cursor: pointer;
}

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

button.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}

button.link {
    background: none;
    color: var(--accent);
    padding: 0;
    font-weight: 500;
}

a {
    color: var(--accent);
}

.notice {
    padding: 10px 12px;
    border-radius: 8px;
    margin: 12px 0;
}

.notice.error {
    background: var(--error-bg);
    color: var(--error);
}

.notice.info {
    background: var(--info-bg);
}

.foot {
    margin: 20px 0 0;
    text-align: center;
}

.row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.camera {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.issued {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.qr {
    width: 220px;
    max-width: 100%;
    justify-self: center;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
}

.qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.invites {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.invites li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}

altcha-widget {
    display: block;
}
