:root {
    color-scheme: dark;
    --bg: #111318;
    --surface: #181b22;
    --surface-2: #20242d;
    --border: #343a47;
    --text: #f6f7fb;
    --muted: #aab0bf;
    --accent: #7c6cff;
    --accent-hover: #9084ff;
}

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

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 50% 18%, rgba(124, 108, 255, 0.2), transparent 34%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

:focus-visible {
    outline: 3px solid #aaa1ff;
    outline-offset: 2px;
}

.home {
    width: 100%;
    min-height: calc(100vh - 60px);
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.welcome-card {
    width: min(520px, 100%);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(24, 27, 34, 0.96);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, #8d80ff, #5d4ee8);
    box-shadow: 0 10px 28px rgba(90, 76, 224, 0.32);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

h1 {
    margin: 0;
    font-size: 1.45rem;
    letter-spacing: -0.025em;
}

.brand-lockup p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 24px 0;
}

.feature-row span {
    padding: 6px 9px;
    border: 1px solid rgba(124, 108, 255, 0.28);
    border-radius: 999px;
    background: rgba(124, 108, 255, 0.1);
    color: #d8d4ff;
    font-size: 0.7rem;
    font-weight: 700;
}

.entry-form label {
    display: block;
    margin-bottom: 7px;
    color: #dde0e8;
    font-size: 0.78rem;
    font-weight: 750;
}

.join-row {
    display: flex;
    gap: 8px;
}

.form-control {
    min-width: 0;
    min-height: 46px;
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text);
}

.form-control::placeholder {
    color: #858c9c;
}

.form-control option {
    background: var(--surface-2);
    color: var(--text);
}

.btn {
    min-height: 46px;
    padding: 9px 18px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.btn:hover {
    background: var(--accent-hover);
}

.btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.form-hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.68rem;
}

.or-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: #777f90;
    font-size: 0.68rem;
    font-weight: 750;
    text-transform: uppercase;
}

.or-divider::before,
.or-divider::after {
    height: 1px;
    flex: 1;
    background: var(--border);
    content: "";
}

#errormessage {
    min-height: 22px;
    margin: 12px 0 0;
    color: #ff909d;
    font-size: 0.78rem;
    font-weight: 700;
}

.groups {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.nogroups {
    display: none;
}

.groups h2 {
    margin: 0 0 8px;
    font-size: 0.88rem;
}

#public-groups-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--muted);
    font-size: 0.75rem;
}

#public-groups-table td {
    padding: 7px 4px;
    border-bottom: 1px solid rgba(52, 58, 71, 0.6);
}

a {
    color: #bab3ff;
}

a:hover {
    color: #dedaff;
}

.signature {
    min-height: 60px;
    padding: 10px 16px;
    border: 0;
    color: #7f8696;
    font-size: 0.7rem;
    text-align: center;
}

@media (max-width: 520px) {
    .welcome-card {
        padding: 22px 16px;
        border-radius: 14px;
    }

    .join-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
