:root {
    color-scheme: dark;
    --bg: #05080b;
    --card: #0d1319;
    --line: #1d2833;
    --text: #e8eef4;
    --dim: #8a99a8;
    --accent: #4da3ff;
    --warn: #ffb454;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
}

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

.brand {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.stage {
    margin: 0 0 14px;
}

.track {
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.bar {
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width 0.25s ease;
}

.note {
    min-height: 1.5em;
    margin: 12px 0 0;
    color: var(--dim);
    font-size: 14px;
}

body[data-state="login"] .track,
body[data-state="failed"] .track {
    visibility: hidden;
}

body[data-state="failed"] .note,
body[data-state="login"] .note {
    color: var(--warn);
}

.login {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    text-align: left;
}

.login[hidden],
.retry[hidden] {
    display: none;
}

.login label {
    color: var(--dim);
    font-size: 14px;
}

.login input {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    letter-spacing: 0.08em;
}

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

button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #04121f;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

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

.retry {
    margin-top: 16px;
}
