:root {
    color-scheme: light;
    --ink: #111111;
    --muted: #666666;
    --quiet: #8a8a8a;
    --line: #d8d8d8;
    --soft: #f5f5f5;
    --paper: #ffffff;
    --error: #b42318;
    --success: #18794e;
    --focus: #3b82f6;
    --radius: 6px;
    --motion: 180ms ease;
    font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
    letter-spacing: 0;
}

.registration-shell {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 40px 24px 56px;
}

.page-header {
    margin-bottom: 32px;
}

.brand-mark {
    display: block;
    width: 28px;
    height: 5px;
    margin-bottom: 24px;
    background: var(--ink);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

h1,
h2,
p {
    text-wrap: pretty;
}

h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.25;
    font-weight: 750;
}

.intro {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.access-state {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0 0 28px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
    color: var(--muted);
    font-size: 14px;
}

.status-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--quiet);
    animation: pulse 1.1s ease-in-out infinite;
}

.access-state.ready {
    color: var(--success);
    border-color: #b7d5c6;
    background: #f1f8f4;
}

.access-state.ready .status-dot {
    background: var(--success);
    animation: none;
}

.access-state.error {
    color: var(--error);
    border-color: #e7c1bd;
    background: #fff6f5;
}

.access-state.error .status-dot {
    background: var(--error);
    animation: none;
}

.field {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 9px;
    font-size: 15px;
    font-weight: 700;
}

input {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: none;
    color: var(--ink);
    background: var(--paper);
    transition: border-color var(--motion), box-shadow var(--motion);
}

input::placeholder {
    color: #a0a0a0;
}

input:hover {
    border-color: #a8a8a8;
}

input:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.1);
}

input[aria-invalid="true"] {
    border-color: var(--error);
}

.field-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 20px;
    margin-top: 7px;
    color: var(--quiet);
    font-size: 12px;
    line-height: 1.5;
}

.field-error {
    color: var(--error);
    text-align: right;
}

.primary-button {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--paper);
    font-weight: 700;
    cursor: pointer;
    transition: background var(--motion), transform var(--motion), opacity var(--motion);
}

.primary-button:hover {
    background: #303030;
}

.primary-button:active {
    transform: translateY(1px);
}

.primary-button:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.privacy-note {
    margin: 14px 0 0;
    color: var(--quiet);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.success-state {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.success-symbol {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin-bottom: 24px;
    border: 2px solid var(--success);
    border-radius: 50%;
    color: var(--success);
    font-size: 24px;
    font-weight: 700;
}

.success-state h2 {
    margin: 0;
    font-size: 26px;
}

.success-state > p {
    margin: 10px 0 28px;
    color: var(--muted);
}

.success-state dl {
    margin: 0;
    border-top: 1px solid var(--line);
}

.success-state dl div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}

.success-state dt {
    color: var(--muted);
}

.success-state dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

dialog {
    width: min(calc(100% - 40px), 400px);
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
    color: var(--ink);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.dialog-body {
    padding: 24px;
}

.dialog-body h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.dialog-body p {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.7;
}

@keyframes pulse {
    50% {
        opacity: 0.35;
    }
}

@media (min-width: 700px) {
    body {
        background: var(--soft);
    }

    .registration-shell {
        margin-top: 48px;
        margin-bottom: 48px;
        padding: 48px;
        border: 1px solid var(--line);
        background: var(--paper);
    }
}

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