:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #172033;
    background: #f4f6fa;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 12%, rgba(98, 125, 255, 0.12), transparent 34%),
        radial-gradient(circle at 82% 88%, rgba(51, 193, 163, 0.1), transparent 32%),
        #f4f6fa;
}

button,
input {
    font: inherit;
}

.page-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}

.account-card {
    width: min(100%, 430px);
    padding: 28px;
    border: 1px solid rgba(21, 32, 54, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(31, 45, 76, 0.12);
}

.mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 5px;
    border-radius: 12px;
    background: #f0f3f8;
}

.mode-tab {
    min-height: 42px;
    border: 0;
    border-radius: 9px;
    color: #687287;
    background: transparent;
    cursor: pointer;
}

.mode-tab.is-active {
    color: #172033;
    background: #fff;
    box-shadow: 0 3px 12px rgba(31, 45, 76, 0.08);
    font-weight: 650;
}

.mode-panel h1 {
    margin: 30px 0 24px;
    font-size: 25px;
    letter-spacing: 0.02em;
}

.mode-panel form {
    display: grid;
    gap: 18px;
}

.mode-panel label {
    display: grid;
    gap: 8px;
    color: #4f5b70;
    font-size: 14px;
    font-weight: 600;
}

.mode-panel input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #d8deea;
    border-radius: 10px;
    outline: none;
    color: #172033;
    background: #fff;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.mode-panel input:focus {
    border-color: #526cf4;
    box-shadow: 0 0 0 4px rgba(82, 108, 244, 0.12);
}

.primary-button,
.secondary-button {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 650;
}

.primary-button {
    border: 1px solid #4059dd;
    color: #fff;
    background: #4059dd;
}

.primary-button:hover {
    background: #334bc9;
}

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

.secondary-button {
    border: 1px solid #d8deea;
    color: #344056;
    background: #fff;
}

.form-message {
    min-height: 20px;
    margin: -5px 0 -3px;
    color: #c43c52;
    font-size: 13px;
    line-height: 1.5;
}

.helper-text {
    margin: -10px 0 24px;
    color: #687287;
    font-size: 14px;
    line-height: 1.7;
}

.session-status {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #715815;
    background: #fff6d8;
    font-size: 13px;
    line-height: 1.6;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(12, 19, 34, 0.52);
}

.modal-backdrop[hidden] {
    display: none;
}

.notice-dialog {
    width: min(100%, 390px);
    padding: 28px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 90px rgba(6, 12, 26, 0.28);
}

.notice-dialog p {
    margin: 0 0 24px;
    font-size: 17px;
    line-height: 1.75;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 520px) {
    .page-shell {
        align-items: start;
        padding-top: 20px;
    }

    .account-card {
        padding: 20px;
        border-radius: 16px;
    }

    .mode-tab {
        font-size: 13px;
    }
}
