:root {
    color-scheme: light;
    font-family: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "MingLiU", "Microsoft JhengHei", serif;
    --ink: #071a33;
    --muted: #607089;
    --line: #d8e1ea;
    --soft: #f6f8fa;
    --black: #050505;
    --danger: #b42318;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    color: var(--ink);
    background: #fff;
}

.auth-page {
    min-height: 640px;
    display: grid;
    place-items: start center;
    padding: 70px 18px 92px;
}

.auth-panel {
    width: min(460px, 100%);
}

.auth-heading {
    text-align: center;
    margin-bottom: 22px;
}

.auth-heading p {
    margin: 0;
    color: var(--black);
    font-size: 34px;
    font-weight: 900;
    line-height: 1.1;
}

.auth-heading h1 {
    margin: 7px 0 0;
    color: var(--black);
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0;
}

.mode-switch {
    width: min(360px, 100%);
    margin: 0 auto 28px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
}

.mode-tab {
    position: relative;
    min-height: 48px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
}

.mode-tab.is-active {
    color: var(--black);
}

.mode-tab.is-active::after {
    content: "";
    position: absolute;
    left: 22%;
    right: 22%;
    bottom: -1px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: var(--black);
}

.mode-tab:hover {
    color: var(--black);
}

.auth-forms {
    position: relative;
}

.auth-form-panel {
    display: none;
}

.auth-form-panel.is-active {
    display: block;
}

.social-actions {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.social-button {
    min-height: 48px;
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    border: 1.5px solid var(--black);
    border-radius: 999px;
    background: #fff;
    color: var(--black);
    text-decoration: none;
    font-size: 15px;
    font-weight: 900;
}

.social-button span {
    width: 30px;
    height: 30px;
    margin-left: 12px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.line-button span, .facebook-button span { background: transparent; }
.auth-social-icon { width: 30px; height: 30px; display: block; object-fit: contain; filter: none; }
.line-icon-image { border-radius: 7px; }
.facebook-icon-image { border-radius: 999px; }
.social-button strong { text-align: center; }

.divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
    color: var(--muted);
    font-size: 14px;
}

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

.field,
.register-email-step {
    margin-bottom: 14px;
}

.register-email-step input {
    margin-bottom: 14px;
}

label {
    display: block;
    margin: 0 0 8px;
    color: #3a4658;
    font-size: 14px;
    font-weight: 800;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    height: 43px;
    border: 1.5px solid var(--black);
    border-radius: 999px;
    padding: 0 20px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    outline: none;
}

input[readonly] {
    border-color: var(--line);
    background: var(--soft);
    color: var(--muted);
}

input::placeholder {
    color: #8d99a8;
}

input:focus {
    box-shadow: 0 0 0 4px rgba(7, 26, 51, .08);
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 78px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.password-toggle:hover,
.password-toggle:focus {
    background: rgba(7, 26, 51, .06);
    color: var(--ink);
}

.password-eye {
    width: 21px;
    height: 21px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-eye-off,
.password-toggle.is-visible .password-eye-open {
    display: none;
}

.password-toggle.is-visible .password-eye-off {
    display: block;
}

.submit-button {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    background: var(--black);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .06em;
    cursor: pointer;
}

.submit-button:hover {
    background: #222;
}

.remember-row {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 3px 0 20px;
    color: #3a4658;
    font-weight: 700;
}

.remember-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--black);
}

.login-assist-row,
.form-meta {
    display: flex;
    justify-content: flex-end;
    margin: -3px 0 16px;
}

.form-meta {
    justify-content: center;
    margin: 18px 0 0;
}

.forgot-password-link,
.form-meta a {
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    border-bottom: 1px solid rgba(7, 26, 51, .35);
}

.forgot-password-link:hover,
.form-meta a:hover {
    border-bottom-color: var(--ink);
}

.almost-title {
    margin: 34px 0 28px;
    text-align: center;
}

.almost-title h2 {
    margin: 0;
    color: var(--black);
    font-size: 32px;
    line-height: 1.15;
    font-weight: 900;
}

.almost-title p {
    max-width: 310px;
    margin: 10px auto 0;
    color: var(--black);
    line-height: 1.65;
    font-weight: 700;
}

.text-button {
    width: 100%;
    margin-top: 14px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.status-message,
.error {
    border-radius: 8px;
}

.status-message {
    margin: 0 0 18px;
    padding: 11px 14px;
    border: 1px solid #c8d9e8;
    background: var(--soft);
    color: #1f5f91;
    font-weight: 800;
}

.error {
    margin: 8px 0 0;
    color: var(--danger);
    font-size: 13px;
    font-weight: 800;
}

@media (min-width: 780px) {
    .auth-page {
        padding-top: 78px;
    }

    .auth-panel {
        padding: 0 5px;
    }
}

@media (max-width: 520px) {
    .auth-page {
        min-height: auto;
        padding: 44px 18px 92px;
        place-items: start stretch;
    }

    .auth-panel {
        width: 100%;
    }

    .auth-heading {
        margin-bottom: 26px;
    }

    .social-button {
        grid-template-columns: 44px 1fr 44px;
    }
}
