/* ログイン画面 */
.auth-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 416px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.auth-logo {
    width: 70%;
    max-width: 260px;
    height: auto;
}

.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 32px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, .08);
}

    .auth-form h1 {
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: 4px;
    }

/* 入力欄とエラーメッセージのまとまり */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ログインボタンは入力欄と同じ高さ（48px）に揃える */
.auth-form button[type="submit"] {
    height: 48px;
    margin-top: 4px;
}

.auth-copyright {
    margin: 0;
    color: #94a3b8;
    font-size: .8125rem;
}

.auth-secondary-form {
    width: 100%;
}

.two-factor-card {
    max-width: 520px;
}

.two-factor-card p {
    color: var(--ink-muted);
    font-size: .9375rem;
}

.two-factor-card label:not(.field) {
    display: block;
    margin-bottom: 4px;
    color: var(--ink-strong);
    font-weight: 700;
}

.two-factor-card small {
    color: var(--ink-muted);
}

.two-factor-card hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
}

/*==================================================
    ログイン処理中のオーバーレイ
    送信からリダイレクト完了までの進行中表示（ポータルと同じリング型スピナー）
==================================================*/
.auth-loading {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(247, 250, 252, .78);
    /* 表示を 150ms 遅らせてからフェードインし、即座に応答が返る場合の明滅を防ぐ */
    animation: auth-loading-in .15s cubic-bezier(.16, 1, .3, 1) .15s backwards;
}

    /* display:flex を打ち消して hidden 属性での出し分けを効かせる */
    .auth-loading[hidden] {
        display: none;
    }

/* CSS ボーダートリックによるスピナー（ポータルの LoadingPanel と同寸法・同配色） */
.auth-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--line);
    border-top-color: var(--color-primary);
    border-radius: 9999px;
    animation: auth-spin .8s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes auth-loading-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* モーション軽減設定では回転を止め、オーバーレイの表示だけで処理中を伝える（STD-UI-ANIM 準拠・ポータルと同じ扱い） */
@media (prefers-reduced-motion: reduce) {
    .auth-loading {
        animation: auth-loading-in .15s ease-out both;
    }

    .auth-spinner {
        animation: none;
    }
}
